From 03be111a086360687f20b2ac1d490584fb4fbefe Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Wed, 13 Jan 2021 19:55:22 -0800 Subject: [PATCH] feat(clients): update README with documentation, usage and more (#1907) --- clients/client-accessanalyzer/README.md | 205 +++- clients/client-acm-pca/README.md | 214 +++- clients/client-acm/README.md | 205 +++- clients/client-alexa-for-business/README.md | 206 +++- clients/client-amplify/README.md | 204 +++- clients/client-amplifybackend/README.md | 199 +++- clients/client-api-gateway/README.md | 201 +++- .../client-apigatewaymanagementapi/README.md | 199 +++- clients/client-apigatewayv2/README.md | 199 +++- clients/client-app-mesh/README.md | 211 +++- clients/client-appconfig/README.md | 248 ++++- clients/client-appflow/README.md | 227 ++++- clients/client-appintegrations/README.md | 202 +++- .../client-application-auto-scaling/README.md | 268 ++++- .../README.md | 330 +++++- clients/client-application-insights/README.md | 212 +++- clients/client-appstream/README.md | 220 +++- clients/client-appsync/README.md | 200 +++- clients/client-athena/README.md | 211 +++- clients/client-auditmanager/README.md | 229 ++++- clients/client-auto-scaling-plans/README.md | 207 +++- clients/client-auto-scaling/README.md | 205 +++- clients/client-backup/README.md | 203 +++- clients/client-batch/README.md | 208 +++- clients/client-braket/README.md | 199 +++- clients/client-budgets/README.md | 241 ++++- clients/client-chime/README.md | 236 ++++- clients/client-cloud9/README.md | 257 ++++- clients/client-clouddirectory/README.md | 205 +++- clients/client-cloudformation/README.md | 214 +++- clients/client-cloudfront/README.md | 202 +++- clients/client-cloudhsm-v2/README.md | 200 +++- clients/client-cloudhsm/README.md | 210 +++- clients/client-cloudsearch-domain/README.md | 202 +++- clients/client-cloudsearch/README.md | 206 +++- clients/client-cloudtrail/README.md | 214 +++- clients/client-cloudwatch-events/README.md | 220 +++- clients/client-cloudwatch-logs/README.md | 232 ++++- clients/client-cloudwatch/README.md | 213 +++- clients/client-codeartifact/README.md | 474 ++++++++- clients/client-codebuild/README.md | 384 ++++++- clients/client-codecommit/README.md | 590 ++++++++++- clients/client-codedeploy/README.md | 299 +++++- clients/client-codeguru-reviewer/README.md | 214 +++- clients/client-codeguruprofiler/README.md | 199 +++- clients/client-codepipeline/README.md | 394 ++++++- clients/client-codestar-connections/README.md | 279 ++++- .../client-codestar-notifications/README.md | 283 +++++- clients/client-codestar/README.md | 289 +++++- .../README.md | 207 +++- clients/client-cognito-identity/README.md | 213 +++- clients/client-cognito-sync/README.md | 206 +++- clients/client-comprehend/README.md | 202 +++- clients/client-comprehendmedical/README.md | 200 +++- clients/client-compute-optimizer/README.md | 211 +++- clients/client-config-service/README.md | 222 +++- clients/client-connect-contact-lens/README.md | 211 +++- clients/client-connect/README.md | 212 +++- clients/client-connectparticipant/README.md | 204 +++- .../README.md | 222 +++- clients/client-cost-explorer/README.md | 212 +++- clients/client-customer-profiles/README.md | 209 +++- clients/client-data-pipeline/README.md | 203 +++- .../README.md | 212 +++- clients/client-databrew/README.md | 202 +++- clients/client-dataexchange/README.md | 199 +++- clients/client-datasync/README.md | 205 +++- clients/client-dax/README.md | 204 +++- clients/client-detective/README.md | 239 ++++- clients/client-device-farm/README.md | 213 +++- clients/client-devops-guru/README.md | 197 +++- clients/client-direct-connect/README.md | 210 +++- clients/client-directory-service/README.md | 205 +++- clients/client-dlm/README.md | 199 +++- clients/client-docdb/README.md | 199 +++- clients/client-dynamodb-streams/README.md | 204 +++- clients/client-dynamodb/README.md | 216 +++- clients/client-ebs/README.md | 217 +++- clients/client-ec2-instance-connect/README.md | 201 +++- clients/client-ec2/README.md | 222 +++- clients/client-ecr-public/README.md | 206 +++- clients/client-ecr/README.md | 206 +++- clients/client-ecs/README.md | 214 +++- clients/client-efs/README.md | 204 +++- clients/client-eks/README.md | 208 +++- clients/client-elastic-beanstalk/README.md | 212 +++- clients/client-elastic-inference/README.md | 201 +++- .../README.md | 234 ++++- .../client-elastic-load-balancing/README.md | 219 +++- clients/client-elastic-transcoder/README.md | 201 +++- clients/client-elasticache/README.md | 209 +++- .../client-elasticsearch-service/README.md | 212 +++- clients/client-emr-containers/README.md | 220 +++- clients/client-emr/README.md | 202 +++- clients/client-eventbridge/README.md | 220 +++- clients/client-firehose/README.md | 203 +++- clients/client-fms/README.md | 207 +++- clients/client-forecast/README.md | 199 +++- clients/client-forecastquery/README.md | 199 +++- clients/client-frauddetector/README.md | 201 +++- clients/client-fsx/README.md | 200 +++- clients/client-gamelift/README.md | 250 ++++- clients/client-glacier/README.md | 236 ++++- clients/client-global-accelerator/README.md | 347 ++++++- clients/client-glue/README.md | 201 +++- clients/client-greengrass/README.md | 199 +++- clients/client-groundstation/README.md | 202 +++- clients/client-guardduty/README.md | 215 +++- clients/client-health/README.md | 236 ++++- clients/client-healthlake/README.md | 200 +++- clients/client-honeycode/README.md | 203 +++- clients/client-iam/README.md | 204 +++- clients/client-identitystore/README.md | 197 +++- clients/client-imagebuilder/README.md | 199 +++- clients/client-inspector/README.md | 203 +++- .../README.md | 207 +++- clients/client-iot-1click-projects/README.md | 199 +++- clients/client-iot-data-plane/README.md | 210 +++- clients/client-iot-events-data/README.md | 201 +++- clients/client-iot-events/README.md | 201 +++- clients/client-iot-jobs-data-plane/README.md | 209 +++- clients/client-iot/README.md | 215 +++- clients/client-iotanalytics/README.md | 217 +++- clients/client-iotsecuretunneling/README.md | 204 +++- clients/client-iotsitewise/README.md | 200 +++- clients/client-iotthingsgraph/README.md | 204 +++- clients/client-ivs/README.md | 471 ++++++++- clients/client-kafka/README.md | 199 +++- clients/client-kendra/README.md | 199 +++- clients/client-kinesis-analytics-v2/README.md | 207 +++- clients/client-kinesis-analytics/README.md | 215 +++- .../README.md | 199 +++- clients/client-kinesis-video-media/README.md | 199 +++- .../client-kinesis-video-signaling/README.md | 201 +++- clients/client-kinesis-video/README.md | 199 +++- clients/client-kinesis/README.md | 202 +++- clients/client-kms/README.md | 288 +++++- clients/client-lakeformation/README.md | 201 +++- clients/client-lambda/README.md | 206 +++- .../README.md | 206 +++- clients/client-lex-runtime-service/README.md | 207 +++- clients/client-license-manager/README.md | 202 +++- clients/client-lightsail/README.md | 213 +++- clients/client-lookoutvision/README.md | 205 +++- clients/client-machine-learning/README.md | 200 +++- clients/client-macie/README.md | 210 +++- clients/client-macie2/README.md | 199 +++- clients/client-managedblockchain/README.md | 200 +++- clients/client-marketplace-catalog/README.md | 205 +++- .../README.md | 205 +++- .../README.md | 222 +++- clients/client-marketplace-metering/README.md | 256 ++++- clients/client-mediaconnect/README.md | 199 +++- clients/client-mediaconvert/README.md | 199 +++- clients/client-medialive/README.md | 199 +++- clients/client-mediapackage-vod/README.md | 199 +++- clients/client-mediapackage/README.md | 199 +++- clients/client-mediastore-data/README.md | 201 +++- clients/client-mediastore/README.md | 200 +++- clients/client-mediatailor/README.md | 199 +++- clients/client-migration-hub/README.md | 204 +++- clients/client-migrationhub-config/README.md | 224 +++- clients/client-mobile/README.md | 203 +++- clients/client-mq/README.md | 199 +++- clients/client-mturk/README.md | 199 +++- clients/client-neptune/README.md | 217 +++- clients/client-network-firewall/README.md | 278 ++++- clients/client-networkmanager/README.md | 201 +++- clients/client-opsworks/README.md | 314 +++++- clients/client-opsworkscm/README.md | 287 +++++- clients/client-organizations/README.md | 199 +++- clients/client-outposts/README.md | 204 +++- clients/client-personalize-events/README.md | 200 +++- clients/client-personalize-runtime/README.md | 199 +++- clients/client-personalize/README.md | 200 +++- clients/client-pi/README.md | 212 +++- clients/client-pinpoint-email/README.md | 228 ++++- clients/client-pinpoint-sms-voice/README.md | 199 +++- clients/client-pinpoint/README.md | 199 +++- clients/client-polly/README.md | 204 +++- clients/client-pricing/README.md | 222 +++- clients/client-qldb-session/README.md | 219 +++- clients/client-qldb/README.md | 199 +++- clients/client-quicksight/README.md | 204 +++- clients/client-ram/README.md | 204 +++- clients/client-rds-data/README.md | 209 +++- clients/client-rds/README.md | 256 ++++- clients/client-redshift-data/README.md | 200 +++- clients/client-redshift/README.md | 221 +++- clients/client-rekognition/README.md | 199 +++- .../README.md | 962 +++++++++++++++++- clients/client-resource-groups/README.md | 234 ++++- clients/client-robomaker/README.md | 199 +++- clients/client-route-53-domains/README.md | 205 +++- clients/client-route-53/README.md | 199 +++- clients/client-route53resolver/README.md | 228 ++++- clients/client-s3-control/README.md | 202 +++- clients/client-s3/README.md | 199 +++- clients/client-s3outposts/README.md | 199 +++- .../client-sagemaker-a2i-runtime/README.md | 228 ++++- clients/client-sagemaker-edge/README.md | 199 +++- .../README.md | 231 ++++- clients/client-sagemaker-runtime/README.md | 199 +++- clients/client-sagemaker/README.md | 214 +++- clients/client-savingsplans/README.md | 202 +++- clients/client-schemas/README.md | 199 +++- clients/client-secrets-manager/README.md | 255 ++++- clients/client-securityhub/README.md | 253 ++++- .../README.md | 224 +++- .../README.md | 205 +++- clients/client-service-catalog/README.md | 206 +++- clients/client-service-quotas/README.md | 210 +++- clients/client-servicediscovery/README.md | 203 +++- clients/client-ses/README.md | 208 +++- clients/client-sesv2/README.md | 219 +++- clients/client-sfn/README.md | 215 +++- clients/client-shield/README.md | 203 +++- clients/client-signer/README.md | 215 +++- clients/client-sms/README.md | 216 +++- clients/client-snowball/README.md | 205 +++- clients/client-sns/README.md | 213 +++- clients/client-sqs/README.md | 267 ++++- clients/client-ssm/README.md | 213 +++- clients/client-sso-admin/README.md | 197 +++- clients/client-sso-oidc/README.md | 216 +++- clients/client-sso/README.md | 214 +++- clients/client-storage-gateway/README.md | 270 ++++- clients/client-sts/README.md | 204 +++- clients/client-support/README.md | 276 ++++- clients/client-swf/README.md | 214 +++- clients/client-synthetics/README.md | 215 +++- clients/client-textract/README.md | 201 +++- clients/client-timestream-query/README.md | 201 +++- clients/client-timestream-write/README.md | 199 +++- clients/client-transcribe-streaming/README.md | 355 +++---- clients/client-transcribe/README.md | 199 +++- clients/client-transfer/README.md | 207 +++- clients/client-translate/README.md | 200 +++- clients/client-waf-regional/README.md | 209 +++- clients/client-waf/README.md | 209 +++- clients/client-wafv2/README.md | 255 ++++- clients/client-workdocs/README.md | 231 ++++- clients/client-worklink/README.md | 205 +++- clients/client-workmail/README.md | 233 ++++- clients/client-workmailmessageflow/README.md | 203 +++- clients/client-workspaces/README.md | 202 +++- clients/client-xray/README.md | 200 +++- ...wsPackageFixturesGeneratorIntegration.java | 31 + .../aws/typescript/codegen/README.md.template | 195 +++- ...ckageFixturesGeneratorIntegrationTest.java | 10 + .../aws/typescript/codegen/NotSame.smithy | 13 + protocol_tests/aws-ec2/README.md | 199 +++- protocol_tests/aws-json/README.md | 197 +++- protocol_tests/aws-query/README.md | 199 +++- protocol_tests/aws-restjson/README.md | 199 +++- protocol_tests/aws-restxml/README.md | 199 +++- scripts/generate-clients/copy-to-clients.js | 1 + 257 files changed, 55831 insertions(+), 453 deletions(-) diff --git a/clients/client-accessanalyzer/README.md b/clients/client-accessanalyzer/README.md index 0e8f949f6fb1..3d42b98d1d0d 100644 --- a/clients/client-accessanalyzer/README.md +++ b/clients/client-accessanalyzer/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-accessanalyzer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-accessanalyzer) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-accessanalyzer.svg)](https://www.npmjs.com/package/@aws-sdk/client-accessanalyzer) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AccessAnalyzer Client for Node.js, Browser and React Native. + +

AWS IAM Access Analyzer helps identify potential resource-access risks by enabling you to identify +any policies that grant access to an external principal. It does this by using logic-based +reasoning to analyze resource-based policies in your AWS environment. An external principal +can be another AWS account, a root user, an IAM user or role, a federated user, an AWS +service, or an anonymous user. This guide describes the AWS IAM Access Analyzer operations that you can +call programmatically. For general information about Access Analyzer, see the AWS IAM Access Analyzer section of the IAM User Guide.

+

To start using Access Analyzer, you first need to create an analyzer.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-accessanalyzer +using your favorite package manager: + +- `npm install @aws-sdk/client-accessanalyzer` +- `yarn add @aws-sdk/client-accessanalyzer` +- `pnpm add @aws-sdk/client-accessanalyzer` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AccessAnalyzerClient` and +the commands you need, for example `CreateAnalyzerCommand`: + +```js +// ES5 example +const { AccessAnalyzerClient, CreateAnalyzerCommand } = require("@aws-sdk/client-accessanalyzer"); +``` + +```ts +// ES6+ example +import { AccessAnalyzerClient, CreateAnalyzerCommand } from "@aws-sdk/client-accessanalyzer"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AccessAnalyzerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAnalyzerCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-accessanalyzer"; +const client = new AWS.AccessAnalyzer({ region: "REGION" }); + +// async/await. +try { + const data = client.createAnalyzer(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAnalyzer(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAnalyzer(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-accessanalyzer` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-acm-pca/README.md b/clients/client-acm-pca/README.md index edf600f41d43..e437d7b8153c 100644 --- a/clients/client-acm-pca/README.md +++ b/clients/client-acm-pca/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-acm-pca/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-acm-pca) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-acm-pca.svg)](https://www.npmjs.com/package/@aws-sdk/client-acm-pca) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ACMPCA Client for Node.js, Browser and React Native. + + +

+
+

This is the ACM Private CA API Reference. It provides descriptions, +syntax, and usage examples for each of the actions and data types involved in creating +and managing private certificate authorities (CA) for your organization.

+

The documentation for each action shows the Query API request parameters and the XML +response. Alternatively, you can use one of the AWS SDKs to access an API that's +tailored to the programming language or platform that you're using. For more +information, see AWS +SDKs.

+ +

Each ACM Private CA API action has a quota that determines the number of times the action +can be called per second. For more information, see API Rate Quotas in ACM Private CA +in the ACM Private CA user guide.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-acm-pca +using your favorite package manager: + +- `npm install @aws-sdk/client-acm-pca` +- `yarn add @aws-sdk/client-acm-pca` +- `pnpm add @aws-sdk/client-acm-pca` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ACMPCAClient` and +the commands you need, for example `CreateCertificateAuthorityCommand`: + +```js +// ES5 example +const { ACMPCAClient, CreateCertificateAuthorityCommand } = require("@aws-sdk/client-acm-pca"); +``` + +```ts +// ES6+ example +import { ACMPCAClient, CreateCertificateAuthorityCommand } from "@aws-sdk/client-acm-pca"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ACMPCAClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateCertificateAuthorityCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-acm-pca"; +const client = new AWS.ACMPCA({ region: "REGION" }); + +// async/await. +try { + const data = client.createCertificateAuthority(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createCertificateAuthority(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createCertificateAuthority(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-acm-pca` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-acm/README.md b/clients/client-acm/README.md index aeb2db7a902f..695767e11d0d 100644 --- a/clients/client-acm/README.md +++ b/clients/client-acm/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-acm/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-acm) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-acm.svg)](https://www.npmjs.com/package/@aws-sdk/client-acm) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ACM Client for Node.js, Browser and React Native. + +AWS Certificate Manager + +

Welcome to the AWS Certificate Manager (ACM) API documentation.

+

You can use ACM to manage SSL/TLS certificates for your AWS-based websites and +applications. For general information about using ACM, see the +AWS Certificate Manager User Guide +.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-acm +using your favorite package manager: + +- `npm install @aws-sdk/client-acm` +- `yarn add @aws-sdk/client-acm` +- `pnpm add @aws-sdk/client-acm` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ACMClient` and +the commands you need, for example `AddTagsToCertificateCommand`: + +```js +// ES5 example +const { ACMClient, AddTagsToCertificateCommand } = require("@aws-sdk/client-acm"); +``` + +```ts +// ES6+ example +import { ACMClient, AddTagsToCertificateCommand } from "@aws-sdk/client-acm"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ACMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToCertificateCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-acm"; +const client = new AWS.ACM({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToCertificate(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToCertificate(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToCertificate(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-acm` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-alexa-for-business/README.md b/clients/client-alexa-for-business/README.md index d6f45e8b675a..3b2a4957761f 100644 --- a/clients/client-alexa-for-business/README.md +++ b/clients/client-alexa-for-business/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-alexa-for-business/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-alexa-for-business) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-alexa-for-business.svg)](https://www.npmjs.com/package/@aws-sdk/client-alexa-for-business) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AlexaForBusiness Client for Node.js, Browser and React Native. + +

Alexa for Business helps you use Alexa in your organization. Alexa for Business provides you with the tools +to manage Alexa devices, enroll your users, and assign skills, at scale. You can build your +own context-aware voice skills using the Alexa Skills Kit and the Alexa for Business API operations. +You can also make these available as private skills for your organization. Alexa for Business makes it +efficient to voice-enable your products and services, thus providing context-aware voice +experiences for your customers. Device makers building with the Alexa Voice Service (AVS) +can create fully integrated solutions, register their products with Alexa for Business, and manage them +as shared devices in their organization.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-alexa-for-business +using your favorite package manager: + +- `npm install @aws-sdk/client-alexa-for-business` +- `yarn add @aws-sdk/client-alexa-for-business` +- `pnpm add @aws-sdk/client-alexa-for-business` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AlexaForBusinessClient` and +the commands you need, for example `ApproveSkillCommand`: + +```js +// ES5 example +const { AlexaForBusinessClient, ApproveSkillCommand } = require("@aws-sdk/client-alexa-for-business"); +``` + +```ts +// ES6+ example +import { AlexaForBusinessClient, ApproveSkillCommand } from "@aws-sdk/client-alexa-for-business"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AlexaForBusinessClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ApproveSkillCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-alexa-for-business"; +const client = new AWS.AlexaForBusiness({ region: "REGION" }); + +// async/await. +try { + const data = client.approveSkill(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .approveSkill(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.approveSkill(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-alexa-for-business` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-amplify/README.md b/clients/client-amplify/README.md index f4426b63ad7f..c1fb0a3d0489 100644 --- a/clients/client-amplify/README.md +++ b/clients/client-amplify/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-amplify/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-amplify) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-amplify.svg)](https://www.npmjs.com/package/@aws-sdk/client-amplify) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Amplify Client for Node.js, Browser and React Native. + +

Amplify enables developers to develop and deploy cloud-powered mobile and web apps. +The Amplify Console provides a continuous delivery and hosting service for web +applications. For more information, see the Amplify Console User Guide. The +Amplify Framework is a comprehensive set of SDKs, libraries, tools, and documentation +for client app development. For more information, see the Amplify Framework. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-amplify +using your favorite package manager: + +- `npm install @aws-sdk/client-amplify` +- `yarn add @aws-sdk/client-amplify` +- `pnpm add @aws-sdk/client-amplify` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AmplifyClient` and +the commands you need, for example `CreateAppCommand`: + +```js +// ES5 example +const { AmplifyClient, CreateAppCommand } = require("@aws-sdk/client-amplify"); +``` + +```ts +// ES6+ example +import { AmplifyClient, CreateAppCommand } from "@aws-sdk/client-amplify"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AmplifyClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAppCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-amplify"; +const client = new AWS.Amplify({ region: "REGION" }); + +// async/await. +try { + const data = client.createApp(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApp(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApp(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-amplify` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-amplifybackend/README.md b/clients/client-amplifybackend/README.md index 4e7f23160b2c..12cf40507926 100644 --- a/clients/client-amplifybackend/README.md +++ b/clients/client-amplifybackend/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-amplifybackend/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-amplifybackend) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-amplifybackend.svg)](https://www.npmjs.com/package/@aws-sdk/client-amplifybackend) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AmplifyBackend Client for Node.js, Browser and React Native. + +

AWS Amplify Admin API

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-amplifybackend +using your favorite package manager: + +- `npm install @aws-sdk/client-amplifybackend` +- `yarn add @aws-sdk/client-amplifybackend` +- `pnpm add @aws-sdk/client-amplifybackend` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AmplifyBackendClient` and +the commands you need, for example `CloneBackendCommand`: + +```js +// ES5 example +const { AmplifyBackendClient, CloneBackendCommand } = require("@aws-sdk/client-amplifybackend"); +``` + +```ts +// ES6+ example +import { AmplifyBackendClient, CloneBackendCommand } from "@aws-sdk/client-amplifybackend"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AmplifyBackendClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CloneBackendCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-amplifybackend"; +const client = new AWS.AmplifyBackend({ region: "REGION" }); + +// async/await. +try { + const data = client.cloneBackend(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cloneBackend(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cloneBackend(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-amplifybackend` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-api-gateway/README.md b/clients/client-api-gateway/README.md index 8f860c1a4ed1..111c4fda2e7d 100644 --- a/clients/client-api-gateway/README.md +++ b/clients/client-api-gateway/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-api-gateway/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-api-gateway) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-api-gateway.svg)](https://www.npmjs.com/package/@aws-sdk/client-api-gateway) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript APIGateway Client for Node.js, Browser and React Native. + +Amazon API Gateway + +

Amazon API Gateway helps developers deliver robust, secure, and scalable mobile and web application back ends. API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-api-gateway +using your favorite package manager: + +- `npm install @aws-sdk/client-api-gateway` +- `yarn add @aws-sdk/client-api-gateway` +- `pnpm add @aws-sdk/client-api-gateway` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `APIGatewayClient` and +the commands you need, for example `CreateApiKeyCommand`: + +```js +// ES5 example +const { APIGatewayClient, CreateApiKeyCommand } = require("@aws-sdk/client-api-gateway"); +``` + +```ts +// ES6+ example +import { APIGatewayClient, CreateApiKeyCommand } from "@aws-sdk/client-api-gateway"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new APIGatewayClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateApiKeyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-api-gateway"; +const client = new AWS.APIGateway({ region: "REGION" }); + +// async/await. +try { + const data = client.createApiKey(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApiKey(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApiKey(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-api-gateway` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-apigatewaymanagementapi/README.md b/clients/client-apigatewaymanagementapi/README.md index d9248b0cb5b2..6b013ac2bbca 100644 --- a/clients/client-apigatewaymanagementapi/README.md +++ b/clients/client-apigatewaymanagementapi/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-apigatewaymanagementapi/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-apigatewaymanagementapi) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-apigatewaymanagementapi.svg)](https://www.npmjs.com/package/@aws-sdk/client-apigatewaymanagementapi) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ApiGatewayManagementApi Client for Node.js, Browser and React Native. + +

The Amazon API Gateway Management API allows you to directly manage runtime aspects of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, or will be the endpoint corresponding to your API's custom domain and base path, if applicable.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-apigatewaymanagementapi +using your favorite package manager: + +- `npm install @aws-sdk/client-apigatewaymanagementapi` +- `yarn add @aws-sdk/client-apigatewaymanagementapi` +- `pnpm add @aws-sdk/client-apigatewaymanagementapi` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ApiGatewayManagementApiClient` and +the commands you need, for example `DeleteConnectionCommand`: + +```js +// ES5 example +const { ApiGatewayManagementApiClient, DeleteConnectionCommand } = require("@aws-sdk/client-apigatewaymanagementapi"); +``` + +```ts +// ES6+ example +import { ApiGatewayManagementApiClient, DeleteConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ApiGatewayManagementApiClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteConnectionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-apigatewaymanagementapi"; +const client = new AWS.ApiGatewayManagementApi({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteConnection(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteConnection(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteConnection(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-apigatewaymanagementapi` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-apigatewayv2/README.md b/clients/client-apigatewayv2/README.md index 79d269acb286..24e0d2ea6249 100644 --- a/clients/client-apigatewayv2/README.md +++ b/clients/client-apigatewayv2/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-apigatewayv2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-apigatewayv2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-apigatewayv2.svg)](https://www.npmjs.com/package/@aws-sdk/client-apigatewayv2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ApiGatewayV2 Client for Node.js, Browser and React Native. + +

Amazon API Gateway V2

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-apigatewayv2 +using your favorite package manager: + +- `npm install @aws-sdk/client-apigatewayv2` +- `yarn add @aws-sdk/client-apigatewayv2` +- `pnpm add @aws-sdk/client-apigatewayv2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ApiGatewayV2Client` and +the commands you need, for example `CreateApiCommand`: + +```js +// ES5 example +const { ApiGatewayV2Client, CreateApiCommand } = require("@aws-sdk/client-apigatewayv2"); +``` + +```ts +// ES6+ example +import { ApiGatewayV2Client, CreateApiCommand } from "@aws-sdk/client-apigatewayv2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ApiGatewayV2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateApiCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-apigatewayv2"; +const client = new AWS.ApiGatewayV2({ region: "REGION" }); + +// async/await. +try { + const data = client.createApi(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApi(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApi(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-apigatewayv2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-app-mesh/README.md b/clients/client-app-mesh/README.md index 9cb0cc72d2aa..0e081eeebbd9 100644 --- a/clients/client-app-mesh/README.md +++ b/clients/client-app-mesh/README.md @@ -3,4 +3,213 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-app-mesh/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-app-mesh) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-app-mesh.svg)](https://www.npmjs.com/package/@aws-sdk/client-app-mesh) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AppMesh Client for Node.js, Browser and React Native. + +

AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy to monitor and +control microservices. App Mesh standardizes how your microservices communicate, giving you +end-to-end visibility and helping to ensure high availability for your applications.

+

App Mesh gives you consistent visibility and network traffic controls for every +microservice in an application. You can use App Mesh with AWS Fargate, Amazon ECS, Amazon EKS, +Kubernetes on AWS, and Amazon EC2.

+ +

App Mesh supports microservice applications that use service discovery naming for their +components. For more information about service discovery on Amazon ECS, see Service Discovery in the Amazon Elastic Container Service Developer Guide. Kubernetes +kube-dns and coredns are supported. For more information, +see DNS +for Services and Pods in the Kubernetes documentation.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-app-mesh +using your favorite package manager: + +- `npm install @aws-sdk/client-app-mesh` +- `yarn add @aws-sdk/client-app-mesh` +- `pnpm add @aws-sdk/client-app-mesh` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AppMeshClient` and +the commands you need, for example `CreateGatewayRouteCommand`: + +```js +// ES5 example +const { AppMeshClient, CreateGatewayRouteCommand } = require("@aws-sdk/client-app-mesh"); +``` + +```ts +// ES6+ example +import { AppMeshClient, CreateGatewayRouteCommand } from "@aws-sdk/client-app-mesh"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AppMeshClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateGatewayRouteCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-app-mesh"; +const client = new AWS.AppMesh({ region: "REGION" }); + +// async/await. +try { + const data = client.createGatewayRoute(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createGatewayRoute(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createGatewayRoute(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-app-mesh` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-appconfig/README.md b/clients/client-appconfig/README.md index 6ca78024725e..5bcdfe797f00 100644 --- a/clients/client-appconfig/README.md +++ b/clients/client-appconfig/README.md @@ -3,4 +3,250 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-appconfig/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-appconfig) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-appconfig.svg)](https://www.npmjs.com/package/@aws-sdk/client-appconfig) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AppConfig Client for Node.js, Browser and React Native. + +AWS AppConfig + +

Use AWS AppConfig, a capability of AWS Systems Manager, to create, manage, and quickly deploy +application configurations. AppConfig supports controlled deployments to applications of any +size and includes built-in validation checks and monitoring. You can use AppConfig with +applications hosted on Amazon EC2 instances, AWS Lambda, containers, mobile applications, or IoT +devices.

+ +

To prevent errors when deploying application configurations, especially for production +systems where a simple typo could cause an unexpected outage, AppConfig includes validators. +A validator provides a syntactic or semantic check to ensure that the configuration you +want to deploy works as intended. To validate your application configuration data, you +provide a schema or a Lambda function that runs against the configuration. The +configuration deployment or update can only proceed when the configuration data is +valid.

+ +

During a configuration deployment, AppConfig monitors the application to ensure that the +deployment is successful. If the system encounters an error, AppConfig rolls back the change +to minimize impact for your application users. You can configure a deployment strategy for +each application or environment that includes deployment criteria, including velocity, bake +time, and alarms to monitor. Similar to error monitoring, if a deployment triggers an +alarm, AppConfig automatically rolls back to the previous version.

+ +

AppConfig supports multiple use cases. Here are some examples.

+ +

This reference is intended to be used with the AWS AppConfig User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-appconfig +using your favorite package manager: + +- `npm install @aws-sdk/client-appconfig` +- `yarn add @aws-sdk/client-appconfig` +- `pnpm add @aws-sdk/client-appconfig` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AppConfigClient` and +the commands you need, for example `CreateApplicationCommand`: + +```js +// ES5 example +const { AppConfigClient, CreateApplicationCommand } = require("@aws-sdk/client-appconfig"); +``` + +```ts +// ES6+ example +import { AppConfigClient, CreateApplicationCommand } from "@aws-sdk/client-appconfig"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AppConfigClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateApplicationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-appconfig"; +const client = new AWS.AppConfig({ region: "REGION" }); + +// async/await. +try { + const data = client.createApplication(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApplication(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApplication(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-appconfig` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-appflow/README.md b/clients/client-appflow/README.md index 2cb1f603becd..ff1cdba44261 100644 --- a/clients/client-appflow/README.md +++ b/clients/client-appflow/README.md @@ -3,4 +3,229 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-appflow/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-appflow) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-appflow.svg)](https://www.npmjs.com/package/@aws-sdk/client-appflow) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Appflow Client for Node.js, Browser and React Native. + +

Welcome to the Amazon AppFlow API reference. This guide is for developers who need detailed information about the Amazon AppFlow API operations, data types, and errors.

+ +

Amazon AppFlow is a fully managed integration service that enables you to securely transfer data between software as a service (SaaS) applications like Salesforce, Marketo, Slack, and ServiceNow, and AWS services like Amazon S3 and Amazon Redshift.

+ +

Use the following links to get started on the Amazon AppFlow API:

+ + + +

If you're new to Amazon AppFlow, we recommend that you review the Amazon AppFlow User Guide.

+

Amazon AppFlow API users can use vendor-specific mechanisms for OAuth, and include applicable OAuth attributes (such as auth-code and redirecturi) with the connector-specific ConnectorProfileProperties when creating a new connector profile using Amazon AppFlow API operations. For example, Salesforce users can refer to the +Authorize Apps with OAuth + documentation.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-appflow +using your favorite package manager: + +- `npm install @aws-sdk/client-appflow` +- `yarn add @aws-sdk/client-appflow` +- `pnpm add @aws-sdk/client-appflow` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AppflowClient` and +the commands you need, for example `CreateConnectorProfileCommand`: + +```js +// ES5 example +const { AppflowClient, CreateConnectorProfileCommand } = require("@aws-sdk/client-appflow"); +``` + +```ts +// ES6+ example +import { AppflowClient, CreateConnectorProfileCommand } from "@aws-sdk/client-appflow"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AppflowClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateConnectorProfileCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-appflow"; +const client = new AWS.Appflow({ region: "REGION" }); + +// async/await. +try { + const data = client.createConnectorProfile(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createConnectorProfile(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createConnectorProfile(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-appflow` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-appintegrations/README.md b/clients/client-appintegrations/README.md index 0c8573226d61..a7618e56ce57 100644 --- a/clients/client-appintegrations/README.md +++ b/clients/client-appintegrations/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-appintegrations/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-appintegrations) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-appintegrations.svg)](https://www.npmjs.com/package/@aws-sdk/client-appintegrations) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AppIntegrations Client for Node.js, Browser and React Native. + +

The Amazon AppIntegrations APIs are in preview release and are subject to change.

+ +

The Amazon AppIntegrations service enables you to configure and reuse connections to external applications.

+

For information about how you can use external applications with Amazon Connect, see Set up pre-built integrations in the Amazon Connect Administrator Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-appintegrations +using your favorite package manager: + +- `npm install @aws-sdk/client-appintegrations` +- `yarn add @aws-sdk/client-appintegrations` +- `pnpm add @aws-sdk/client-appintegrations` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AppIntegrationsClient` and +the commands you need, for example `CreateEventIntegrationCommand`: + +```js +// ES5 example +const { AppIntegrationsClient, CreateEventIntegrationCommand } = require("@aws-sdk/client-appintegrations"); +``` + +```ts +// ES6+ example +import { AppIntegrationsClient, CreateEventIntegrationCommand } from "@aws-sdk/client-appintegrations"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AppIntegrationsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateEventIntegrationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-appintegrations"; +const client = new AWS.AppIntegrations({ region: "REGION" }); + +// async/await. +try { + const data = client.createEventIntegration(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createEventIntegration(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createEventIntegration(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-appintegrations` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-application-auto-scaling/README.md b/clients/client-application-auto-scaling/README.md index bdb9545af5d5..0a871efb4c04 100644 --- a/clients/client-application-auto-scaling/README.md +++ b/clients/client-application-auto-scaling/README.md @@ -3,4 +3,270 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-application-auto-scaling/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-application-auto-scaling) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-application-auto-scaling.svg)](https://www.npmjs.com/package/@aws-sdk/client-application-auto-scaling) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ApplicationAutoScaling Client for Node.js, Browser and React Native. + +

With Application Auto Scaling, you can configure automatic scaling for the following +resources:

+ +

+API Summary +

+

The Application Auto Scaling service API includes three key sets of actions:

+ + +

To learn more about Application Auto Scaling, including information about granting IAM users required +permissions for Application Auto Scaling actions, see the Application Auto Scaling User +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-application-auto-scaling +using your favorite package manager: + +- `npm install @aws-sdk/client-application-auto-scaling` +- `yarn add @aws-sdk/client-application-auto-scaling` +- `pnpm add @aws-sdk/client-application-auto-scaling` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ApplicationAutoScalingClient` and +the commands you need, for example `DeleteScalingPolicyCommand`: + +```js +// ES5 example +const { + ApplicationAutoScalingClient, + DeleteScalingPolicyCommand, +} = require("@aws-sdk/client-application-auto-scaling"); +``` + +```ts +// ES6+ example +import { ApplicationAutoScalingClient, DeleteScalingPolicyCommand } from "@aws-sdk/client-application-auto-scaling"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ApplicationAutoScalingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteScalingPolicyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-application-auto-scaling"; +const client = new AWS.ApplicationAutoScaling({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteScalingPolicy(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteScalingPolicy(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteScalingPolicy(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-application-auto-scaling` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-application-discovery-service/README.md b/clients/client-application-discovery-service/README.md index 7f28160d99cd..eff4c9944411 100644 --- a/clients/client-application-discovery-service/README.md +++ b/clients/client-application-discovery-service/README.md @@ -3,4 +3,332 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-application-discovery-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-application-discovery-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-application-discovery-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-application-discovery-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ApplicationDiscoveryService Client for Node.js, Browser and React Native. + +AWS Application Discovery Service + +

AWS Application Discovery Service helps you plan application migration projects. It +automatically identifies servers, virtual machines (VMs), and network dependencies in your +on-premises data centers. For more information, see the AWS Application Discovery Service +FAQ. Application Discovery Service offers three ways of performing discovery and +collecting data about your on-premises servers:

+ + + + + + + +

+Recommendations +

+

We recommend that you use agent-based discovery for non-VMware environments, and +whenever you want to collect information about network dependencies. You can run agent-based +and agentless discovery simultaneously. Use agentless discovery to complete the initial +infrastructure assessment quickly, and then install agents on select hosts to collect +additional information.

+ +

+Working With This Guide +

+ +

This API reference provides descriptions, syntax, and usage examples for each of the +actions and data types for Application Discovery Service. The topic for each action shows the +API request parameters and the response. Alternatively, you can use one of the AWS SDKs to +access an API that is tailored to the programming language or platform that you're using. For +more information, see AWS +SDKs.

+ + + + + +

This guide is intended for use with the AWS Application +Discovery Service User Guide.

+ + +

All data is handled according to the AWS +Privacy Policy. You can operate Application Discovery Service offline to inspect +collected data before it is shared with the service.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-application-discovery-service +using your favorite package manager: + +- `npm install @aws-sdk/client-application-discovery-service` +- `yarn add @aws-sdk/client-application-discovery-service` +- `pnpm add @aws-sdk/client-application-discovery-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ApplicationDiscoveryServiceClient` and +the commands you need, for example `AssociateConfigurationItemsToApplicationCommand`: + +```js +// ES5 example +const { + ApplicationDiscoveryServiceClient, + AssociateConfigurationItemsToApplicationCommand, +} = require("@aws-sdk/client-application-discovery-service"); +``` + +```ts +// ES6+ example +import { + ApplicationDiscoveryServiceClient, + AssociateConfigurationItemsToApplicationCommand, +} from "@aws-sdk/client-application-discovery-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ApplicationDiscoveryServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateConfigurationItemsToApplicationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-application-discovery-service"; +const client = new AWS.ApplicationDiscoveryService({ region: "REGION" }); + +// async/await. +try { + const data = client.associateConfigurationItemsToApplication(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateConfigurationItemsToApplication(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateConfigurationItemsToApplication(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-application-discovery-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-application-insights/README.md b/clients/client-application-insights/README.md index c4298265c101..8880061083bf 100644 --- a/clients/client-application-insights/README.md +++ b/clients/client-application-insights/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-application-insights/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-application-insights) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-application-insights.svg)](https://www.npmjs.com/package/@aws-sdk/client-application-insights) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ApplicationInsights Client for Node.js, Browser and React Native. + +Amazon CloudWatch Application Insights + +

Amazon CloudWatch Application Insights is a service that +helps you detect common problems with your applications. It +enables you to pinpoint the source of issues in your applications (built with technologies +such as Microsoft IIS, .NET, and Microsoft SQL Server), by providing key insights into +detected problems.

+

After you onboard your application, CloudWatch Application Insights identifies, +recommends, and sets up metrics and logs. It continuously analyzes and +correlates your metrics and logs for unusual behavior to surface actionable problems with +your application. For example, if your application is slow and unresponsive and leading to +HTTP 500 errors in your Application Load Balancer (ALB), Application Insights informs you +that a memory pressure problem with your SQL Server database is occurring. It bases this +analysis on impactful metrics and log errors.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-application-insights +using your favorite package manager: + +- `npm install @aws-sdk/client-application-insights` +- `yarn add @aws-sdk/client-application-insights` +- `pnpm add @aws-sdk/client-application-insights` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ApplicationInsightsClient` and +the commands you need, for example `CreateApplicationCommand`: + +```js +// ES5 example +const { ApplicationInsightsClient, CreateApplicationCommand } = require("@aws-sdk/client-application-insights"); +``` + +```ts +// ES6+ example +import { ApplicationInsightsClient, CreateApplicationCommand } from "@aws-sdk/client-application-insights"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ApplicationInsightsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateApplicationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-application-insights"; +const client = new AWS.ApplicationInsights({ region: "REGION" }); + +// async/await. +try { + const data = client.createApplication(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApplication(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApplication(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-application-insights` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-appstream/README.md b/clients/client-appstream/README.md index 663c4234e229..fcdcc3d3d126 100644 --- a/clients/client-appstream/README.md +++ b/clients/client-appstream/README.md @@ -3,4 +3,222 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-appstream/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-appstream) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-appstream.svg)](https://www.npmjs.com/package/@aws-sdk/client-appstream) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AppStream Client for Node.js, Browser and React Native. + +Amazon AppStream 2.0 + +

This is the Amazon AppStream 2.0 API Reference. This documentation provides descriptions and syntax for each of the actions and data types in AppStream 2.0. AppStream 2.0 is a fully managed, secure application streaming service that lets you stream desktop applications to users without rewriting applications. AppStream 2.0 manages the AWS resources that are required to host and run your applications, scales automatically, and provides access to your users on demand.

+ + +

You can call the AppStream 2.0 API operations by using an interface VPC endpoint (interface endpoint). For more information, see Access AppStream 2.0 API Operations and CLI Commands Through an Interface VPC Endpoint in the Amazon AppStream 2.0 Administration Guide.

+
+ +

To learn more about AppStream 2.0, see the following resources:

+ + + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-appstream +using your favorite package manager: + +- `npm install @aws-sdk/client-appstream` +- `yarn add @aws-sdk/client-appstream` +- `pnpm add @aws-sdk/client-appstream` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AppStreamClient` and +the commands you need, for example `AssociateFleetCommand`: + +```js +// ES5 example +const { AppStreamClient, AssociateFleetCommand } = require("@aws-sdk/client-appstream"); +``` + +```ts +// ES6+ example +import { AppStreamClient, AssociateFleetCommand } from "@aws-sdk/client-appstream"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AppStreamClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateFleetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-appstream"; +const client = new AWS.AppStream({ region: "REGION" }); + +// async/await. +try { + const data = client.associateFleet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateFleet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateFleet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-appstream` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-appsync/README.md b/clients/client-appsync/README.md index 3470f6bc7bed..072507d1de37 100644 --- a/clients/client-appsync/README.md +++ b/clients/client-appsync/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-appsync/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-appsync) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-appsync.svg)](https://www.npmjs.com/package/@aws-sdk/client-appsync) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AppSync Client for Node.js, Browser and React Native. + +

AWS AppSync provides API actions for creating and interacting with data sources using +GraphQL from your application.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-appsync +using your favorite package manager: + +- `npm install @aws-sdk/client-appsync` +- `yarn add @aws-sdk/client-appsync` +- `pnpm add @aws-sdk/client-appsync` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AppSyncClient` and +the commands you need, for example `CreateApiCacheCommand`: + +```js +// ES5 example +const { AppSyncClient, CreateApiCacheCommand } = require("@aws-sdk/client-appsync"); +``` + +```ts +// ES6+ example +import { AppSyncClient, CreateApiCacheCommand } from "@aws-sdk/client-appsync"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AppSyncClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateApiCacheCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-appsync"; +const client = new AWS.AppSync({ region: "REGION" }); + +// async/await. +try { + const data = client.createApiCache(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApiCache(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApiCache(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-appsync` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-athena/README.md b/clients/client-athena/README.md index e93621587726..727492e709f0 100644 --- a/clients/client-athena/README.md +++ b/clients/client-athena/README.md @@ -3,4 +3,213 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-athena/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-athena) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-athena.svg)](https://www.npmjs.com/package/@aws-sdk/client-athena) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Athena Client for Node.js, Browser and React Native. + +

Amazon Athena is an interactive query service that lets you use standard SQL to +analyze data directly in Amazon S3. You can point Athena at your data in Amazon S3 and +run ad-hoc queries and get results in seconds. Athena is serverless, so there is no +infrastructure to set up or manage. You pay only for the queries you run. Athena scales +automatically—executing queries in parallel—so results are fast, even with large +datasets and complex queries. For more information, see What is Amazon +Athena in the Amazon Athena User Guide.

+

If you connect to Athena using the JDBC driver, use version 1.1.0 of the driver or +later with the Amazon Athena API. Earlier version drivers do not support the API. For +more information and to download the driver, see Accessing +Amazon Athena with JDBC.

+

For code samples using the AWS SDK for Java, see Examples and +Code Samples in the Amazon Athena User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-athena +using your favorite package manager: + +- `npm install @aws-sdk/client-athena` +- `yarn add @aws-sdk/client-athena` +- `pnpm add @aws-sdk/client-athena` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AthenaClient` and +the commands you need, for example `BatchGetNamedQueryCommand`: + +```js +// ES5 example +const { AthenaClient, BatchGetNamedQueryCommand } = require("@aws-sdk/client-athena"); +``` + +```ts +// ES6+ example +import { AthenaClient, BatchGetNamedQueryCommand } from "@aws-sdk/client-athena"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AthenaClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchGetNamedQueryCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-athena"; +const client = new AWS.Athena({ region: "REGION" }); + +// async/await. +try { + const data = client.batchGetNamedQuery(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchGetNamedQuery(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchGetNamedQuery(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-athena` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-auditmanager/README.md b/clients/client-auditmanager/README.md index 8e8d9d1009f1..64a1fe045899 100644 --- a/clients/client-auditmanager/README.md +++ b/clients/client-auditmanager/README.md @@ -3,4 +3,231 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-auditmanager/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-auditmanager) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-auditmanager.svg)](https://www.npmjs.com/package/@aws-sdk/client-auditmanager) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AuditManager Client for Node.js, Browser and React Native. + +

Welcome to the AWS Audit Manager API reference. This guide is for developers who need detailed information about the AWS Audit Manager API operations, data types, and errors.

+

AWS Audit Manager is a service that provides automated evidence collection so that you +can continuously audit your AWS usage, and assess the effectiveness of your controls to +better manage risk and simplify compliance.

+

AWS Audit Manager provides pre-built frameworks that structure and automate assessments +for a given compliance standard. Frameworks include a pre-built collection of controls with +descriptions and testing procedures, which are grouped according to the requirements of the +specified compliance standard or regulation. You can also customize frameworks and controls +to support internal audits with unique requirements.

+ +

Use the following links to get started with the AWS Audit Manager API:

+ + +

If you're new to AWS Audit Manager, we recommend that you review the AWS Audit Manager User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-auditmanager +using your favorite package manager: + +- `npm install @aws-sdk/client-auditmanager` +- `yarn add @aws-sdk/client-auditmanager` +- `pnpm add @aws-sdk/client-auditmanager` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AuditManagerClient` and +the commands you need, for example `AssociateAssessmentReportEvidenceFolderCommand`: + +```js +// ES5 example +const { AuditManagerClient, AssociateAssessmentReportEvidenceFolderCommand } = require("@aws-sdk/client-auditmanager"); +``` + +```ts +// ES6+ example +import { AuditManagerClient, AssociateAssessmentReportEvidenceFolderCommand } from "@aws-sdk/client-auditmanager"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AuditManagerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateAssessmentReportEvidenceFolderCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-auditmanager"; +const client = new AWS.AuditManager({ region: "REGION" }); + +// async/await. +try { + const data = client.associateAssessmentReportEvidenceFolder(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateAssessmentReportEvidenceFolder(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateAssessmentReportEvidenceFolder(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-auditmanager` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-auto-scaling-plans/README.md b/clients/client-auto-scaling-plans/README.md index 56f968abbac8..062f584f7a96 100644 --- a/clients/client-auto-scaling-plans/README.md +++ b/clients/client-auto-scaling-plans/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-auto-scaling-plans/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling-plans) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-auto-scaling-plans.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling-plans) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AutoScalingPlans Client for Node.js, Browser and React Native. + +AWS Auto Scaling + +

Use AWS Auto Scaling to quickly discover all the scalable AWS resources for your application and +configure dynamic scaling and predictive scaling for your resources using scaling plans. +Use this service in conjunction with the Amazon EC2 Auto Scaling, Application Auto Scaling, Amazon CloudWatch, and AWS +CloudFormation services.

+

Currently, predictive scaling is only available for Amazon EC2 Auto Scaling groups.

+

For more information about AWS Auto Scaling, including information about granting IAM users +required permissions for AWS Auto Scaling actions, see the AWS Auto Scaling User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-auto-scaling-plans +using your favorite package manager: + +- `npm install @aws-sdk/client-auto-scaling-plans` +- `yarn add @aws-sdk/client-auto-scaling-plans` +- `pnpm add @aws-sdk/client-auto-scaling-plans` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AutoScalingPlansClient` and +the commands you need, for example `CreateScalingPlanCommand`: + +```js +// ES5 example +const { AutoScalingPlansClient, CreateScalingPlanCommand } = require("@aws-sdk/client-auto-scaling-plans"); +``` + +```ts +// ES6+ example +import { AutoScalingPlansClient, CreateScalingPlanCommand } from "@aws-sdk/client-auto-scaling-plans"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AutoScalingPlansClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateScalingPlanCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-auto-scaling-plans"; +const client = new AWS.AutoScalingPlans({ region: "REGION" }); + +// async/await. +try { + const data = client.createScalingPlan(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createScalingPlan(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createScalingPlan(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-auto-scaling-plans` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-auto-scaling/README.md b/clients/client-auto-scaling/README.md index f7cf1202fd8a..65a2ae1ee1d4 100644 --- a/clients/client-auto-scaling/README.md +++ b/clients/client-auto-scaling/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-auto-scaling/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-auto-scaling.svg)](https://www.npmjs.com/package/@aws-sdk/client-auto-scaling) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript AutoScaling Client for Node.js, Browser and React Native. + +Amazon EC2 Auto Scaling + +

Amazon EC2 Auto Scaling is designed to automatically launch or terminate EC2 instances based on +user-defined scaling policies, scheduled actions, and health checks. Use this service +with AWS Auto Scaling, Amazon CloudWatch, and Elastic Load Balancing.

+

For more information, including information about granting IAM users required +permissions for Amazon EC2 Auto Scaling actions, see the Amazon EC2 Auto Scaling User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-auto-scaling +using your favorite package manager: + +- `npm install @aws-sdk/client-auto-scaling` +- `yarn add @aws-sdk/client-auto-scaling` +- `pnpm add @aws-sdk/client-auto-scaling` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `AutoScalingClient` and +the commands you need, for example `AttachInstancesCommand`: + +```js +// ES5 example +const { AutoScalingClient, AttachInstancesCommand } = require("@aws-sdk/client-auto-scaling"); +``` + +```ts +// ES6+ example +import { AutoScalingClient, AttachInstancesCommand } from "@aws-sdk/client-auto-scaling"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new AutoScalingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AttachInstancesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-auto-scaling"; +const client = new AWS.AutoScaling({ region: "REGION" }); + +// async/await. +try { + const data = client.attachInstances(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .attachInstances(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.attachInstances(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-auto-scaling` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-backup/README.md b/clients/client-backup/README.md index ccc729e08398..3e1be1b4e1ee 100644 --- a/clients/client-backup/README.md +++ b/clients/client-backup/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-backup/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-backup) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-backup.svg)](https://www.npmjs.com/package/@aws-sdk/client-backup) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Backup Client for Node.js, Browser and React Native. + +AWS Backup + +

AWS Backup is a unified backup service designed to protect AWS services and their +associated data. AWS Backup simplifies the creation, migration, restoration, and deletion +of backups, while also providing reporting and auditing.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-backup +using your favorite package manager: + +- `npm install @aws-sdk/client-backup` +- `yarn add @aws-sdk/client-backup` +- `pnpm add @aws-sdk/client-backup` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `BackupClient` and +the commands you need, for example `CreateBackupPlanCommand`: + +```js +// ES5 example +const { BackupClient, CreateBackupPlanCommand } = require("@aws-sdk/client-backup"); +``` + +```ts +// ES6+ example +import { BackupClient, CreateBackupPlanCommand } from "@aws-sdk/client-backup"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new BackupClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateBackupPlanCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-backup"; +const client = new AWS.Backup({ region: "REGION" }); + +// async/await. +try { + const data = client.createBackupPlan(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createBackupPlan(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createBackupPlan(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-backup` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-batch/README.md b/clients/client-batch/README.md index 79337f23535c..e8010fd2af85 100644 --- a/clients/client-batch/README.md +++ b/clients/client-batch/README.md @@ -3,4 +3,210 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-batch/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-batch) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-batch.svg)](https://www.npmjs.com/package/@aws-sdk/client-batch) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Batch Client for Node.js, Browser and React Native. + +

Using AWS Batch, you can run batch computing workloads on the AWS Cloud. Batch computing is a common means for +developers, scientists, and engineers to access large amounts of compute resources. AWS Batch utilizes the advantages +of this computing workload to remove the undifferentiated heavy lifting of configuring and managing required +infrastructure, while also adopting a familiar batch computing software approach. Given these advantages, AWS Batch can +help you to efficiently provision resources in response to jobs submitted, thus effectively helping to eliminate +capacity constraints, reduce compute costs, and deliver your results more quickly.

+

As a fully managed service, AWS Batch can run batch computing workloads of any scale. AWS Batch automatically +provisions compute resources and optimizes workload distribution based on the quantity and scale of your specific +workloads. With AWS Batch, there's no need to install or manage batch computing software. This means that you can focus +your time and energy on analyzing results and solving your specific problems.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-batch +using your favorite package manager: + +- `npm install @aws-sdk/client-batch` +- `yarn add @aws-sdk/client-batch` +- `pnpm add @aws-sdk/client-batch` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `BatchClient` and +the commands you need, for example `CancelJobCommand`: + +```js +// ES5 example +const { BatchClient, CancelJobCommand } = require("@aws-sdk/client-batch"); +``` + +```ts +// ES6+ example +import { BatchClient, CancelJobCommand } from "@aws-sdk/client-batch"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new BatchClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelJobCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-batch"; +const client = new AWS.Batch({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelJob(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelJob(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelJob(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-batch` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-braket/README.md b/clients/client-braket/README.md index 54018d8d8913..0d5887781eab 100644 --- a/clients/client-braket/README.md +++ b/clients/client-braket/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-braket/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-braket) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-braket.svg)](https://www.npmjs.com/package/@aws-sdk/client-braket) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Braket Client for Node.js, Browser and React Native. + +

The Amazon Braket API Reference provides information about the operations and structures supported in Amazon Braket.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-braket +using your favorite package manager: + +- `npm install @aws-sdk/client-braket` +- `yarn add @aws-sdk/client-braket` +- `pnpm add @aws-sdk/client-braket` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `BraketClient` and +the commands you need, for example `CancelQuantumTaskCommand`: + +```js +// ES5 example +const { BraketClient, CancelQuantumTaskCommand } = require("@aws-sdk/client-braket"); +``` + +```ts +// ES6+ example +import { BraketClient, CancelQuantumTaskCommand } from "@aws-sdk/client-braket"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new BraketClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelQuantumTaskCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-braket"; +const client = new AWS.Braket({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelQuantumTask(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelQuantumTask(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelQuantumTask(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-braket` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-budgets/README.md b/clients/client-budgets/README.md index e90ebf892781..66984d953987 100644 --- a/clients/client-budgets/README.md +++ b/clients/client-budgets/README.md @@ -3,4 +3,243 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-budgets/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-budgets) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-budgets.svg)](https://www.npmjs.com/package/@aws-sdk/client-budgets) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Budgets Client for Node.js, Browser and React Native. + +

The AWS Budgets API enables you to use AWS Budgets to plan your service usage, service costs, and instance reservations. The API reference provides descriptions, syntax, and usage examples for each of the actions and data types for AWS Budgets.

+

Budgets provide you with a way to see the following information:

+ +

AWS updates your budget status several times a day. Budgets track your unblended costs, subscriptions, refunds, and RIs. You can create the following types of budgets:

+ +

Service Endpoint

+

The AWS Budgets API provides the following endpoint:

+ +

For information about costs that are associated with the AWS Budgets API, see AWS Cost Management Pricing.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-budgets +using your favorite package manager: + +- `npm install @aws-sdk/client-budgets` +- `yarn add @aws-sdk/client-budgets` +- `pnpm add @aws-sdk/client-budgets` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `BudgetsClient` and +the commands you need, for example `CreateBudgetCommand`: + +```js +// ES5 example +const { BudgetsClient, CreateBudgetCommand } = require("@aws-sdk/client-budgets"); +``` + +```ts +// ES6+ example +import { BudgetsClient, CreateBudgetCommand } from "@aws-sdk/client-budgets"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new BudgetsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateBudgetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-budgets"; +const client = new AWS.Budgets({ region: "REGION" }); + +// async/await. +try { + const data = client.createBudget(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createBudget(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createBudget(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-budgets` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-chime/README.md b/clients/client-chime/README.md index a59315a53f1f..36a45fce9ee8 100644 --- a/clients/client-chime/README.md +++ b/clients/client-chime/README.md @@ -3,4 +3,238 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-chime/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-chime) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-chime.svg)](https://www.npmjs.com/package/@aws-sdk/client-chime) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Chime Client for Node.js, Browser and React Native. + +

The Amazon Chime API (application programming interface) is designed for developers to +perform key tasks, such as creating and managing Amazon Chime accounts, users, and Voice +Connectors. This guide provides detailed information about the Amazon Chime API, including +operations, types, inputs and outputs, and error codes. It also includes some server-side API +actions to use with the Amazon Chime SDK. For more information about the Amazon Chime SDK, see Using the Amazon Chime SDK in the +Amazon Chime Developer Guide.

+

You can use an AWS SDK, the AWS Command Line Interface (AWS CLI), or the REST API to +make API calls. We recommend using an AWS SDK or the AWS CLI. Each API operation includes +links to information about using it with a language-specific AWS SDK or the AWS CLI.

+
+
Using an AWS SDK
+
+

You don't need to write code to calculate a signature for request +authentication. The SDK clients authenticate your requests by using access keys that you +provide. For more information about AWS SDKs, see the AWS Developer Center.

+
+
Using the AWS CLI
+
+

Use your access keys with the AWS CLI to make API calls. For information about +setting up the AWS CLI, see Installing the AWS Command Line +Interface in the AWS Command Line Interface User Guide. +For a list of available Amazon Chime commands, see the Amazon Chime commands in the +AWS CLI Command Reference.

+ +
+
Using REST
+
+

If you use REST to make API calls, you must authenticate your request by providing +a signature. Amazon Chime supports Signature Version 4. For more information, see Signature +Version 4 Signing Process in the Amazon Web Services General +Reference.

+

When making REST API calls, use the service name chime and REST +endpoint https://service.chime.aws.amazon.com.

+
+
+ +

Administrative permissions are controlled using AWS Identity and Access Management (IAM). For more information, see Identity and Access Management for Amazon Chime in the +Amazon Chime Administration Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-chime +using your favorite package manager: + +- `npm install @aws-sdk/client-chime` +- `yarn add @aws-sdk/client-chime` +- `pnpm add @aws-sdk/client-chime` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ChimeClient` and +the commands you need, for example `AssociatePhoneNumbersWithVoiceConnectorCommand`: + +```js +// ES5 example +const { ChimeClient, AssociatePhoneNumbersWithVoiceConnectorCommand } = require("@aws-sdk/client-chime"); +``` + +```ts +// ES6+ example +import { ChimeClient, AssociatePhoneNumbersWithVoiceConnectorCommand } from "@aws-sdk/client-chime"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ChimeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociatePhoneNumbersWithVoiceConnectorCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-chime"; +const client = new AWS.Chime({ region: "REGION" }); + +// async/await. +try { + const data = client.associatePhoneNumbersWithVoiceConnector(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associatePhoneNumbersWithVoiceConnector(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associatePhoneNumbersWithVoiceConnector(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-chime` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloud9/README.md b/clients/client-cloud9/README.md index 133c6a0313ad..c2f051eaa734 100644 --- a/clients/client-cloud9/README.md +++ b/clients/client-cloud9/README.md @@ -3,4 +3,259 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloud9/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloud9) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloud9.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloud9) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Cloud9 Client for Node.js, Browser and React Native. + +AWS Cloud9 + +

AWS Cloud9 is a collection of tools that you can use to code, build, run, test, debug, and release software in the cloud.

+

For more information about AWS Cloud9, see the AWS Cloud9 User Guide.

+

AWS Cloud9 supports these operations:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloud9 +using your favorite package manager: + +- `npm install @aws-sdk/client-cloud9` +- `yarn add @aws-sdk/client-cloud9` +- `pnpm add @aws-sdk/client-cloud9` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `Cloud9Client` and +the commands you need, for example `CreateEnvironmentEC2Command`: + +```js +// ES5 example +const { Cloud9Client, CreateEnvironmentEC2Command } = require("@aws-sdk/client-cloud9"); +``` + +```ts +// ES6+ example +import { Cloud9Client, CreateEnvironmentEC2Command } from "@aws-sdk/client-cloud9"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new Cloud9Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateEnvironmentEC2Command(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloud9"; +const client = new AWS.Cloud9({ region: "REGION" }); + +// async/await. +try { + const data = client.createEnvironmentEC2(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createEnvironmentEC2(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createEnvironmentEC2(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloud9` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-clouddirectory/README.md b/clients/client-clouddirectory/README.md index c1f77078200e..6ac0ed00f53b 100644 --- a/clients/client-clouddirectory/README.md +++ b/clients/client-clouddirectory/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-clouddirectory/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-clouddirectory) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-clouddirectory.svg)](https://www.npmjs.com/package/@aws-sdk/client-clouddirectory) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudDirectory Client for Node.js, Browser and React Native. + +Amazon Cloud Directory + +

Amazon Cloud Directory is a component of the AWS Directory Service that simplifies the +development and management of cloud-scale web, mobile, and IoT applications. This guide +describes the Cloud Directory operations that you can call programmatically and includes +detailed information on data types and errors. For information about Cloud Directory features, see AWS Directory +Service and the Amazon Cloud Directory Developer Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-clouddirectory +using your favorite package manager: + +- `npm install @aws-sdk/client-clouddirectory` +- `yarn add @aws-sdk/client-clouddirectory` +- `pnpm add @aws-sdk/client-clouddirectory` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudDirectoryClient` and +the commands you need, for example `AddFacetToObjectCommand`: + +```js +// ES5 example +const { CloudDirectoryClient, AddFacetToObjectCommand } = require("@aws-sdk/client-clouddirectory"); +``` + +```ts +// ES6+ example +import { CloudDirectoryClient, AddFacetToObjectCommand } from "@aws-sdk/client-clouddirectory"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudDirectoryClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddFacetToObjectCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-clouddirectory"; +const client = new AWS.CloudDirectory({ region: "REGION" }); + +// async/await. +try { + const data = client.addFacetToObject(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addFacetToObject(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addFacetToObject(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-clouddirectory` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudformation/README.md b/clients/client-cloudformation/README.md index 970013028510..c4268b895949 100644 --- a/clients/client-cloudformation/README.md +++ b/clients/client-cloudformation/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudformation/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudformation) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudformation.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudformation) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudFormation Client for Node.js, Browser and React Native. + +AWS CloudFormation + +

AWS CloudFormation allows you to create and manage AWS infrastructure deployments +predictably and repeatedly. You can use AWS CloudFormation to leverage AWS products, such +as Amazon Elastic Compute Cloud, Amazon Elastic Block Store, Amazon Simple Notification +Service, Elastic Load Balancing, and Auto Scaling to build highly-reliable, highly +scalable, cost-effective applications without creating or configuring the underlying AWS +infrastructure.

+

With AWS CloudFormation, you declare all of your resources and dependencies in a +template file. The template defines a collection of resources as a single unit called a +stack. AWS CloudFormation creates and deletes all member resources of the stack together +and manages all dependencies between the resources for you.

+

For more information about AWS CloudFormation, see the AWS CloudFormation Product Page.

+

Amazon CloudFormation makes use of other AWS products. If you need additional +technical information about a specific AWS product, you can find the product's technical +documentation at docs.aws.amazon.com.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudformation +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudformation` +- `yarn add @aws-sdk/client-cloudformation` +- `pnpm add @aws-sdk/client-cloudformation` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudFormationClient` and +the commands you need, for example `CancelUpdateStackCommand`: + +```js +// ES5 example +const { CloudFormationClient, CancelUpdateStackCommand } = require("@aws-sdk/client-cloudformation"); +``` + +```ts +// ES6+ example +import { CloudFormationClient, CancelUpdateStackCommand } from "@aws-sdk/client-cloudformation"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudFormationClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelUpdateStackCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudformation"; +const client = new AWS.CloudFormation({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelUpdateStack(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelUpdateStack(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelUpdateStack(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudformation` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudfront/README.md b/clients/client-cloudfront/README.md index cc624b7d2158..585cda670801 100644 --- a/clients/client-cloudfront/README.md +++ b/clients/client-cloudfront/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudfront/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudfront) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudfront.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudfront) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudFront Client for Node.js, Browser and React Native. + +Amazon CloudFront + +

This is the Amazon CloudFront API Reference. This guide is for developers who need detailed information about +CloudFront API actions, data types, and errors. For detailed information about CloudFront features, see the Amazon CloudFront Developer Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudfront +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudfront` +- `yarn add @aws-sdk/client-cloudfront` +- `pnpm add @aws-sdk/client-cloudfront` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudFrontClient` and +the commands you need, for example `CreateCachePolicyCommand`: + +```js +// ES5 example +const { CloudFrontClient, CreateCachePolicyCommand } = require("@aws-sdk/client-cloudfront"); +``` + +```ts +// ES6+ example +import { CloudFrontClient, CreateCachePolicyCommand } from "@aws-sdk/client-cloudfront"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudFrontClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateCachePolicyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudfront"; +const client = new AWS.CloudFront({ region: "REGION" }); + +// async/await. +try { + const data = client.createCachePolicy(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createCachePolicy(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createCachePolicy(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudfront` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudhsm-v2/README.md b/clients/client-cloudhsm-v2/README.md index 65cd22f71441..35e9950ffa55 100644 --- a/clients/client-cloudhsm-v2/README.md +++ b/clients/client-cloudhsm-v2/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudhsm-v2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudhsm-v2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudhsm-v2.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudhsm-v2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudHSMV2 Client for Node.js, Browser and React Native. + +

For more information about AWS CloudHSM, see AWS CloudHSM and the AWS +CloudHSM User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudhsm-v2 +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudhsm-v2` +- `yarn add @aws-sdk/client-cloudhsm-v2` +- `pnpm add @aws-sdk/client-cloudhsm-v2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudHSMV2Client` and +the commands you need, for example `CopyBackupToRegionCommand`: + +```js +// ES5 example +const { CloudHSMV2Client, CopyBackupToRegionCommand } = require("@aws-sdk/client-cloudhsm-v2"); +``` + +```ts +// ES6+ example +import { CloudHSMV2Client, CopyBackupToRegionCommand } from "@aws-sdk/client-cloudhsm-v2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudHSMV2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CopyBackupToRegionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudhsm-v2"; +const client = new AWS.CloudHSMV2({ region: "REGION" }); + +// async/await. +try { + const data = client.copyBackupToRegion(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .copyBackupToRegion(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.copyBackupToRegion(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudhsm-v2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudhsm/README.md b/clients/client-cloudhsm/README.md index b0ed68915220..ddc2641929c9 100644 --- a/clients/client-cloudhsm/README.md +++ b/clients/client-cloudhsm/README.md @@ -3,4 +3,212 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudhsm/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudhsm) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudhsm.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudhsm) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudHSM Client for Node.js, Browser and React Native. + +AWS CloudHSM Service + +

This is documentation for AWS CloudHSM Classic. For +more information, see AWS CloudHSM +Classic FAQs, the AWS +CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.

+

+For information about the current version of AWS +CloudHSM, see AWS CloudHSM, the +AWS CloudHSM User Guide, +and the AWS CloudHSM API +Reference.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudhsm +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudhsm` +- `yarn add @aws-sdk/client-cloudhsm` +- `pnpm add @aws-sdk/client-cloudhsm` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudHSMClient` and +the commands you need, for example `AddTagsToResourceCommand`: + +```js +// ES5 example +const { CloudHSMClient, AddTagsToResourceCommand } = require("@aws-sdk/client-cloudhsm"); +``` + +```ts +// ES6+ example +import { CloudHSMClient, AddTagsToResourceCommand } from "@aws-sdk/client-cloudhsm"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudHSMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToResourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudhsm"; +const client = new AWS.CloudHSM({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToResource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudhsm` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudsearch-domain/README.md b/clients/client-cloudsearch-domain/README.md index 0b62945e9a02..334011dbbdb0 100644 --- a/clients/client-cloudsearch-domain/README.md +++ b/clients/client-cloudsearch-domain/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudsearch-domain/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudsearch-domain) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudsearch-domain.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudsearch-domain) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudSearchDomain Client for Node.js, Browser and React Native. + +

You use the AmazonCloudSearch2013 API to upload documents to a search domain and search those documents.

+ +

The endpoints for submitting UploadDocuments, Search, and Suggest requests are domain-specific and require the --endpoint-url option. To get the endpoints for your domain, use the Amazon CloudSearch configuration service DescribeDomains action. The endpoints are also available on the domain dashboard in the Amazon CloudSearch console. You submit suggest requests to the search endpoint.

+

For more information, see the Amazon CloudSearch Developer Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudsearch-domain +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudsearch-domain` +- `yarn add @aws-sdk/client-cloudsearch-domain` +- `pnpm add @aws-sdk/client-cloudsearch-domain` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudSearchDomainClient` and +the commands you need, for example `SearchCommand`: + +```js +// ES5 example +const { CloudSearchDomainClient, SearchCommand } = require("@aws-sdk/client-cloudsearch-domain"); +``` + +```ts +// ES6+ example +import { CloudSearchDomainClient, SearchCommand } from "@aws-sdk/client-cloudsearch-domain"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudSearchDomainClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new SearchCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudsearch-domain"; +const client = new AWS.CloudSearchDomain({ region: "REGION" }); + +// async/await. +try { + const data = client.search(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .search(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.search(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudsearch-domain` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudsearch/README.md b/clients/client-cloudsearch/README.md index b524cbd08d76..ee0226c0f840 100644 --- a/clients/client-cloudsearch/README.md +++ b/clients/client-cloudsearch/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudsearch/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudsearch) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudsearch.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudsearch) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudSearch Client for Node.js, Browser and React Native. + +Amazon CloudSearch Configuration Service + +

You use the Amazon CloudSearch configuration service to create, configure, and manage search domains. +Configuration service requests are submitted using the AWS Query protocol. AWS Query requests +are HTTP or HTTPS requests submitted via HTTP GET or POST with a query parameter named Action.

+

The endpoint for configuration service requests is region-specific: cloudsearch.region.amazonaws.com. +For example, cloudsearch.us-east-1.amazonaws.com. For a current list of supported regions and endpoints, +see Regions and Endpoints.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudsearch +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudsearch` +- `yarn add @aws-sdk/client-cloudsearch` +- `pnpm add @aws-sdk/client-cloudsearch` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudSearchClient` and +the commands you need, for example `BuildSuggestersCommand`: + +```js +// ES5 example +const { CloudSearchClient, BuildSuggestersCommand } = require("@aws-sdk/client-cloudsearch"); +``` + +```ts +// ES6+ example +import { CloudSearchClient, BuildSuggestersCommand } from "@aws-sdk/client-cloudsearch"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudSearchClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BuildSuggestersCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudsearch"; +const client = new AWS.CloudSearch({ region: "REGION" }); + +// async/await. +try { + const data = client.buildSuggesters(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .buildSuggesters(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.buildSuggesters(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudsearch` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudtrail/README.md b/clients/client-cloudtrail/README.md index 6b1ba27a1f4c..50042241a17a 100644 --- a/clients/client-cloudtrail/README.md +++ b/clients/client-cloudtrail/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudtrail/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudtrail) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudtrail.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudtrail) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudTrail Client for Node.js, Browser and React Native. + +AWS CloudTrail + +

This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.

+

CloudTrail is a web service that records AWS API calls for your AWS account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the AWS API call, the source IP address, the request parameters, and the response elements returned by the service.

+ + +

As an alternative to the API, +you can use one of the AWS SDKs, which consist of libraries and sample code for various +programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs +provide a convenient way to create programmatic access to AWSCloudTrail. For example, the SDKs +take care of cryptographically signing requests, managing errors, and retrying requests +automatically. For information about the AWS SDKs, including how to download and install +them, see the Tools for Amazon Web Services +page.

+
+

See the AWS CloudTrail User Guide for information about the data that is included with each AWS API call listed in the log files.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudtrail +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudtrail` +- `yarn add @aws-sdk/client-cloudtrail` +- `pnpm add @aws-sdk/client-cloudtrail` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudTrailClient` and +the commands you need, for example `AddTagsCommand`: + +```js +// ES5 example +const { CloudTrailClient, AddTagsCommand } = require("@aws-sdk/client-cloudtrail"); +``` + +```ts +// ES6+ example +import { CloudTrailClient, AddTagsCommand } from "@aws-sdk/client-cloudtrail"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudTrailClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudtrail"; +const client = new AWS.CloudTrail({ region: "REGION" }); + +// async/await. +try { + const data = client.addTags(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTags(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTags(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudtrail` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudwatch-events/README.md b/clients/client-cloudwatch-events/README.md index 619ad846709c..5a4ecc3fc01a 100644 --- a/clients/client-cloudwatch-events/README.md +++ b/clients/client-cloudwatch-events/README.md @@ -3,4 +3,222 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudwatch-events/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudwatch-events) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudwatch-events.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudwatch-events) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudWatchEvents Client for Node.js, Browser and React Native. + +

Amazon EventBridge helps you to respond to state changes in your AWS resources. +When your resources change state, they automatically send events into an event stream. +You can create rules that match selected events in the stream and route them to targets +to take action. You can also use rules to take action on a predetermined schedule. For +example, you can configure rules to:

+ +

For more information about the features of Amazon EventBridge, see the Amazon EventBridge User +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudwatch-events +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudwatch-events` +- `yarn add @aws-sdk/client-cloudwatch-events` +- `pnpm add @aws-sdk/client-cloudwatch-events` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudWatchEventsClient` and +the commands you need, for example `ActivateEventSourceCommand`: + +```js +// ES5 example +const { CloudWatchEventsClient, ActivateEventSourceCommand } = require("@aws-sdk/client-cloudwatch-events"); +``` + +```ts +// ES6+ example +import { CloudWatchEventsClient, ActivateEventSourceCommand } from "@aws-sdk/client-cloudwatch-events"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudWatchEventsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ActivateEventSourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudwatch-events"; +const client = new AWS.CloudWatchEvents({ region: "REGION" }); + +// async/await. +try { + const data = client.activateEventSource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .activateEventSource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.activateEventSource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudwatch-events` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudwatch-logs/README.md b/clients/client-cloudwatch-logs/README.md index 46b4c2aa01c0..2243c9b5b62e 100644 --- a/clients/client-cloudwatch-logs/README.md +++ b/clients/client-cloudwatch-logs/README.md @@ -3,4 +3,234 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudwatch-logs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudwatch-logs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudwatch-logs.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudwatch-logs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudWatchLogs Client for Node.js, Browser and React Native. + +

You can use Amazon CloudWatch Logs to monitor, store, and access your log files from +EC2 instances, AWS CloudTrail, or other sources. You can then retrieve the associated +log data from CloudWatch Logs using the CloudWatch console, CloudWatch Logs commands in the +AWS CLI, CloudWatch Logs API, or CloudWatch Logs SDK.

+

You can use CloudWatch Logs to:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudwatch-logs +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudwatch-logs` +- `yarn add @aws-sdk/client-cloudwatch-logs` +- `pnpm add @aws-sdk/client-cloudwatch-logs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudWatchLogsClient` and +the commands you need, for example `AssociateKmsKeyCommand`: + +```js +// ES5 example +const { CloudWatchLogsClient, AssociateKmsKeyCommand } = require("@aws-sdk/client-cloudwatch-logs"); +``` + +```ts +// ES6+ example +import { CloudWatchLogsClient, AssociateKmsKeyCommand } from "@aws-sdk/client-cloudwatch-logs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudWatchLogsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateKmsKeyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudwatch-logs"; +const client = new AWS.CloudWatchLogs({ region: "REGION" }); + +// async/await. +try { + const data = client.associateKmsKey(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateKmsKey(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateKmsKey(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudwatch-logs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cloudwatch/README.md b/clients/client-cloudwatch/README.md index e6073e122c83..147b66006cfb 100644 --- a/clients/client-cloudwatch/README.md +++ b/clients/client-cloudwatch/README.md @@ -3,4 +3,215 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cloudwatch/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudwatch) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cloudwatch.svg)](https://www.npmjs.com/package/@aws-sdk/client-cloudwatch) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CloudWatch Client for Node.js, Browser and React Native. + +

Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the +applications you run on AWS in real time. You can use CloudWatch to collect and track +metrics, which are the variables you want to measure for your resources and +applications.

+ +

CloudWatch alarms send notifications or automatically change the resources you are monitoring based on rules +that you define. For example, you can monitor the CPU usage and disk reads and writes of your Amazon EC2 +instances. Then, use this data to determine whether you should launch +additional instances to handle increased load. You can also use this data to stop +under-used instances to save +money.

+ +

In addition to monitoring the built-in metrics that come with AWS, you can monitor +your own custom metrics. With CloudWatch, you gain system-wide visibility into resource +utilization, application performance, and operational health.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cloudwatch +using your favorite package manager: + +- `npm install @aws-sdk/client-cloudwatch` +- `yarn add @aws-sdk/client-cloudwatch` +- `pnpm add @aws-sdk/client-cloudwatch` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CloudWatchClient` and +the commands you need, for example `DeleteAlarmsCommand`: + +```js +// ES5 example +const { CloudWatchClient, DeleteAlarmsCommand } = require("@aws-sdk/client-cloudwatch"); +``` + +```ts +// ES6+ example +import { CloudWatchClient, DeleteAlarmsCommand } from "@aws-sdk/client-cloudwatch"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CloudWatchClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteAlarmsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cloudwatch"; +const client = new AWS.CloudWatch({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteAlarms(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteAlarms(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteAlarms(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cloudwatch` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codeartifact/README.md b/clients/client-codeartifact/README.md index 98363cb26eb8..c1b96e370205 100644 --- a/clients/client-codeartifact/README.md +++ b/clients/client-codeartifact/README.md @@ -3,4 +3,476 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codeartifact/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codeartifact) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codeartifact.svg)](https://www.npmjs.com/package/@aws-sdk/client-codeartifact) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Codeartifact Client for Node.js, Browser and React Native. + +

AWS CodeArtifact is a fully managed artifact repository compatible with language-native +package managers and build tools such as npm, Apache Maven, NuGet, and pip. You can use CodeArtifact to +share packages with development teams and pull packages. Packages can be pulled from both +public and CodeArtifact repositories. You can also create an upstream relationship between a CodeArtifact +repository and another repository, which effectively merges their contents from the point of +view of a package manager client.

+ +

+AWS CodeArtifact Components +

+

Use the information in this guide to help you work with the following CodeArtifact components:

+ + + +

CodeArtifact supports these operations:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codeartifact +using your favorite package manager: + +- `npm install @aws-sdk/client-codeartifact` +- `yarn add @aws-sdk/client-codeartifact` +- `pnpm add @aws-sdk/client-codeartifact` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeartifactClient` and +the commands you need, for example `AssociateExternalConnectionCommand`: + +```js +// ES5 example +const { CodeartifactClient, AssociateExternalConnectionCommand } = require("@aws-sdk/client-codeartifact"); +``` + +```ts +// ES6+ example +import { CodeartifactClient, AssociateExternalConnectionCommand } from "@aws-sdk/client-codeartifact"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeartifactClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateExternalConnectionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codeartifact"; +const client = new AWS.Codeartifact({ region: "REGION" }); + +// async/await. +try { + const data = client.associateExternalConnection(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateExternalConnection(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateExternalConnection(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codeartifact` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codebuild/README.md b/clients/client-codebuild/README.md index 9a89549a51d3..7b451de69048 100644 --- a/clients/client-codebuild/README.md +++ b/clients/client-codebuild/README.md @@ -3,4 +3,386 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codebuild/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codebuild) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codebuild.svg)](https://www.npmjs.com/package/@aws-sdk/client-codebuild) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeBuild Client for Node.js, Browser and React Native. + +AWS CodeBuild + +

AWS CodeBuild is a fully managed build service in the cloud. AWS CodeBuild compiles your source code, +runs unit tests, and produces artifacts that are ready to deploy. AWS CodeBuild eliminates the +need to provision, manage, and scale your own build servers. It provides prepackaged +build environments for the most popular programming languages and build tools, such as +Apache Maven, Gradle, and more. You can also fully customize build environments in AWS CodeBuild +to use your own build tools. AWS CodeBuild scales automatically to meet peak build requests. You +pay only for the build time you consume. For more information about AWS CodeBuild, see the +AWS CodeBuild User +Guide. +

+

AWS CodeBuild supports these operations:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codebuild +using your favorite package manager: + +- `npm install @aws-sdk/client-codebuild` +- `yarn add @aws-sdk/client-codebuild` +- `pnpm add @aws-sdk/client-codebuild` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeBuildClient` and +the commands you need, for example `BatchDeleteBuildsCommand`: + +```js +// ES5 example +const { CodeBuildClient, BatchDeleteBuildsCommand } = require("@aws-sdk/client-codebuild"); +``` + +```ts +// ES6+ example +import { CodeBuildClient, BatchDeleteBuildsCommand } from "@aws-sdk/client-codebuild"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeBuildClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchDeleteBuildsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codebuild"; +const client = new AWS.CodeBuild({ region: "REGION" }); + +// async/await. +try { + const data = client.batchDeleteBuilds(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchDeleteBuilds(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchDeleteBuilds(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codebuild` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codecommit/README.md b/clients/client-codecommit/README.md index 59fed7e73edd..62ff99ec7558 100644 --- a/clients/client-codecommit/README.md +++ b/clients/client-codecommit/README.md @@ -3,4 +3,592 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codecommit/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codecommit) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codecommit.svg)](https://www.npmjs.com/package/@aws-sdk/client-codecommit) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeCommit Client for Node.js, Browser and React Native. + +AWS CodeCommit + +

This is the AWS CodeCommit API Reference. This reference provides descriptions of the operations and data types for +AWS CodeCommit API along with usage examples.

+

You can use the AWS CodeCommit API to work with the following objects:

+ +

Repositories, by calling the following:

+ + +

Branches, by calling the following:

+ + +

Files, by calling the following:

+ + +

Commits, by calling the following:

+ + +

Merges, by calling the following:

+ + +

Pull requests, by calling the following:

+ + +

Approval rule templates, by calling the following:

+ + +

Comments in a repository, by calling the following:

+ + +

Tags used to tag resources in AWS CodeCommit (not Git tags), by calling the following:

+ + +

Triggers, by calling the following:

+ + +

For information about how to use AWS CodeCommit, see the AWS CodeCommit User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codecommit +using your favorite package manager: + +- `npm install @aws-sdk/client-codecommit` +- `yarn add @aws-sdk/client-codecommit` +- `pnpm add @aws-sdk/client-codecommit` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeCommitClient` and +the commands you need, for example `AssociateApprovalRuleTemplateWithRepositoryCommand`: + +```js +// ES5 example +const { CodeCommitClient, AssociateApprovalRuleTemplateWithRepositoryCommand } = require("@aws-sdk/client-codecommit"); +``` + +```ts +// ES6+ example +import { CodeCommitClient, AssociateApprovalRuleTemplateWithRepositoryCommand } from "@aws-sdk/client-codecommit"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeCommitClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateApprovalRuleTemplateWithRepositoryCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codecommit"; +const client = new AWS.CodeCommit({ region: "REGION" }); + +// async/await. +try { + const data = client.associateApprovalRuleTemplateWithRepository(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateApprovalRuleTemplateWithRepository(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateApprovalRuleTemplateWithRepository(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codecommit` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codedeploy/README.md b/clients/client-codedeploy/README.md index aafc03dc8373..494e9af6b0f2 100644 --- a/clients/client-codedeploy/README.md +++ b/clients/client-codedeploy/README.md @@ -3,4 +3,301 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codedeploy/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codedeploy) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codedeploy.svg)](https://www.npmjs.com/package/@aws-sdk/client-codedeploy) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeDeploy Client for Node.js, Browser and React Native. + +AWS CodeDeploy + +

AWS CodeDeploy is a deployment service that automates application deployments to +Amazon EC2 instances, on-premises instances running in your own facility, serverless +AWS Lambda functions, or applications in an Amazon ECS service.

+

You can deploy a nearly unlimited variety of application content, such as an updated +Lambda function, updated applications in an Amazon ECS service, code, web and configuration +files, executables, packages, scripts, +multimedia files, and so on. AWS CodeDeploy can deploy application content stored in +Amazon S3 buckets, GitHub repositories, or Bitbucket repositories. You do not need to +make changes to your existing code before you can use AWS CodeDeploy.

+

AWS CodeDeploy makes it easier for you to rapidly release new features, helps you +avoid downtime during application deployment, and handles the complexity of updating +your applications, without many of the risks associated with error-prone manual +deployments.

+

+AWS CodeDeploy Components +

+

Use the information in this guide to help you work with the following AWS CodeDeploy +components:

+ +

This guide also contains information to help you get details about the instances in +your deployments, to make on-premises instances available for AWS CodeDeploy +deployments, to get details about a Lambda function deployment, and to get details about +Amazon ECS service deployments.

+

+AWS CodeDeploy Information Resources +

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codedeploy +using your favorite package manager: + +- `npm install @aws-sdk/client-codedeploy` +- `yarn add @aws-sdk/client-codedeploy` +- `pnpm add @aws-sdk/client-codedeploy` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeDeployClient` and +the commands you need, for example `AddTagsToOnPremisesInstancesCommand`: + +```js +// ES5 example +const { CodeDeployClient, AddTagsToOnPremisesInstancesCommand } = require("@aws-sdk/client-codedeploy"); +``` + +```ts +// ES6+ example +import { CodeDeployClient, AddTagsToOnPremisesInstancesCommand } from "@aws-sdk/client-codedeploy"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeDeployClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToOnPremisesInstancesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codedeploy"; +const client = new AWS.CodeDeploy({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToOnPremisesInstances(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToOnPremisesInstances(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToOnPremisesInstances(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codedeploy` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codeguru-reviewer/README.md b/clients/client-codeguru-reviewer/README.md index 2574093f82f3..6f7a474d691f 100644 --- a/clients/client-codeguru-reviewer/README.md +++ b/clients/client-codeguru-reviewer/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codeguru-reviewer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codeguru-reviewer) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codeguru-reviewer.svg)](https://www.npmjs.com/package/@aws-sdk/client-codeguru-reviewer) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeGuruReviewer Client for Node.js, Browser and React Native. + +

This section provides documentation for the Amazon CodeGuru Reviewer API operations. CodeGuru Reviewer is a service +that uses program analysis and machine learning to detect potential defects that are difficult for developers to find and recommends +fixes in your Java code.

+ +

By proactively detecting and providing recommendations for addressing code defects and implementing best practices, CodeGuru Reviewer +improves the overall quality and maintainability of your code base during the code review stage. For more information about CodeGuru Reviewer, see the + +Amazon CodeGuru Reviewer User Guide. +

+ +

+To improve the security of your CodeGuru Reviewer API calls, you can establish a private connection between your VPC and CodeGuru Reviewer by +creating an interface VPC endpoint. For more information, see +CodeGuru Reviewer and interface +VPC endpoints (AWS PrivateLink) in the Amazon CodeGuru Reviewer User Guide. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codeguru-reviewer +using your favorite package manager: + +- `npm install @aws-sdk/client-codeguru-reviewer` +- `yarn add @aws-sdk/client-codeguru-reviewer` +- `pnpm add @aws-sdk/client-codeguru-reviewer` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeGuruReviewerClient` and +the commands you need, for example `AssociateRepositoryCommand`: + +```js +// ES5 example +const { CodeGuruReviewerClient, AssociateRepositoryCommand } = require("@aws-sdk/client-codeguru-reviewer"); +``` + +```ts +// ES6+ example +import { CodeGuruReviewerClient, AssociateRepositoryCommand } from "@aws-sdk/client-codeguru-reviewer"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeGuruReviewerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateRepositoryCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codeguru-reviewer"; +const client = new AWS.CodeGuruReviewer({ region: "REGION" }); + +// async/await. +try { + const data = client.associateRepository(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateRepository(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateRepository(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codeguru-reviewer` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codeguruprofiler/README.md b/clients/client-codeguruprofiler/README.md index 368874dd1e31..1838dc59c405 100644 --- a/clients/client-codeguruprofiler/README.md +++ b/clients/client-codeguruprofiler/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codeguruprofiler/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codeguruprofiler) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codeguruprofiler.svg)](https://www.npmjs.com/package/@aws-sdk/client-codeguruprofiler) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeGuruProfiler Client for Node.js, Browser and React Native. + +

This section provides documentation for the Amazon CodeGuru Profiler API operations.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codeguruprofiler +using your favorite package manager: + +- `npm install @aws-sdk/client-codeguruprofiler` +- `yarn add @aws-sdk/client-codeguruprofiler` +- `pnpm add @aws-sdk/client-codeguruprofiler` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeGuruProfilerClient` and +the commands you need, for example `ConfigureAgentCommand`: + +```js +// ES5 example +const { CodeGuruProfilerClient, ConfigureAgentCommand } = require("@aws-sdk/client-codeguruprofiler"); +``` + +```ts +// ES6+ example +import { CodeGuruProfilerClient, ConfigureAgentCommand } from "@aws-sdk/client-codeguruprofiler"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeGuruProfilerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ConfigureAgentCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codeguruprofiler"; +const client = new AWS.CodeGuruProfiler({ region: "REGION" }); + +// async/await. +try { + const data = client.configureAgent(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .configureAgent(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.configureAgent(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codeguruprofiler` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codepipeline/README.md b/clients/client-codepipeline/README.md index 493307082b82..a29738f68aa0 100644 --- a/clients/client-codepipeline/README.md +++ b/clients/client-codepipeline/README.md @@ -3,4 +3,396 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codepipeline/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codepipeline) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codepipeline.svg)](https://www.npmjs.com/package/@aws-sdk/client-codepipeline) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodePipeline Client for Node.js, Browser and React Native. + +AWS CodePipeline + +

+Overview +

+

This is the AWS CodePipeline API Reference. This guide provides descriptions of the +actions and data types for AWS CodePipeline. Some functionality for your pipeline can +only be configured through the API. For more information, see the AWS +CodePipeline User Guide.

+

You can use the AWS CodePipeline API to work with pipelines, stages, actions, and +transitions.

+

+Pipelines are models of automated release processes. Each pipeline +is uniquely named, and consists of stages, actions, and transitions.

+

You can work with pipelines by calling:

+ +

Pipelines include stages. Each stage contains one or more +actions that must complete before the next stage begins. A stage results in success or +failure. If a stage fails, the pipeline stops at that stage and remains stopped until +either a new version of an artifact appears in the source location, or a user takes +action to rerun the most recent artifact through the pipeline. You can call GetPipelineState, which displays the status of a pipeline, including the +status of stages in the pipeline, or GetPipeline, which returns the +entire structure of the pipeline, including the stages of that pipeline. For more +information about the structure of stages and actions, see AWS CodePipeline +Pipeline Structure Reference.

+

Pipeline stages include actions that are categorized into +categories such as source or build actions performed in a stage of a pipeline. For +example, you can use a source action to import artifacts into a pipeline from a source +such as Amazon S3. Like stages, you do not work with actions directly in most cases, but +you do define and interact with actions when working with pipeline operations such as +CreatePipeline and GetPipelineState. Valid +action categories are:

+ +

Pipelines also include transitions, which allow the transition +of artifacts from one stage to the next in a pipeline after the actions in one stage +complete.

+

You can work with transitions by calling:

+ +

+Using the API to integrate with AWS CodePipeline +

+

For third-party integrators or developers who want to create their own integrations +with AWS CodePipeline, the expected sequence varies from the standard API user. To +integrate with AWS CodePipeline, developers need to work with the following +items:

+

+Jobs, which are instances of an action. For +example, a job for a source action might import a revision of an artifact from a source.

+

You can work with jobs by calling:

+ +

+Third party jobs, which are instances of an action +created by a partner action and integrated into AWS CodePipeline. Partner actions are +created by members of the AWS Partner Network.

+

You can work with third party jobs by calling:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codepipeline +using your favorite package manager: + +- `npm install @aws-sdk/client-codepipeline` +- `yarn add @aws-sdk/client-codepipeline` +- `pnpm add @aws-sdk/client-codepipeline` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodePipelineClient` and +the commands you need, for example `AcknowledgeJobCommand`: + +```js +// ES5 example +const { CodePipelineClient, AcknowledgeJobCommand } = require("@aws-sdk/client-codepipeline"); +``` + +```ts +// ES6+ example +import { CodePipelineClient, AcknowledgeJobCommand } from "@aws-sdk/client-codepipeline"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodePipelineClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcknowledgeJobCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codepipeline"; +const client = new AWS.CodePipeline({ region: "REGION" }); + +// async/await. +try { + const data = client.acknowledgeJob(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acknowledgeJob(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acknowledgeJob(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codepipeline` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codestar-connections/README.md b/clients/client-codestar-connections/README.md index edee8d3023ea..dd2ed5cda9c8 100644 --- a/clients/client-codestar-connections/README.md +++ b/clients/client-codestar-connections/README.md @@ -3,4 +3,281 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codestar-connections/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codestar-connections) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codestar-connections.svg)](https://www.npmjs.com/package/@aws-sdk/client-codestar-connections) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeStarConnections Client for Node.js, Browser and React Native. + +AWS CodeStar Connections + +

This AWS CodeStar Connections API Reference provides descriptions and usage examples of +the operations and data types for the AWS CodeStar Connections API. You can use the +connections API to work with connections and installations.

+

+Connections are configurations that you use to connect AWS +resources to external code repositories. Each connection is a resource that can be given to +services such as CodePipeline to connect to a third-party repository such as Bitbucket. For +example, you can add the connection in CodePipeline so that it triggers your pipeline when a +code change is made to your third-party code repository. Each connection is named and +associated with a unique ARN that is used to reference the connection.

+

When you create a connection, the console initiates a third-party connection handshake. +Installations are the apps that are used to conduct this handshake. For +example, the installation for the Bitbucket provider type is the Bitbucket app. When you +create a connection, you can choose an existing installation or create one.

+

When you want to create a connection to an installed provider type such as GitHub +Enterprise Server, you create a host for your connections.

+

You can work with connections by calling:

+ +

You can work with hosts by calling:

+ +

You can work with tags in AWS CodeStar Connections by calling the following:

+ +

For information about how to use AWS CodeStar Connections, see the Developer Tools User +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codestar-connections +using your favorite package manager: + +- `npm install @aws-sdk/client-codestar-connections` +- `yarn add @aws-sdk/client-codestar-connections` +- `pnpm add @aws-sdk/client-codestar-connections` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeStarConnectionsClient` and +the commands you need, for example `CreateConnectionCommand`: + +```js +// ES5 example +const { CodeStarConnectionsClient, CreateConnectionCommand } = require("@aws-sdk/client-codestar-connections"); +``` + +```ts +// ES6+ example +import { CodeStarConnectionsClient, CreateConnectionCommand } from "@aws-sdk/client-codestar-connections"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeStarConnectionsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateConnectionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codestar-connections"; +const client = new AWS.CodeStarConnections({ region: "REGION" }); + +// async/await. +try { + const data = client.createConnection(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createConnection(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createConnection(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codestar-connections` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codestar-notifications/README.md b/clients/client-codestar-notifications/README.md index 3e6eb4cf5e21..01b4acbbb753 100644 --- a/clients/client-codestar-notifications/README.md +++ b/clients/client-codestar-notifications/README.md @@ -3,4 +3,285 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codestar-notifications/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codestar-notifications) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codestar-notifications.svg)](https://www.npmjs.com/package/@aws-sdk/client-codestar-notifications) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodestarNotifications Client for Node.js, Browser and React Native. + +

This AWS CodeStar Notifications API Reference provides descriptions and usage examples of the +operations and data types for the AWS CodeStar Notifications API. You can use the AWS CodeStar Notifications API +to work with the following objects:

+ +

Notification rules, by calling the following:

+ + +

Targets, by calling the following:

+ + +

Events, by calling the following:

+ +

Tags, by calling the following:

+ + +

For information about how to use AWS CodeStar Notifications, see link in the CodeStarNotifications User Guide. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codestar-notifications +using your favorite package manager: + +- `npm install @aws-sdk/client-codestar-notifications` +- `yarn add @aws-sdk/client-codestar-notifications` +- `pnpm add @aws-sdk/client-codestar-notifications` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodestarNotificationsClient` and +the commands you need, for example `CreateNotificationRuleCommand`: + +```js +// ES5 example +const { + CodestarNotificationsClient, + CreateNotificationRuleCommand, +} = require("@aws-sdk/client-codestar-notifications"); +``` + +```ts +// ES6+ example +import { CodestarNotificationsClient, CreateNotificationRuleCommand } from "@aws-sdk/client-codestar-notifications"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodestarNotificationsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateNotificationRuleCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codestar-notifications"; +const client = new AWS.CodestarNotifications({ region: "REGION" }); + +// async/await. +try { + const data = client.createNotificationRule(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createNotificationRule(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createNotificationRule(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codestar-notifications` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-codestar/README.md b/clients/client-codestar/README.md index 09f663d73eec..9a12fbed949b 100644 --- a/clients/client-codestar/README.md +++ b/clients/client-codestar/README.md @@ -3,4 +3,291 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-codestar/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-codestar) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-codestar.svg)](https://www.npmjs.com/package/@aws-sdk/client-codestar) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CodeStar Client for Node.js, Browser and React Native. + +AWS CodeStar + +

This is the API reference for AWS CodeStar. This reference provides descriptions of the +operations and data types for the AWS CodeStar API along with usage examples.

+

You can use the AWS CodeStar API to work with:

+

Projects and their resources, by calling the following:

+ +

Teams and team members, by calling the following:

+ +

Users, by calling the following:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-codestar +using your favorite package manager: + +- `npm install @aws-sdk/client-codestar` +- `yarn add @aws-sdk/client-codestar` +- `pnpm add @aws-sdk/client-codestar` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CodeStarClient` and +the commands you need, for example `AssociateTeamMemberCommand`: + +```js +// ES5 example +const { CodeStarClient, AssociateTeamMemberCommand } = require("@aws-sdk/client-codestar"); +``` + +```ts +// ES6+ example +import { CodeStarClient, AssociateTeamMemberCommand } from "@aws-sdk/client-codestar"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CodeStarClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateTeamMemberCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-codestar"; +const client = new AWS.CodeStar({ region: "REGION" }); + +// async/await. +try { + const data = client.associateTeamMember(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateTeamMember(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateTeamMember(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-codestar` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cognito-identity-provider/README.md b/clients/client-cognito-identity-provider/README.md index 20e11c0a126b..4a42b7f43bc0 100644 --- a/clients/client-cognito-identity-provider/README.md +++ b/clients/client-cognito-identity-provider/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cognito-identity-provider/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-identity-provider) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cognito-identity-provider.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-identity-provider) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CognitoIdentityProvider Client for Node.js, Browser and React Native. + +

Using the Amazon Cognito User Pools API, you can create a user pool to manage +directories and users. You can authenticate a user to obtain tokens related to user +identity and access policies.

+

This API reference provides information about user pools in Amazon Cognito User +Pools.

+

For more information, see the Amazon Cognito Documentation.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cognito-identity-provider +using your favorite package manager: + +- `npm install @aws-sdk/client-cognito-identity-provider` +- `yarn add @aws-sdk/client-cognito-identity-provider` +- `pnpm add @aws-sdk/client-cognito-identity-provider` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CognitoIdentityProviderClient` and +the commands you need, for example `AddCustomAttributesCommand`: + +```js +// ES5 example +const { + CognitoIdentityProviderClient, + AddCustomAttributesCommand, +} = require("@aws-sdk/client-cognito-identity-provider"); +``` + +```ts +// ES6+ example +import { CognitoIdentityProviderClient, AddCustomAttributesCommand } from "@aws-sdk/client-cognito-identity-provider"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CognitoIdentityProviderClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddCustomAttributesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cognito-identity-provider"; +const client = new AWS.CognitoIdentityProvider({ region: "REGION" }); + +// async/await. +try { + const data = client.addCustomAttributes(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addCustomAttributes(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addCustomAttributes(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cognito-identity-provider` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cognito-identity/README.md b/clients/client-cognito-identity/README.md index dc1bdfc656cf..3732d2f9e4f0 100644 --- a/clients/client-cognito-identity/README.md +++ b/clients/client-cognito-identity/README.md @@ -3,4 +3,215 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cognito-identity/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-identity) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cognito-identity.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-identity) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CognitoIdentity Client for Node.js, Browser and React Native. + +Amazon Cognito Federated Identities + +

Amazon Cognito Federated Identities is a web service that delivers scoped temporary +credentials to mobile devices and other untrusted environments. It uniquely identifies a +device and supplies the user with a consistent identity over the lifetime of an +application.

+

Using Amazon Cognito Federated Identities, you can enable authentication with one or +more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon +Cognito user pool, and you can also choose to support unauthenticated access from your app. +Cognito delivers a unique identifier for each user and acts as an OpenID token provider +trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS +credentials.

+

For a description of the authentication flow from the Amazon Cognito Developer Guide +see Authentication Flow.

+

For more information see Amazon Cognito Federated Identities.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cognito-identity +using your favorite package manager: + +- `npm install @aws-sdk/client-cognito-identity` +- `yarn add @aws-sdk/client-cognito-identity` +- `pnpm add @aws-sdk/client-cognito-identity` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CognitoIdentityClient` and +the commands you need, for example `CreateIdentityPoolCommand`: + +```js +// ES5 example +const { CognitoIdentityClient, CreateIdentityPoolCommand } = require("@aws-sdk/client-cognito-identity"); +``` + +```ts +// ES6+ example +import { CognitoIdentityClient, CreateIdentityPoolCommand } from "@aws-sdk/client-cognito-identity"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CognitoIdentityClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateIdentityPoolCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cognito-identity"; +const client = new AWS.CognitoIdentity({ region: "REGION" }); + +// async/await. +try { + const data = client.createIdentityPool(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createIdentityPool(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createIdentityPool(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cognito-identity` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cognito-sync/README.md b/clients/client-cognito-sync/README.md index c64a730d63aa..266fe05538fe 100644 --- a/clients/client-cognito-sync/README.md +++ b/clients/client-cognito-sync/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cognito-sync/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-sync) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cognito-sync.svg)](https://www.npmjs.com/package/@aws-sdk/client-cognito-sync) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CognitoSync Client for Node.js, Browser and React Native. + +Amazon Cognito Sync + +

Amazon Cognito Sync provides an AWS service and client library that enable cross-device syncing of application-related user data. High-level client libraries are available for both iOS and Android. You can use these libraries to persist data locally so that it's available even if the device is offline. Developer credentials don't need to be stored on the mobile device to access the service. You can use Amazon Cognito to obtain a normalized user ID and credentials. User data is persisted in a dataset that can store up to 1 MB of key-value pairs, and you can have up to 20 datasets per user identity.

+

With Amazon Cognito Sync, the data stored for each identity is accessible only to +credentials assigned to that identity. In order to use the Cognito Sync service, you need +to make API calls using credentials retrieved with Amazon Cognito Identity service.

+

If you want to use Cognito Sync in an Android or iOS application, you will probably want to +make API calls via the AWS Mobile SDK. To learn more, see the Developer Guide for Android and the Developer Guide for iOS.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cognito-sync +using your favorite package manager: + +- `npm install @aws-sdk/client-cognito-sync` +- `yarn add @aws-sdk/client-cognito-sync` +- `pnpm add @aws-sdk/client-cognito-sync` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CognitoSyncClient` and +the commands you need, for example `BulkPublishCommand`: + +```js +// ES5 example +const { CognitoSyncClient, BulkPublishCommand } = require("@aws-sdk/client-cognito-sync"); +``` + +```ts +// ES6+ example +import { CognitoSyncClient, BulkPublishCommand } from "@aws-sdk/client-cognito-sync"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CognitoSyncClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BulkPublishCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cognito-sync"; +const client = new AWS.CognitoSync({ region: "REGION" }); + +// async/await. +try { + const data = client.bulkPublish(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .bulkPublish(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.bulkPublish(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cognito-sync` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-comprehend/README.md b/clients/client-comprehend/README.md index 67f74a31e4ea..042806b9af26 100644 --- a/clients/client-comprehend/README.md +++ b/clients/client-comprehend/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-comprehend/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-comprehend) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-comprehend.svg)](https://www.npmjs.com/package/@aws-sdk/client-comprehend) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Comprehend Client for Node.js, Browser and React Native. + +

Amazon Comprehend is an AWS service for gaining insight into the content of documents. +Use these actions to determine the topics contained in your documents, the topics they +discuss, the predominant sentiment expressed in them, the predominant language used, and +more.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-comprehend +using your favorite package manager: + +- `npm install @aws-sdk/client-comprehend` +- `yarn add @aws-sdk/client-comprehend` +- `pnpm add @aws-sdk/client-comprehend` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ComprehendClient` and +the commands you need, for example `BatchDetectDominantLanguageCommand`: + +```js +// ES5 example +const { ComprehendClient, BatchDetectDominantLanguageCommand } = require("@aws-sdk/client-comprehend"); +``` + +```ts +// ES6+ example +import { ComprehendClient, BatchDetectDominantLanguageCommand } from "@aws-sdk/client-comprehend"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ComprehendClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchDetectDominantLanguageCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-comprehend"; +const client = new AWS.Comprehend({ region: "REGION" }); + +// async/await. +try { + const data = client.batchDetectDominantLanguage(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchDetectDominantLanguage(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchDetectDominantLanguage(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-comprehend` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-comprehendmedical/README.md b/clients/client-comprehendmedical/README.md index e5b8550ba8b8..fa80250fe4bb 100644 --- a/clients/client-comprehendmedical/README.md +++ b/clients/client-comprehendmedical/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-comprehendmedical/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-comprehendmedical) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-comprehendmedical.svg)](https://www.npmjs.com/package/@aws-sdk/client-comprehendmedical) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ComprehendMedical Client for Node.js, Browser and React Native. + +

Amazon Comprehend Medical extracts structured information from unstructured clinical text. Use these actions +to gain insight in your documents.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-comprehendmedical +using your favorite package manager: + +- `npm install @aws-sdk/client-comprehendmedical` +- `yarn add @aws-sdk/client-comprehendmedical` +- `pnpm add @aws-sdk/client-comprehendmedical` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ComprehendMedicalClient` and +the commands you need, for example `DescribeEntitiesDetectionV2JobCommand`: + +```js +// ES5 example +const { ComprehendMedicalClient, DescribeEntitiesDetectionV2JobCommand } = require("@aws-sdk/client-comprehendmedical"); +``` + +```ts +// ES6+ example +import { ComprehendMedicalClient, DescribeEntitiesDetectionV2JobCommand } from "@aws-sdk/client-comprehendmedical"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ComprehendMedicalClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeEntitiesDetectionV2JobCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-comprehendmedical"; +const client = new AWS.ComprehendMedical({ region: "REGION" }); + +// async/await. +try { + const data = client.describeEntitiesDetectionV2Job(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeEntitiesDetectionV2Job(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeEntitiesDetectionV2Job(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-comprehendmedical` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-compute-optimizer/README.md b/clients/client-compute-optimizer/README.md index 5974a693db87..03bcf4a07ec0 100644 --- a/clients/client-compute-optimizer/README.md +++ b/clients/client-compute-optimizer/README.md @@ -3,4 +3,213 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-compute-optimizer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-compute-optimizer) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-compute-optimizer.svg)](https://www.npmjs.com/package/@aws-sdk/client-compute-optimizer) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ComputeOptimizer Client for Node.js, Browser and React Native. + +

AWS Compute Optimizer is a service that analyzes the configuration and utilization metrics of your +AWS compute resources, such as EC2 instances, Auto Scaling groups, and Amazon EBS volumes. It +reports whether your resources are optimal, and generates optimization recommendations +to reduce the cost and improve the performance of your workloads. Compute Optimizer also provides +recent utilization metric data, as well as projected utilization metric data for the +recommendations, which you can use to evaluate which recommendation provides the best +price-performance trade-off. The analysis of your usage patterns can help you decide +when to move or resize your running resources, and still meet your performance and +capacity requirements. For more information about Compute Optimizer, including the required +permissions to use the service, see the AWS Compute Optimizer User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-compute-optimizer +using your favorite package manager: + +- `npm install @aws-sdk/client-compute-optimizer` +- `yarn add @aws-sdk/client-compute-optimizer` +- `pnpm add @aws-sdk/client-compute-optimizer` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ComputeOptimizerClient` and +the commands you need, for example `DescribeRecommendationExportJobsCommand`: + +```js +// ES5 example +const { + ComputeOptimizerClient, + DescribeRecommendationExportJobsCommand, +} = require("@aws-sdk/client-compute-optimizer"); +``` + +```ts +// ES6+ example +import { ComputeOptimizerClient, DescribeRecommendationExportJobsCommand } from "@aws-sdk/client-compute-optimizer"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ComputeOptimizerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeRecommendationExportJobsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-compute-optimizer"; +const client = new AWS.ComputeOptimizer({ region: "REGION" }); + +// async/await. +try { + const data = client.describeRecommendationExportJobs(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeRecommendationExportJobs(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeRecommendationExportJobs(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-compute-optimizer` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-config-service/README.md b/clients/client-config-service/README.md index 9544bc163f1b..f3d44def30c9 100644 --- a/clients/client-config-service/README.md +++ b/clients/client-config-service/README.md @@ -3,4 +3,224 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-config-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-config-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-config-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-config-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ConfigService Client for Node.js, Browser and React Native. + +AWS Config + +

AWS Config provides a way to keep track of the configurations +of all the AWS resources associated with your AWS account. You can +use AWS Config to get the current and historical configurations of +each AWS resource and also to get information about the relationship +between the resources. An AWS resource can be an Amazon Compute +Cloud (Amazon EC2) instance, an Elastic Block Store (EBS) volume, an +elastic network Interface (ENI), or a security group. For a complete +list of resources currently supported by AWS Config, see Supported AWS Resources.

+ +

You can access and manage AWS Config through the AWS Management +Console, the AWS Command Line Interface (AWS CLI), the AWS Config +API, or the AWS SDKs for AWS Config. This reference guide contains +documentation for the AWS Config API and the AWS CLI commands that +you can use to manage AWS Config. The AWS Config API uses the +Signature Version 4 protocol for signing requests. For more +information about how to sign a request with this protocol, see +Signature +Version 4 Signing Process. For detailed information +about AWS Config features and their associated actions or commands, +as well as how to work with AWS Management Console, see What Is AWS +Config in the AWS Config Developer +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-config-service +using your favorite package manager: + +- `npm install @aws-sdk/client-config-service` +- `yarn add @aws-sdk/client-config-service` +- `pnpm add @aws-sdk/client-config-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ConfigServiceClient` and +the commands you need, for example `BatchGetAggregateResourceConfigCommand`: + +```js +// ES5 example +const { ConfigServiceClient, BatchGetAggregateResourceConfigCommand } = require("@aws-sdk/client-config-service"); +``` + +```ts +// ES6+ example +import { ConfigServiceClient, BatchGetAggregateResourceConfigCommand } from "@aws-sdk/client-config-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ConfigServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchGetAggregateResourceConfigCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-config-service"; +const client = new AWS.ConfigService({ region: "REGION" }); + +// async/await. +try { + const data = client.batchGetAggregateResourceConfig(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchGetAggregateResourceConfig(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchGetAggregateResourceConfig(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-config-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-connect-contact-lens/README.md b/clients/client-connect-contact-lens/README.md index f18a119fe47e..1d8424507fd8 100644 --- a/clients/client-connect-contact-lens/README.md +++ b/clients/client-connect-contact-lens/README.md @@ -3,4 +3,213 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-connect-contact-lens/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-connect-contact-lens) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-connect-contact-lens.svg)](https://www.npmjs.com/package/@aws-sdk/client-connect-contact-lens) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ConnectContactLens Client for Node.js, Browser and React Native. + +

Contact Lens for Amazon Connect enables you to analyze conversations between customer and agents, +by using speech transcription, natural language processing, and intelligent search +capabilities. It performs sentiment analysis, detects issues, and enables you to automatically +categorize contacts.

+

Contact Lens for Amazon Connect provides both real-time and post-call analytics of customer-agent +conversations. For more information, see Analyze conversations using +Contact Lens in the Amazon Connect Administrator Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-connect-contact-lens +using your favorite package manager: + +- `npm install @aws-sdk/client-connect-contact-lens` +- `yarn add @aws-sdk/client-connect-contact-lens` +- `pnpm add @aws-sdk/client-connect-contact-lens` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ConnectContactLensClient` and +the commands you need, for example `ListRealtimeContactAnalysisSegmentsCommand`: + +```js +// ES5 example +const { + ConnectContactLensClient, + ListRealtimeContactAnalysisSegmentsCommand, +} = require("@aws-sdk/client-connect-contact-lens"); +``` + +```ts +// ES6+ example +import { + ConnectContactLensClient, + ListRealtimeContactAnalysisSegmentsCommand, +} from "@aws-sdk/client-connect-contact-lens"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ConnectContactLensClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ListRealtimeContactAnalysisSegmentsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-connect-contact-lens"; +const client = new AWS.ConnectContactLens({ region: "REGION" }); + +// async/await. +try { + const data = client.listRealtimeContactAnalysisSegments(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .listRealtimeContactAnalysisSegments(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.listRealtimeContactAnalysisSegments(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-connect-contact-lens` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-connect/README.md b/clients/client-connect/README.md index 6423fd9ddf17..adf142983928 100644 --- a/clients/client-connect/README.md +++ b/clients/client-connect/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-connect/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-connect) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-connect.svg)](https://www.npmjs.com/package/@aws-sdk/client-connect) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Connect Client for Node.js, Browser and React Native. + +

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage a +customer contact center and provide reliable customer engagement at any scale.

+

Amazon Connect provides rich metrics and real-time reporting that allow you to optimize contact +routing. You can also resolve customer issues more efficiently by putting customers in touch with +the right agents.

+

There are limits to the number of Amazon Connect resources that you can create and limits to the +number of requests that you can make per second. For more information, see Amazon Connect +Service Quotas in the Amazon Connect Administrator Guide.

+

To connect programmatically to an AWS service, you use an endpoint. For a list of Amazon Connect +endpoints, see Amazon Connect +Endpoints.

+ +

Working with contact flows? Check out the Amazon Connect Flow language.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-connect +using your favorite package manager: + +- `npm install @aws-sdk/client-connect` +- `yarn add @aws-sdk/client-connect` +- `pnpm add @aws-sdk/client-connect` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ConnectClient` and +the commands you need, for example `AssociateApprovedOriginCommand`: + +```js +// ES5 example +const { ConnectClient, AssociateApprovedOriginCommand } = require("@aws-sdk/client-connect"); +``` + +```ts +// ES6+ example +import { ConnectClient, AssociateApprovedOriginCommand } from "@aws-sdk/client-connect"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ConnectClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateApprovedOriginCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-connect"; +const client = new AWS.Connect({ region: "REGION" }); + +// async/await. +try { + const data = client.associateApprovedOrigin(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateApprovedOrigin(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateApprovedOrigin(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-connect` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-connectparticipant/README.md b/clients/client-connectparticipant/README.md index 962120d854b5..95fb9cc8e1c9 100644 --- a/clients/client-connectparticipant/README.md +++ b/clients/client-connectparticipant/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-connectparticipant/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-connectparticipant) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-connectparticipant.svg)](https://www.npmjs.com/package/@aws-sdk/client-connectparticipant) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ConnectParticipant Client for Node.js, Browser and React Native. + +

Amazon Connect is a cloud-based contact center solution that makes it easy to set up and manage +a customer contact center and provide reliable customer engagement at any scale.

+

Amazon Connect enables customer contacts through voice or chat.

+ +

The APIs described here are used by chat participants, such as agents and +customers.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-connectparticipant +using your favorite package manager: + +- `npm install @aws-sdk/client-connectparticipant` +- `yarn add @aws-sdk/client-connectparticipant` +- `pnpm add @aws-sdk/client-connectparticipant` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ConnectParticipantClient` and +the commands you need, for example `CreateParticipantConnectionCommand`: + +```js +// ES5 example +const { ConnectParticipantClient, CreateParticipantConnectionCommand } = require("@aws-sdk/client-connectparticipant"); +``` + +```ts +// ES6+ example +import { ConnectParticipantClient, CreateParticipantConnectionCommand } from "@aws-sdk/client-connectparticipant"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ConnectParticipantClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateParticipantConnectionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-connectparticipant"; +const client = new AWS.ConnectParticipant({ region: "REGION" }); + +// async/await. +try { + const data = client.createParticipantConnection(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createParticipantConnection(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createParticipantConnection(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-connectparticipant` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cost-and-usage-report-service/README.md b/clients/client-cost-and-usage-report-service/README.md index 0dc1eae7485f..5b24764ad612 100644 --- a/clients/client-cost-and-usage-report-service/README.md +++ b/clients/client-cost-and-usage-report-service/README.md @@ -3,4 +3,224 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cost-and-usage-report-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cost-and-usage-report-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cost-and-usage-report-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-cost-and-usage-report-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CostAndUsageReportService Client for Node.js, Browser and React Native. + +

The AWS Cost and Usage Report API enables you to programmatically create, query, and delete +AWS Cost and Usage report definitions.

+

AWS Cost and Usage reports track the monthly AWS costs and usage +associated with your AWS account. + +The report contains line items for each unique combination of AWS product, +usage type, and operation that your AWS account uses. + +You can configure the AWS Cost and Usage report to show only the data that you want, using the +AWS Cost and Usage API.

+ +

Service Endpoint

+

The AWS Cost and Usage Report API provides the following endpoint:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cost-and-usage-report-service +using your favorite package manager: + +- `npm install @aws-sdk/client-cost-and-usage-report-service` +- `yarn add @aws-sdk/client-cost-and-usage-report-service` +- `pnpm add @aws-sdk/client-cost-and-usage-report-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CostAndUsageReportServiceClient` and +the commands you need, for example `DeleteReportDefinitionCommand`: + +```js +// ES5 example +const { + CostAndUsageReportServiceClient, + DeleteReportDefinitionCommand, +} = require("@aws-sdk/client-cost-and-usage-report-service"); +``` + +```ts +// ES6+ example +import { + CostAndUsageReportServiceClient, + DeleteReportDefinitionCommand, +} from "@aws-sdk/client-cost-and-usage-report-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CostAndUsageReportServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteReportDefinitionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cost-and-usage-report-service"; +const client = new AWS.CostAndUsageReportService({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteReportDefinition(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteReportDefinition(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteReportDefinition(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cost-and-usage-report-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-cost-explorer/README.md b/clients/client-cost-explorer/README.md index b7240a1fba43..be7ea9d417b0 100644 --- a/clients/client-cost-explorer/README.md +++ b/clients/client-cost-explorer/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-cost-explorer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-cost-explorer) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-cost-explorer.svg)](https://www.npmjs.com/package/@aws-sdk/client-cost-explorer) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CostExplorer Client for Node.js, Browser and React Native. + +

The Cost Explorer API enables you to programmatically query your cost and usage data. You can query for aggregated data +such as total monthly costs or total daily usage. You can also query for granular data, such as the number of +daily write operations for Amazon DynamoDB database tables in your production environment.

+

Service Endpoint

+

The Cost Explorer API provides the following endpoint:

+ +

For information about costs associated with the Cost Explorer API, see +AWS Cost Management Pricing.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-cost-explorer +using your favorite package manager: + +- `npm install @aws-sdk/client-cost-explorer` +- `yarn add @aws-sdk/client-cost-explorer` +- `pnpm add @aws-sdk/client-cost-explorer` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CostExplorerClient` and +the commands you need, for example `CreateAnomalyMonitorCommand`: + +```js +// ES5 example +const { CostExplorerClient, CreateAnomalyMonitorCommand } = require("@aws-sdk/client-cost-explorer"); +``` + +```ts +// ES6+ example +import { CostExplorerClient, CreateAnomalyMonitorCommand } from "@aws-sdk/client-cost-explorer"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CostExplorerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAnomalyMonitorCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-cost-explorer"; +const client = new AWS.CostExplorer({ region: "REGION" }); + +// async/await. +try { + const data = client.createAnomalyMonitor(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAnomalyMonitor(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAnomalyMonitor(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-cost-explorer` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-customer-profiles/README.md b/clients/client-customer-profiles/README.md index c06c1ecfa05b..0c49637cbe5d 100644 --- a/clients/client-customer-profiles/README.md +++ b/clients/client-customer-profiles/README.md @@ -3,4 +3,211 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-customer-profiles/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-customer-profiles) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-customer-profiles.svg)](https://www.npmjs.com/package/@aws-sdk/client-customer-profiles) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript CustomerProfiles Client for Node.js, Browser and React Native. + +Amazon Connect Customer Profiles + +

Welcome to the Amazon Connect Customer Profiles API Reference. This guide provides +information about the Amazon Connect Customer Profiles API, including supported operations, +data types, parameters, and schemas.

+

Amazon Connect Customer Profiles is a unified customer profile for your contact center +that has pre-built connectors powered by AppFlow that make it easy to combine customer +information from third party applications, such as Salesforce (CRM), ServiceNow (ITSM), and +your enterprise resource planning (ERP), with contact history from your Amazon Connect +contact center.

+

If you're new to Amazon Connect, you might find it helpful to also review the Amazon Connect Administrator Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-customer-profiles +using your favorite package manager: + +- `npm install @aws-sdk/client-customer-profiles` +- `yarn add @aws-sdk/client-customer-profiles` +- `pnpm add @aws-sdk/client-customer-profiles` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `CustomerProfilesClient` and +the commands you need, for example `AddProfileKeyCommand`: + +```js +// ES5 example +const { CustomerProfilesClient, AddProfileKeyCommand } = require("@aws-sdk/client-customer-profiles"); +``` + +```ts +// ES6+ example +import { CustomerProfilesClient, AddProfileKeyCommand } from "@aws-sdk/client-customer-profiles"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new CustomerProfilesClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddProfileKeyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-customer-profiles"; +const client = new AWS.CustomerProfiles({ region: "REGION" }); + +// async/await. +try { + const data = client.addProfileKey(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addProfileKey(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addProfileKey(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-customer-profiles` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-data-pipeline/README.md b/clients/client-data-pipeline/README.md index 7018da55eecc..5e4993d127b1 100644 --- a/clients/client-data-pipeline/README.md +++ b/clients/client-data-pipeline/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-data-pipeline/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-data-pipeline) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-data-pipeline.svg)](https://www.npmjs.com/package/@aws-sdk/client-data-pipeline) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DataPipeline Client for Node.js, Browser and React Native. + +

AWS Data Pipeline configures and manages a data-driven workflow called a pipeline. AWS Data Pipeline handles the details of scheduling and ensuring that data dependencies are met so that your application can focus on processing the data.

+ +

AWS Data Pipeline provides a JAR implementation of a task runner called AWS Data Pipeline Task Runner. AWS Data Pipeline Task Runner provides logic for common data management scenarios, such as performing database queries and running data analysis using Amazon Elastic MapReduce (Amazon EMR). You can use AWS Data Pipeline Task Runner as your task runner, or you can write your own task runner to provide custom data management.

+ +

AWS Data Pipeline implements two main sets of functionality. Use the first set to create a pipeline and define data sources, schedules, dependencies, and the transforms to be performed on the data. Use the second set in your task runner application to receive the next task ready for processing. The logic for performing the task, such as querying the data, running data analysis, or converting the data from one format to another, is contained within the task runner. The task runner performs the task assigned to it by the web service, reporting progress to the web service as it does so. When the task is done, the task runner reports the final success or failure of the task to the web service.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-data-pipeline +using your favorite package manager: + +- `npm install @aws-sdk/client-data-pipeline` +- `yarn add @aws-sdk/client-data-pipeline` +- `pnpm add @aws-sdk/client-data-pipeline` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DataPipelineClient` and +the commands you need, for example `ActivatePipelineCommand`: + +```js +// ES5 example +const { DataPipelineClient, ActivatePipelineCommand } = require("@aws-sdk/client-data-pipeline"); +``` + +```ts +// ES6+ example +import { DataPipelineClient, ActivatePipelineCommand } from "@aws-sdk/client-data-pipeline"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DataPipelineClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ActivatePipelineCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-data-pipeline"; +const client = new AWS.DataPipeline({ region: "REGION" }); + +// async/await. +try { + const data = client.activatePipeline(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .activatePipeline(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.activatePipeline(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-data-pipeline` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-database-migration-service/README.md b/clients/client-database-migration-service/README.md index 157e3eeea3d2..36cc8840df5b 100644 --- a/clients/client-database-migration-service/README.md +++ b/clients/client-database-migration-service/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-database-migration-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-database-migration-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-database-migration-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-database-migration-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DatabaseMigrationService Client for Node.js, Browser and React Native. + +AWS Database Migration Service + +

AWS Database Migration Service (AWS DMS) can migrate your data to and from the most +widely used commercial and open-source databases such as Oracle, PostgreSQL, Microsoft SQL +Server, Amazon Redshift, MariaDB, Amazon Aurora, MySQL, and SAP Adaptive Server Enterprise +(ASE). The service supports homogeneous migrations such as Oracle to Oracle, as well as +heterogeneous migrations between different database platforms, such as Oracle to MySQL or +SQL Server to PostgreSQL.

+

For more information about AWS DMS, see What Is AWS Database Migration Service? +in the AWS Database Migration User Guide. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-database-migration-service +using your favorite package manager: + +- `npm install @aws-sdk/client-database-migration-service` +- `yarn add @aws-sdk/client-database-migration-service` +- `pnpm add @aws-sdk/client-database-migration-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DatabaseMigrationServiceClient` and +the commands you need, for example `AddTagsToResourceCommand`: + +```js +// ES5 example +const { + DatabaseMigrationServiceClient, + AddTagsToResourceCommand, +} = require("@aws-sdk/client-database-migration-service"); +``` + +```ts +// ES6+ example +import { DatabaseMigrationServiceClient, AddTagsToResourceCommand } from "@aws-sdk/client-database-migration-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DatabaseMigrationServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToResourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-database-migration-service"; +const client = new AWS.DatabaseMigrationService({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToResource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-database-migration-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-databrew/README.md b/clients/client-databrew/README.md index e05a8b4b21f6..2cdbfea318cb 100644 --- a/clients/client-databrew/README.md +++ b/clients/client-databrew/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-databrew/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-databrew) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-databrew.svg)](https://www.npmjs.com/package/@aws-sdk/client-databrew) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DataBrew Client for Node.js, Browser and React Native. + +

AWS Glue DataBrew is a visual, cloud-scale data-preparation service. DataBrew +simplifies data preparation tasks, targeting data issues that are hard to spot and +time-consuming to fix. DataBrew empowers users of all technical levels to visualize the +data and perform one-click data transformations, with no coding required.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-databrew +using your favorite package manager: + +- `npm install @aws-sdk/client-databrew` +- `yarn add @aws-sdk/client-databrew` +- `pnpm add @aws-sdk/client-databrew` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DataBrewClient` and +the commands you need, for example `BatchDeleteRecipeVersionCommand`: + +```js +// ES5 example +const { DataBrewClient, BatchDeleteRecipeVersionCommand } = require("@aws-sdk/client-databrew"); +``` + +```ts +// ES6+ example +import { DataBrewClient, BatchDeleteRecipeVersionCommand } from "@aws-sdk/client-databrew"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DataBrewClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchDeleteRecipeVersionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-databrew"; +const client = new AWS.DataBrew({ region: "REGION" }); + +// async/await. +try { + const data = client.batchDeleteRecipeVersion(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchDeleteRecipeVersion(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchDeleteRecipeVersion(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-databrew` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-dataexchange/README.md b/clients/client-dataexchange/README.md index e9ffdfc09e0b..fa23c38f69eb 100644 --- a/clients/client-dataexchange/README.md +++ b/clients/client-dataexchange/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-dataexchange/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-dataexchange) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-dataexchange.svg)](https://www.npmjs.com/package/@aws-sdk/client-dataexchange) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DataExchange Client for Node.js, Browser and React Native. + +

AWS Data Exchange is a service that makes it easy for AWS customers to exchange data in the cloud. You can use the AWS Data Exchange APIs to create, update, manage, and access file-based data set in the AWS Cloud.

As a subscriber, you can view and access the data sets that you have an entitlement to through a subscription. You can use the APIS to download or copy your entitled data sets to Amazon S3 for use across a variety of AWS analytics and machine learning services.

As a provider, you can create and manage your data sets that you would like to publish to a product. Being able to package and provide your data sets into products requires a few steps to determine eligibility. For more information, visit the AWS Data Exchange User Guide.

A data set is a collection of data that can be changed or updated over time. Data sets can be updated using revisions, which represent a new version or incremental change to a data set. A revision contains one or more assets. An asset in AWS Data Exchange is a piece of data that can be stored as an Amazon S3 object. The asset can be a structured data file, an image file, or some other data file. Jobs are asynchronous import or export operations used to create or copy assets.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-dataexchange +using your favorite package manager: + +- `npm install @aws-sdk/client-dataexchange` +- `yarn add @aws-sdk/client-dataexchange` +- `pnpm add @aws-sdk/client-dataexchange` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DataExchangeClient` and +the commands you need, for example `CancelJobCommand`: + +```js +// ES5 example +const { DataExchangeClient, CancelJobCommand } = require("@aws-sdk/client-dataexchange"); +``` + +```ts +// ES6+ example +import { DataExchangeClient, CancelJobCommand } from "@aws-sdk/client-dataexchange"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DataExchangeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelJobCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-dataexchange"; +const client = new AWS.DataExchange({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelJob(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelJob(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelJob(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-dataexchange` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-datasync/README.md b/clients/client-datasync/README.md index 54ef87e90504..390f3b8a4d53 100644 --- a/clients/client-datasync/README.md +++ b/clients/client-datasync/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-datasync/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-datasync) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-datasync.svg)](https://www.npmjs.com/package/@aws-sdk/client-datasync) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DataSync Client for Node.js, Browser and React Native. + +AWS DataSync + +

AWS DataSync is a managed data transfer service that makes it simpler for you to +automate moving data between on-premises storage and Amazon Simple Storage Service (Amazon S3) +or Amazon Elastic File System (Amazon EFS).

+

This API interface reference for AWS DataSync contains documentation for a +programming interface that you can use to manage AWS DataSync.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-datasync +using your favorite package manager: + +- `npm install @aws-sdk/client-datasync` +- `yarn add @aws-sdk/client-datasync` +- `pnpm add @aws-sdk/client-datasync` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DataSyncClient` and +the commands you need, for example `CancelTaskExecutionCommand`: + +```js +// ES5 example +const { DataSyncClient, CancelTaskExecutionCommand } = require("@aws-sdk/client-datasync"); +``` + +```ts +// ES6+ example +import { DataSyncClient, CancelTaskExecutionCommand } from "@aws-sdk/client-datasync"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DataSyncClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelTaskExecutionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-datasync"; +const client = new AWS.DataSync({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelTaskExecution(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelTaskExecution(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelTaskExecution(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-datasync` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-dax/README.md b/clients/client-dax/README.md index 253c25c2fd93..ded84e40be62 100644 --- a/clients/client-dax/README.md +++ b/clients/client-dax/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-dax/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-dax) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-dax.svg)](https://www.npmjs.com/package/@aws-sdk/client-dax) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DAX Client for Node.js, Browser and React Native. + +

DAX is a managed caching service engineered for Amazon DynamoDB. DAX +dramatically speeds up database reads by caching frequently-accessed data from DynamoDB, so +applications can access that data with sub-millisecond latency. You can create a DAX +cluster easily, using the AWS Management Console. With a few simple modifications to +your code, your application can begin taking advantage of the DAX cluster and realize +significant improvements in read performance.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-dax +using your favorite package manager: + +- `npm install @aws-sdk/client-dax` +- `yarn add @aws-sdk/client-dax` +- `pnpm add @aws-sdk/client-dax` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DAXClient` and +the commands you need, for example `CreateClusterCommand`: + +```js +// ES5 example +const { DAXClient, CreateClusterCommand } = require("@aws-sdk/client-dax"); +``` + +```ts +// ES6+ example +import { DAXClient, CreateClusterCommand } from "@aws-sdk/client-dax"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DAXClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateClusterCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-dax"; +const client = new AWS.DAX({ region: "REGION" }); + +// async/await. +try { + const data = client.createCluster(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createCluster(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createCluster(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-dax` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-detective/README.md b/clients/client-detective/README.md index cf88b92b351f..1a8e6d1bac12 100644 --- a/clients/client-detective/README.md +++ b/clients/client-detective/README.md @@ -3,4 +3,241 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-detective/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-detective) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-detective.svg)](https://www.npmjs.com/package/@aws-sdk/client-detective) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Detective Client for Node.js, Browser and React Native. + +

Detective uses machine learning and purpose-built visualizations to help you analyze and +investigate security issues across your Amazon Web Services (AWS) workloads. Detective automatically +extracts time-based events such as login attempts, API calls, and network traffic from +AWS CloudTrail and Amazon Virtual Private Cloud (Amazon VPC) flow logs. It also extracts findings detected by +Amazon GuardDuty.

+

The Detective API primarily supports the creation and management of behavior graphs. A +behavior graph contains the extracted data from a set of member accounts, and is created +and managed by a master account.

+

Every behavior graph is specific to a Region. You can only use the API to manage graphs +that belong to the Region that is associated with the currently selected endpoint.

+

A Detective master account can use the Detective API to do the following:

+ +

A member account can use the Detective API to do the following:

+ +

All API actions are logged as CloudTrail events. See Logging Detective API Calls with CloudTrail.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-detective +using your favorite package manager: + +- `npm install @aws-sdk/client-detective` +- `yarn add @aws-sdk/client-detective` +- `pnpm add @aws-sdk/client-detective` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DetectiveClient` and +the commands you need, for example `AcceptInvitationCommand`: + +```js +// ES5 example +const { DetectiveClient, AcceptInvitationCommand } = require("@aws-sdk/client-detective"); +``` + +```ts +// ES6+ example +import { DetectiveClient, AcceptInvitationCommand } from "@aws-sdk/client-detective"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DetectiveClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptInvitationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-detective"; +const client = new AWS.Detective({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptInvitation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptInvitation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptInvitation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-detective` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-device-farm/README.md b/clients/client-device-farm/README.md index 645dc974232b..04ca4453fc77 100644 --- a/clients/client-device-farm/README.md +++ b/clients/client-device-farm/README.md @@ -3,4 +3,215 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-device-farm/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-device-farm) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-device-farm.svg)](https://www.npmjs.com/package/@aws-sdk/client-device-farm) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DeviceFarm Client for Node.js, Browser and React Native. + +

Welcome to the AWS Device Farm API documentation, which contains APIs for:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-device-farm +using your favorite package manager: + +- `npm install @aws-sdk/client-device-farm` +- `yarn add @aws-sdk/client-device-farm` +- `pnpm add @aws-sdk/client-device-farm` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DeviceFarmClient` and +the commands you need, for example `CreateDevicePoolCommand`: + +```js +// ES5 example +const { DeviceFarmClient, CreateDevicePoolCommand } = require("@aws-sdk/client-device-farm"); +``` + +```ts +// ES6+ example +import { DeviceFarmClient, CreateDevicePoolCommand } from "@aws-sdk/client-device-farm"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DeviceFarmClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDevicePoolCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-device-farm"; +const client = new AWS.DeviceFarm({ region: "REGION" }); + +// async/await. +try { + const data = client.createDevicePool(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDevicePool(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDevicePool(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-device-farm` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-devops-guru/README.md b/clients/client-devops-guru/README.md index 2aaa018b234e..e8ee4f991ed8 100644 --- a/clients/client-devops-guru/README.md +++ b/clients/client-devops-guru/README.md @@ -3,4 +3,199 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-devops-guru/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-devops-guru) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-devops-guru.svg)](https://www.npmjs.com/package/@aws-sdk/client-devops-guru) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DevOpsGuru Client for Node.js, Browser and React Native. + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-devops-guru +using your favorite package manager: + +- `npm install @aws-sdk/client-devops-guru` +- `yarn add @aws-sdk/client-devops-guru` +- `pnpm add @aws-sdk/client-devops-guru` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DevOpsGuruClient` and +the commands you need, for example `AddNotificationChannelCommand`: + +```js +// ES5 example +const { DevOpsGuruClient, AddNotificationChannelCommand } = require("@aws-sdk/client-devops-guru"); +``` + +```ts +// ES6+ example +import { DevOpsGuruClient, AddNotificationChannelCommand } from "@aws-sdk/client-devops-guru"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DevOpsGuruClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddNotificationChannelCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-devops-guru"; +const client = new AWS.DevOpsGuru({ region: "REGION" }); + +// async/await. +try { + const data = client.addNotificationChannel(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addNotificationChannel(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addNotificationChannel(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-devops-guru` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-direct-connect/README.md b/clients/client-direct-connect/README.md index 40849a58bb56..8b4169d66497 100644 --- a/clients/client-direct-connect/README.md +++ b/clients/client-direct-connect/README.md @@ -3,4 +3,212 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-direct-connect/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-direct-connect) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-direct-connect.svg)](https://www.npmjs.com/package/@aws-sdk/client-direct-connect) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DirectConnect Client for Node.js, Browser and React Native. + +

AWS Direct Connect links your internal network to an AWS Direct Connect location over a standard Ethernet fiber-optic cable. +One end of the cable is connected to your router, the other to an AWS Direct Connect router. With this connection +in place, you can create virtual interfaces directly to the AWS cloud (for example, to Amazon EC2 +and Amazon S3) and to Amazon VPC, bypassing Internet service providers in your network path. A +connection provides access to all AWS Regions except the China (Beijing) and (China) Ningxia Regions. +AWS resources in the China Regions can only be accessed through locations associated with those Regions.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-direct-connect +using your favorite package manager: + +- `npm install @aws-sdk/client-direct-connect` +- `yarn add @aws-sdk/client-direct-connect` +- `pnpm add @aws-sdk/client-direct-connect` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DirectConnectClient` and +the commands you need, for example `AcceptDirectConnectGatewayAssociationProposalCommand`: + +```js +// ES5 example +const { + DirectConnectClient, + AcceptDirectConnectGatewayAssociationProposalCommand, +} = require("@aws-sdk/client-direct-connect"); +``` + +```ts +// ES6+ example +import { + DirectConnectClient, + AcceptDirectConnectGatewayAssociationProposalCommand, +} from "@aws-sdk/client-direct-connect"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DirectConnectClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptDirectConnectGatewayAssociationProposalCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-direct-connect"; +const client = new AWS.DirectConnect({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptDirectConnectGatewayAssociationProposal(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptDirectConnectGatewayAssociationProposal(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptDirectConnectGatewayAssociationProposal(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-direct-connect` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-directory-service/README.md b/clients/client-directory-service/README.md index b1c8f2349cce..ec9aca8cbe57 100644 --- a/clients/client-directory-service/README.md +++ b/clients/client-directory-service/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-directory-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-directory-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-directory-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-directory-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DirectoryService Client for Node.js, Browser and React Native. + +AWS Directory Service + +

AWS Directory Service is a web service that makes it easy for you to setup and run directories in the AWS cloud, or connect your AWS resources with an existing on-premises Microsoft Active Directory. This guide provides detailed information about AWS Directory Service operations, data types, parameters, and errors. For information about AWS Directory Services features, see AWS Directory Service and the AWS Directory Service Administration Guide.

+ +

AWS provides SDKs that consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .Net, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWS Directory Service and other AWS services. For more information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web +Services.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-directory-service +using your favorite package manager: + +- `npm install @aws-sdk/client-directory-service` +- `yarn add @aws-sdk/client-directory-service` +- `pnpm add @aws-sdk/client-directory-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DirectoryServiceClient` and +the commands you need, for example `AcceptSharedDirectoryCommand`: + +```js +// ES5 example +const { DirectoryServiceClient, AcceptSharedDirectoryCommand } = require("@aws-sdk/client-directory-service"); +``` + +```ts +// ES6+ example +import { DirectoryServiceClient, AcceptSharedDirectoryCommand } from "@aws-sdk/client-directory-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DirectoryServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptSharedDirectoryCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-directory-service"; +const client = new AWS.DirectoryService({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptSharedDirectory(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptSharedDirectory(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptSharedDirectory(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-directory-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-dlm/README.md b/clients/client-dlm/README.md index a92699929523..6f8424dab3bd 100644 --- a/clients/client-dlm/README.md +++ b/clients/client-dlm/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-dlm/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-dlm) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-dlm.svg)](https://www.npmjs.com/package/@aws-sdk/client-dlm) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DLM Client for Node.js, Browser and React Native. + +Amazon Data Lifecycle Manager

With Amazon Data Lifecycle Manager, you can manage the lifecycle of your AWS resources. You create lifecycle policies, which are used to automate operations on the specified resources.

Amazon DLM supports Amazon EBS volumes and snapshots. For information about using Amazon DLM with Amazon EBS, see Automating the Amazon EBS Snapshot Lifecycle in the Amazon EC2 User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-dlm +using your favorite package manager: + +- `npm install @aws-sdk/client-dlm` +- `yarn add @aws-sdk/client-dlm` +- `pnpm add @aws-sdk/client-dlm` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DLMClient` and +the commands you need, for example `CreateLifecyclePolicyCommand`: + +```js +// ES5 example +const { DLMClient, CreateLifecyclePolicyCommand } = require("@aws-sdk/client-dlm"); +``` + +```ts +// ES6+ example +import { DLMClient, CreateLifecyclePolicyCommand } from "@aws-sdk/client-dlm"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DLMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateLifecyclePolicyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-dlm"; +const client = new AWS.DLM({ region: "REGION" }); + +// async/await. +try { + const data = client.createLifecyclePolicy(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createLifecyclePolicy(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createLifecyclePolicy(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-dlm` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-docdb/README.md b/clients/client-docdb/README.md index d99a3b98b074..7ab312f42e96 100644 --- a/clients/client-docdb/README.md +++ b/clients/client-docdb/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-docdb/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-docdb) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-docdb.svg)](https://www.npmjs.com/package/@aws-sdk/client-docdb) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DocDB Client for Node.js, Browser and React Native. + +

Amazon DocumentDB API documentation

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-docdb +using your favorite package manager: + +- `npm install @aws-sdk/client-docdb` +- `yarn add @aws-sdk/client-docdb` +- `pnpm add @aws-sdk/client-docdb` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DocDBClient` and +the commands you need, for example `AddTagsToResourceCommand`: + +```js +// ES5 example +const { DocDBClient, AddTagsToResourceCommand } = require("@aws-sdk/client-docdb"); +``` + +```ts +// ES6+ example +import { DocDBClient, AddTagsToResourceCommand } from "@aws-sdk/client-docdb"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DocDBClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToResourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-docdb"; +const client = new AWS.DocDB({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToResource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-docdb` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-dynamodb-streams/README.md b/clients/client-dynamodb-streams/README.md index 3e977639432c..b53d3d37c890 100644 --- a/clients/client-dynamodb-streams/README.md +++ b/clients/client-dynamodb-streams/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-dynamodb-streams/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-dynamodb-streams) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-dynamodb-streams.svg)](https://www.npmjs.com/package/@aws-sdk/client-dynamodb-streams) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DynamoDBStreams Client for Node.js, Browser and React Native. + +Amazon DynamoDB + +

Amazon DynamoDB Streams provides API actions for accessing streams and processing +stream records. To learn more about application development with Streams, see Capturing +Table Activity with DynamoDB Streams in the Amazon DynamoDB Developer +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-dynamodb-streams +using your favorite package manager: + +- `npm install @aws-sdk/client-dynamodb-streams` +- `yarn add @aws-sdk/client-dynamodb-streams` +- `pnpm add @aws-sdk/client-dynamodb-streams` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DynamoDBStreamsClient` and +the commands you need, for example `DescribeStreamCommand`: + +```js +// ES5 example +const { DynamoDBStreamsClient, DescribeStreamCommand } = require("@aws-sdk/client-dynamodb-streams"); +``` + +```ts +// ES6+ example +import { DynamoDBStreamsClient, DescribeStreamCommand } from "@aws-sdk/client-dynamodb-streams"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DynamoDBStreamsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeStreamCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-dynamodb-streams"; +const client = new AWS.DynamoDBStreams({ region: "REGION" }); + +// async/await. +try { + const data = client.describeStream(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeStream(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeStream(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-dynamodb-streams` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-dynamodb/README.md b/clients/client-dynamodb/README.md index 5ab4351e5fb8..1ed9cc6b477f 100644 --- a/clients/client-dynamodb/README.md +++ b/clients/client-dynamodb/README.md @@ -3,4 +3,218 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-dynamodb/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-dynamodb) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-dynamodb.svg)](https://www.npmjs.com/package/@aws-sdk/client-dynamodb) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript DynamoDB Client for Node.js, Browser and React Native. + +Amazon DynamoDB + +

Amazon DynamoDB is a fully managed NoSQL database service that provides fast and +predictable performance with seamless scalability. DynamoDB lets you offload the +administrative burdens of operating and scaling a distributed database, so that you don't have +to worry about hardware provisioning, setup and configuration, replication, software patching, +or cluster scaling.

+ +

With DynamoDB, you can create database tables that can store and retrieve any amount of +data, and serve any level of request traffic. You can scale up or scale down your tables' +throughput capacity without downtime or performance degradation, and use the AWS Management +Console to monitor resource utilization and performance metrics.

+ +

DynamoDB automatically spreads the data and traffic for your tables over a sufficient +number of servers to handle your throughput and storage requirements, while maintaining +consistent and fast performance. All of your data is stored on solid state disks (SSDs) and +automatically replicated across multiple Availability Zones in an AWS region, providing +built-in high availability and data durability.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-dynamodb +using your favorite package manager: + +- `npm install @aws-sdk/client-dynamodb` +- `yarn add @aws-sdk/client-dynamodb` +- `pnpm add @aws-sdk/client-dynamodb` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `DynamoDBClient` and +the commands you need, for example `BatchExecuteStatementCommand`: + +```js +// ES5 example +const { DynamoDBClient, BatchExecuteStatementCommand } = require("@aws-sdk/client-dynamodb"); +``` + +```ts +// ES6+ example +import { DynamoDBClient, BatchExecuteStatementCommand } from "@aws-sdk/client-dynamodb"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new DynamoDBClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchExecuteStatementCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-dynamodb"; +const client = new AWS.DynamoDB({ region: "REGION" }); + +// async/await. +try { + const data = client.batchExecuteStatement(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchExecuteStatement(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchExecuteStatement(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-dynamodb` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ebs/README.md b/clients/client-ebs/README.md index 2ec52847a70c..aea3daddac33 100644 --- a/clients/client-ebs/README.md +++ b/clients/client-ebs/README.md @@ -3,4 +3,219 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ebs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ebs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ebs.svg)](https://www.npmjs.com/package/@aws-sdk/client-ebs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EBS Client for Node.js, Browser and React Native. + +

You can use the Amazon Elastic Block Store (Amazon EBS) direct APIs to create EBS snapshots, write data directly to +your snapshots, read data on your snapshots, and identify the differences or changes between +two snapshots. If you’re an independent software vendor (ISV) who offers backup services for +Amazon EBS, the EBS direct APIs make it more efficient and cost-effective to track incremental changes on +your EBS volumes through snapshots. This can be done without having to create new volumes +from snapshots, and then use Amazon Elastic Compute Cloud (Amazon EC2) instances to compare the differences.

+ +

You can create incremental snapshots directly from data on-premises into EBS volumes and the +cloud to use for quick disaster recovery. With the ability to write and read snapshots, you can +write your on-premises data to an EBS snapshot during a disaster. Then after recovery, you can +restore it back to AWS or on-premises from the snapshot. You no longer need to build and +maintain complex mechanisms to copy data to and from Amazon EBS.

+ +

This API reference provides detailed information about the actions, data types, +parameters, and errors of the EBS direct APIs. For more information about the elements that +make up the EBS direct APIs, and examples of how to use them effectively, see Accessing the Contents of an EBS Snapshot in the Amazon Elastic Compute Cloud User +Guide. For more information about the supported AWS Regions, endpoints, +and service quotas for the EBS direct APIs, see Amazon Elastic Block Store Endpoints and Quotas in +the AWS General Reference.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ebs +using your favorite package manager: + +- `npm install @aws-sdk/client-ebs` +- `yarn add @aws-sdk/client-ebs` +- `pnpm add @aws-sdk/client-ebs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EBSClient` and +the commands you need, for example `CompleteSnapshotCommand`: + +```js +// ES5 example +const { EBSClient, CompleteSnapshotCommand } = require("@aws-sdk/client-ebs"); +``` + +```ts +// ES6+ example +import { EBSClient, CompleteSnapshotCommand } from "@aws-sdk/client-ebs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EBSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CompleteSnapshotCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ebs"; +const client = new AWS.EBS({ region: "REGION" }); + +// async/await. +try { + const data = client.completeSnapshot(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .completeSnapshot(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.completeSnapshot(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ebs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ec2-instance-connect/README.md b/clients/client-ec2-instance-connect/README.md index 4a5ee51d6784..fda8156b9846 100644 --- a/clients/client-ec2-instance-connect/README.md +++ b/clients/client-ec2-instance-connect/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ec2-instance-connect/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ec2-instance-connect) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ec2-instance-connect.svg)](https://www.npmjs.com/package/@aws-sdk/client-ec2-instance-connect) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EC2InstanceConnect Client for Node.js, Browser and React Native. + +

AWS EC2 Connect Service is a service that enables system administrators to publish +temporary SSH keys to their EC2 instances in order to establish connections to their +instances without leaving a permanent authentication option.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ec2-instance-connect +using your favorite package manager: + +- `npm install @aws-sdk/client-ec2-instance-connect` +- `yarn add @aws-sdk/client-ec2-instance-connect` +- `pnpm add @aws-sdk/client-ec2-instance-connect` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EC2InstanceConnectClient` and +the commands you need, for example `SendSSHPublicKeyCommand`: + +```js +// ES5 example +const { EC2InstanceConnectClient, SendSSHPublicKeyCommand } = require("@aws-sdk/client-ec2-instance-connect"); +``` + +```ts +// ES6+ example +import { EC2InstanceConnectClient, SendSSHPublicKeyCommand } from "@aws-sdk/client-ec2-instance-connect"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EC2InstanceConnectClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new SendSSHPublicKeyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ec2-instance-connect"; +const client = new AWS.EC2InstanceConnect({ region: "REGION" }); + +// async/await. +try { + const data = client.sendSSHPublicKey(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .sendSSHPublicKey(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.sendSSHPublicKey(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ec2-instance-connect` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ec2/README.md b/clients/client-ec2/README.md index 832fb7b543e5..d24177e70397 100644 --- a/clients/client-ec2/README.md +++ b/clients/client-ec2/README.md @@ -3,4 +3,224 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ec2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ec2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ec2.svg)](https://www.npmjs.com/package/@aws-sdk/client-ec2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EC2 Client for Node.js, Browser and React Native. + +Amazon Elastic Compute Cloud + +

Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing capacity in the AWS cloud. +Using Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and +deploy applications faster.

+

To learn more, see the following resources:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ec2 +using your favorite package manager: + +- `npm install @aws-sdk/client-ec2` +- `yarn add @aws-sdk/client-ec2` +- `pnpm add @aws-sdk/client-ec2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EC2Client` and +the commands you need, for example `AcceptReservedInstancesExchangeQuoteCommand`: + +```js +// ES5 example +const { EC2Client, AcceptReservedInstancesExchangeQuoteCommand } = require("@aws-sdk/client-ec2"); +``` + +```ts +// ES6+ example +import { EC2Client, AcceptReservedInstancesExchangeQuoteCommand } from "@aws-sdk/client-ec2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EC2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptReservedInstancesExchangeQuoteCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ec2"; +const client = new AWS.EC2({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptReservedInstancesExchangeQuote(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptReservedInstancesExchangeQuote(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptReservedInstancesExchangeQuote(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ec2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ecr-public/README.md b/clients/client-ecr-public/README.md index fe4a95124767..164b909f0daf 100644 --- a/clients/client-ecr-public/README.md +++ b/clients/client-ecr-public/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ecr-public/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ecr-public) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ecr-public.svg)](https://www.npmjs.com/package/@aws-sdk/client-ecr-public) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ECRPUBLIC Client for Node.js, Browser and React Native. + +Amazon Elastic Container Registry Public + +

Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service. Amazon ECR provides both +public and private registries to host your container images. You can use the familiar +Docker CLI, or their preferred client, to push, pull, and manage images. Amazon ECR provides a +secure, scalable, and reliable registry for your Docker or Open Container Initiative (OCI) +images. Amazon ECR supports public repositories with this API. For information about the Amazon ECR +API for private repositories, see Amazon Elastic Container Registry API Reference.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ecr-public +using your favorite package manager: + +- `npm install @aws-sdk/client-ecr-public` +- `yarn add @aws-sdk/client-ecr-public` +- `pnpm add @aws-sdk/client-ecr-public` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ECRPUBLICClient` and +the commands you need, for example `BatchCheckLayerAvailabilityCommand`: + +```js +// ES5 example +const { ECRPUBLICClient, BatchCheckLayerAvailabilityCommand } = require("@aws-sdk/client-ecr-public"); +``` + +```ts +// ES6+ example +import { ECRPUBLICClient, BatchCheckLayerAvailabilityCommand } from "@aws-sdk/client-ecr-public"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ECRPUBLICClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchCheckLayerAvailabilityCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ecr-public"; +const client = new AWS.ECRPUBLIC({ region: "REGION" }); + +// async/await. +try { + const data = client.batchCheckLayerAvailability(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchCheckLayerAvailability(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchCheckLayerAvailability(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ecr-public` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ecr/README.md b/clients/client-ecr/README.md index 503c03c6c94b..b714761e9ee1 100644 --- a/clients/client-ecr/README.md +++ b/clients/client-ecr/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ecr/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ecr) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ecr.svg)](https://www.npmjs.com/package/@aws-sdk/client-ecr) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ECR Client for Node.js, Browser and React Native. + +Amazon Elastic Container Registry + +

Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service. Customers can use the +familiar Docker CLI, or their preferred client, to push, pull, and manage images. Amazon ECR +provides a secure, scalable, and reliable registry for your Docker or Open Container +Initiative (OCI) images. Amazon ECR supports private repositories with resource-based +permissions using IAM so that specific users or Amazon EC2 instances can access +repositories and images.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ecr +using your favorite package manager: + +- `npm install @aws-sdk/client-ecr` +- `yarn add @aws-sdk/client-ecr` +- `pnpm add @aws-sdk/client-ecr` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ECRClient` and +the commands you need, for example `BatchCheckLayerAvailabilityCommand`: + +```js +// ES5 example +const { ECRClient, BatchCheckLayerAvailabilityCommand } = require("@aws-sdk/client-ecr"); +``` + +```ts +// ES6+ example +import { ECRClient, BatchCheckLayerAvailabilityCommand } from "@aws-sdk/client-ecr"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ECRClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchCheckLayerAvailabilityCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ecr"; +const client = new AWS.ECR({ region: "REGION" }); + +// async/await. +try { + const data = client.batchCheckLayerAvailability(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchCheckLayerAvailability(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchCheckLayerAvailability(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ecr` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ecs/README.md b/clients/client-ecs/README.md index 98d6d3c6c934..2f2f7beeb191 100644 --- a/clients/client-ecs/README.md +++ b/clients/client-ecs/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ecs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ecs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ecs.svg)](https://www.npmjs.com/package/@aws-sdk/client-ecs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ECS Client for Node.js, Browser and React Native. + +Amazon Elastic Container Service + +

Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes +it easy to run, stop, and manage Docker containers on a cluster. You can host your +cluster on a serverless infrastructure that is managed by Amazon ECS by launching your +services or tasks using the Fargate launch type. For more control, you can host your +tasks on a cluster of Amazon Elastic Compute Cloud (Amazon EC2) instances that you manage by using the EC2 +launch type. For more information about launch types, see Amazon ECS Launch +Types.

+

Amazon ECS lets you launch and stop container-based applications with simple API calls, +allows you to get the state of your cluster from a centralized service, and gives you +access to many familiar Amazon EC2 features.

+

You can use Amazon ECS to schedule the placement of containers across your cluster based on +your resource needs, isolation policies, and availability requirements. Amazon ECS eliminates +the need for you to operate your own cluster management and configuration management +systems or worry about scaling your management infrastructure.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ecs +using your favorite package manager: + +- `npm install @aws-sdk/client-ecs` +- `yarn add @aws-sdk/client-ecs` +- `pnpm add @aws-sdk/client-ecs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ECSClient` and +the commands you need, for example `CreateCapacityProviderCommand`: + +```js +// ES5 example +const { ECSClient, CreateCapacityProviderCommand } = require("@aws-sdk/client-ecs"); +``` + +```ts +// ES6+ example +import { ECSClient, CreateCapacityProviderCommand } from "@aws-sdk/client-ecs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ECSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateCapacityProviderCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ecs"; +const client = new AWS.ECS({ region: "REGION" }); + +// async/await. +try { + const data = client.createCapacityProvider(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createCapacityProvider(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createCapacityProvider(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ecs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-efs/README.md b/clients/client-efs/README.md index 43cd1c77ae00..205ee7ad6978 100644 --- a/clients/client-efs/README.md +++ b/clients/client-efs/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-efs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-efs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-efs.svg)](https://www.npmjs.com/package/@aws-sdk/client-efs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EFS Client for Node.js, Browser and React Native. + +Amazon Elastic File System + +

Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage for use +with Amazon EC2 instances in the AWS Cloud. With Amazon EFS, storage capacity is elastic, +growing and shrinking automatically as you add and remove files, so your applications have the +storage they need, when they need it. For more information, see the User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-efs +using your favorite package manager: + +- `npm install @aws-sdk/client-efs` +- `yarn add @aws-sdk/client-efs` +- `pnpm add @aws-sdk/client-efs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EFSClient` and +the commands you need, for example `CreateAccessPointCommand`: + +```js +// ES5 example +const { EFSClient, CreateAccessPointCommand } = require("@aws-sdk/client-efs"); +``` + +```ts +// ES6+ example +import { EFSClient, CreateAccessPointCommand } from "@aws-sdk/client-efs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EFSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAccessPointCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-efs"; +const client = new AWS.EFS({ region: "REGION" }); + +// async/await. +try { + const data = client.createAccessPoint(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAccessPoint(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAccessPoint(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-efs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-eks/README.md b/clients/client-eks/README.md index 59bc54cc4745..a1f99ff2b335 100644 --- a/clients/client-eks/README.md +++ b/clients/client-eks/README.md @@ -3,4 +3,210 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-eks/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-eks) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-eks.svg)](https://www.npmjs.com/package/@aws-sdk/client-eks) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EKS Client for Node.js, Browser and React Native. + +

Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that makes it easy for you to run Kubernetes on +AWS without needing to stand up or maintain your own Kubernetes control plane. +Kubernetes is an open-source system for automating the deployment, scaling, and +management of containerized applications.

+

Amazon EKS runs up-to-date versions of the open-source Kubernetes software, so you can use +all the existing plugins and tooling from the Kubernetes community. Applications running +on Amazon EKS are fully compatible with applications running on any standard Kubernetes +environment, whether running in on-premises data centers or public clouds. This means +that you can easily migrate any standard Kubernetes application to Amazon EKS without any +code modification required.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-eks +using your favorite package manager: + +- `npm install @aws-sdk/client-eks` +- `yarn add @aws-sdk/client-eks` +- `pnpm add @aws-sdk/client-eks` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EKSClient` and +the commands you need, for example `CreateAddonCommand`: + +```js +// ES5 example +const { EKSClient, CreateAddonCommand } = require("@aws-sdk/client-eks"); +``` + +```ts +// ES6+ example +import { EKSClient, CreateAddonCommand } from "@aws-sdk/client-eks"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EKSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAddonCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-eks"; +const client = new AWS.EKS({ region: "REGION" }); + +// async/await. +try { + const data = client.createAddon(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAddon(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAddon(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-eks` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elastic-beanstalk/README.md b/clients/client-elastic-beanstalk/README.md index 666e86d09c61..bfb7db1d46a2 100644 --- a/clients/client-elastic-beanstalk/README.md +++ b/clients/client-elastic-beanstalk/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elastic-beanstalk/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-beanstalk) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elastic-beanstalk.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-beanstalk) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElasticBeanstalk Client for Node.js, Browser and React Native. + +AWS Elastic Beanstalk + +

AWS Elastic Beanstalk makes it easy for you to create, deploy, and manage scalable, +fault-tolerant applications running on the Amazon Web Services cloud.

+

For more information about this product, go to the AWS Elastic Beanstalk details page. The location of the +latest AWS Elastic Beanstalk WSDL is https://elasticbeanstalk.s3.amazonaws.com/doc/2010-12-01/AWSElasticBeanstalk.wsdl. +To install the Software Development Kits (SDKs), Integrated Development Environment (IDE) +Toolkits, and command line tools that enable you to access the API, go to Tools for Amazon Web Services.

+

+Endpoints +

+

For a list of region-specific endpoints that AWS Elastic Beanstalk supports, go to +Regions and Endpoints in the Amazon Web Services +Glossary.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elastic-beanstalk +using your favorite package manager: + +- `npm install @aws-sdk/client-elastic-beanstalk` +- `yarn add @aws-sdk/client-elastic-beanstalk` +- `pnpm add @aws-sdk/client-elastic-beanstalk` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElasticBeanstalkClient` and +the commands you need, for example `AbortEnvironmentUpdateCommand`: + +```js +// ES5 example +const { ElasticBeanstalkClient, AbortEnvironmentUpdateCommand } = require("@aws-sdk/client-elastic-beanstalk"); +``` + +```ts +// ES6+ example +import { ElasticBeanstalkClient, AbortEnvironmentUpdateCommand } from "@aws-sdk/client-elastic-beanstalk"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElasticBeanstalkClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AbortEnvironmentUpdateCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elastic-beanstalk"; +const client = new AWS.ElasticBeanstalk({ region: "REGION" }); + +// async/await. +try { + const data = client.abortEnvironmentUpdate(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .abortEnvironmentUpdate(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.abortEnvironmentUpdate(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elastic-beanstalk` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elastic-inference/README.md b/clients/client-elastic-inference/README.md index 69fe2c5edad9..ccc6d7439df1 100644 --- a/clients/client-elastic-inference/README.md +++ b/clients/client-elastic-inference/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elastic-inference/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-inference) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elastic-inference.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-inference) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElasticInference Client for Node.js, Browser and React Native. + +

+Elastic Inference public APIs. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elastic-inference +using your favorite package manager: + +- `npm install @aws-sdk/client-elastic-inference` +- `yarn add @aws-sdk/client-elastic-inference` +- `pnpm add @aws-sdk/client-elastic-inference` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElasticInferenceClient` and +the commands you need, for example `DescribeAcceleratorOfferingsCommand`: + +```js +// ES5 example +const { ElasticInferenceClient, DescribeAcceleratorOfferingsCommand } = require("@aws-sdk/client-elastic-inference"); +``` + +```ts +// ES6+ example +import { ElasticInferenceClient, DescribeAcceleratorOfferingsCommand } from "@aws-sdk/client-elastic-inference"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElasticInferenceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeAcceleratorOfferingsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elastic-inference"; +const client = new AWS.ElasticInference({ region: "REGION" }); + +// async/await. +try { + const data = client.describeAcceleratorOfferings(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeAcceleratorOfferings(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeAcceleratorOfferings(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elastic-inference` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elastic-load-balancing-v2/README.md b/clients/client-elastic-load-balancing-v2/README.md index 5089ec800109..993b78168e19 100644 --- a/clients/client-elastic-load-balancing-v2/README.md +++ b/clients/client-elastic-load-balancing-v2/README.md @@ -3,4 +3,236 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elastic-load-balancing-v2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-load-balancing-v2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elastic-load-balancing-v2.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-load-balancing-v2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElasticLoadBalancingV2 Client for Node.js, Browser and React Native. + +Elastic Load Balancing + +

A load balancer distributes incoming traffic across targets, such as your EC2 +instances. This enables you to increase the availability of your application. The load +balancer also monitors the health of its registered targets and ensures that it routes traffic +only to healthy targets. You configure your load balancer to accept incoming traffic by +specifying one or more listeners, which are configured with a protocol and port number for +connections from clients to the load balancer. You configure a target group with a protocol +and port number for connections from the load balancer to the targets, and with health check +settings to be used when checking the health status of the targets.

+ +

Elastic Load Balancing supports the following types of load balancers: Application Load +Balancers, Network Load Balancers, Gateway Load Balancers, and Classic Load Balancers. +This reference covers the following load balancer types:

+ + +

For more information, see the Elastic Load Balancing User Guide.

+ +

All Elastic Load Balancing operations are idempotent, which means that they complete at +most one time. If you repeat an operation, it succeeds.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elastic-load-balancing-v2 +using your favorite package manager: + +- `npm install @aws-sdk/client-elastic-load-balancing-v2` +- `yarn add @aws-sdk/client-elastic-load-balancing-v2` +- `pnpm add @aws-sdk/client-elastic-load-balancing-v2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElasticLoadBalancingV2Client` and +the commands you need, for example `AddListenerCertificatesCommand`: + +```js +// ES5 example +const { + ElasticLoadBalancingV2Client, + AddListenerCertificatesCommand, +} = require("@aws-sdk/client-elastic-load-balancing-v2"); +``` + +```ts +// ES6+ example +import { + ElasticLoadBalancingV2Client, + AddListenerCertificatesCommand, +} from "@aws-sdk/client-elastic-load-balancing-v2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElasticLoadBalancingV2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddListenerCertificatesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elastic-load-balancing-v2"; +const client = new AWS.ElasticLoadBalancingV2({ region: "REGION" }); + +// async/await. +try { + const data = client.addListenerCertificates(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addListenerCertificates(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addListenerCertificates(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elastic-load-balancing-v2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elastic-load-balancing/README.md b/clients/client-elastic-load-balancing/README.md index ca5d4a6acdb8..1612f9d4a1f0 100644 --- a/clients/client-elastic-load-balancing/README.md +++ b/clients/client-elastic-load-balancing/README.md @@ -3,4 +3,221 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elastic-load-balancing/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-load-balancing) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elastic-load-balancing.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-load-balancing) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElasticLoadBalancing Client for Node.js, Browser and React Native. + +Elastic Load Balancing + +

A load balancer can distribute incoming traffic across your EC2 instances. +This enables you to increase the availability of your application. The load balancer +also monitors the health of its registered instances and ensures that it routes traffic +only to healthy instances. You configure your load balancer to accept incoming traffic +by specifying one or more listeners, which are configured with a protocol and port +number for connections from clients to the load balancer and a protocol and port number +for connections from the load balancer to the instances.

+

Elastic Load Balancing supports three types of load balancers: Application Load Balancers, Network Load Balancers, +and Classic Load Balancers. You can select a load balancer based on your application needs. For more +information, see the Elastic Load Balancing User Guide.

+

This reference covers the 2012-06-01 API, which supports Classic Load Balancers. +The 2015-12-01 API supports Application Load Balancers and Network Load Balancers.

+ +

To get started, create a load balancer with one or more listeners using CreateLoadBalancer. +Register your instances with the load balancer using RegisterInstancesWithLoadBalancer.

+ +

All Elastic Load Balancing operations are idempotent, which means +that they complete at most one time. If you repeat an operation, it succeeds with a 200 OK +response code.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elastic-load-balancing +using your favorite package manager: + +- `npm install @aws-sdk/client-elastic-load-balancing` +- `yarn add @aws-sdk/client-elastic-load-balancing` +- `pnpm add @aws-sdk/client-elastic-load-balancing` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElasticLoadBalancingClient` and +the commands you need, for example `AddTagsCommand`: + +```js +// ES5 example +const { ElasticLoadBalancingClient, AddTagsCommand } = require("@aws-sdk/client-elastic-load-balancing"); +``` + +```ts +// ES6+ example +import { ElasticLoadBalancingClient, AddTagsCommand } from "@aws-sdk/client-elastic-load-balancing"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElasticLoadBalancingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elastic-load-balancing"; +const client = new AWS.ElasticLoadBalancing({ region: "REGION" }); + +// async/await. +try { + const data = client.addTags(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTags(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTags(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elastic-load-balancing` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elastic-transcoder/README.md b/clients/client-elastic-transcoder/README.md index 0ee390f897d1..16628418f8e7 100644 --- a/clients/client-elastic-transcoder/README.md +++ b/clients/client-elastic-transcoder/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elastic-transcoder/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-transcoder) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elastic-transcoder.svg)](https://www.npmjs.com/package/@aws-sdk/client-elastic-transcoder) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElasticTranscoder Client for Node.js, Browser and React Native. + +AWS Elastic Transcoder Service + +

The AWS Elastic Transcoder Service.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elastic-transcoder +using your favorite package manager: + +- `npm install @aws-sdk/client-elastic-transcoder` +- `yarn add @aws-sdk/client-elastic-transcoder` +- `pnpm add @aws-sdk/client-elastic-transcoder` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElasticTranscoderClient` and +the commands you need, for example `CancelJobCommand`: + +```js +// ES5 example +const { ElasticTranscoderClient, CancelJobCommand } = require("@aws-sdk/client-elastic-transcoder"); +``` + +```ts +// ES6+ example +import { ElasticTranscoderClient, CancelJobCommand } from "@aws-sdk/client-elastic-transcoder"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElasticTranscoderClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelJobCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elastic-transcoder"; +const client = new AWS.ElasticTranscoder({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelJob(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelJob(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelJob(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elastic-transcoder` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elasticache/README.md b/clients/client-elasticache/README.md index ed250430bf9f..39c669088021 100644 --- a/clients/client-elasticache/README.md +++ b/clients/client-elasticache/README.md @@ -3,4 +3,211 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elasticache/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elasticache) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elasticache.svg)](https://www.npmjs.com/package/@aws-sdk/client-elasticache) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElastiCache Client for Node.js, Browser and React Native. + +Amazon ElastiCache + +

Amazon ElastiCache is a web service that makes it easier to set up, operate, +and scale a distributed cache in the cloud.

+

With ElastiCache, customers get all of the benefits of a high-performance, +in-memory cache with less of the administrative burden involved in launching and managing a distributed cache. +The service makes setup, scaling, +and cluster failure handling much simpler than in a self-managed cache deployment.

+

In addition, through integration with Amazon CloudWatch, +customers get enhanced visibility into the key performance statistics +associated with their cache and can receive alarms if a part of their cache runs hot.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elasticache +using your favorite package manager: + +- `npm install @aws-sdk/client-elasticache` +- `yarn add @aws-sdk/client-elasticache` +- `pnpm add @aws-sdk/client-elasticache` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElastiCacheClient` and +the commands you need, for example `AddTagsToResourceCommand`: + +```js +// ES5 example +const { ElastiCacheClient, AddTagsToResourceCommand } = require("@aws-sdk/client-elasticache"); +``` + +```ts +// ES6+ example +import { ElastiCacheClient, AddTagsToResourceCommand } from "@aws-sdk/client-elasticache"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElastiCacheClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToResourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elasticache"; +const client = new AWS.ElastiCache({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToResource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elasticache` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-elasticsearch-service/README.md b/clients/client-elasticsearch-service/README.md index 807b3a291334..36151a7e7961 100644 --- a/clients/client-elasticsearch-service/README.md +++ b/clients/client-elasticsearch-service/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-elasticsearch-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-elasticsearch-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-elasticsearch-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-elasticsearch-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ElasticsearchService Client for Node.js, Browser and React Native. + +Amazon Elasticsearch Configuration Service + +

Use the Amazon Elasticsearch Configuration API to create, configure, and manage Elasticsearch domains.

+

For sample code that uses the Configuration API, see the Amazon Elasticsearch Service Developer Guide. +The guide also contains sample code for sending signed HTTP requests to the Elasticsearch APIs.

+

The endpoint for configuration service requests is region-specific: es.region.amazonaws.com. +For example, es.us-east-1.amazonaws.com. For a current list of supported regions and endpoints, +see Regions and Endpoints.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-elasticsearch-service +using your favorite package manager: + +- `npm install @aws-sdk/client-elasticsearch-service` +- `yarn add @aws-sdk/client-elasticsearch-service` +- `pnpm add @aws-sdk/client-elasticsearch-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ElasticsearchServiceClient` and +the commands you need, for example `AcceptInboundCrossClusterSearchConnectionCommand`: + +```js +// ES5 example +const { + ElasticsearchServiceClient, + AcceptInboundCrossClusterSearchConnectionCommand, +} = require("@aws-sdk/client-elasticsearch-service"); +``` + +```ts +// ES6+ example +import { + ElasticsearchServiceClient, + AcceptInboundCrossClusterSearchConnectionCommand, +} from "@aws-sdk/client-elasticsearch-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ElasticsearchServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptInboundCrossClusterSearchConnectionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-elasticsearch-service"; +const client = new AWS.ElasticsearchService({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptInboundCrossClusterSearchConnection(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptInboundCrossClusterSearchConnection(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptInboundCrossClusterSearchConnection(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-elasticsearch-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-emr-containers/README.md b/clients/client-emr-containers/README.md index 29701f3d1c7f..a6091cef9957 100644 --- a/clients/client-emr-containers/README.md +++ b/clients/client-emr-containers/README.md @@ -3,4 +3,222 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-emr-containers/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-emr-containers) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-emr-containers.svg)](https://www.npmjs.com/package/@aws-sdk/client-emr-containers) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EMRContainers Client for Node.js, Browser and React Native. + +

Amazon EMR on EKS provides a deployment option for Amazon EMR that allows you to run +open-source big data frameworks on Amazon Elastic Kubernetes Service (Amazon EKS). With +this deployment option, you can focus on running analytics workloads while Amazon EMR on +EKS builds, configures, and manages containers for open-source applications. For more +information about Amazon EMR on EKS concepts and tasks, see What is Amazon EMR on EKS.

+

+Amazon EMR containers is the API name for Amazon EMR on EKS. The +emr-containers prefix is used in the following scenarios:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-emr-containers +using your favorite package manager: + +- `npm install @aws-sdk/client-emr-containers` +- `yarn add @aws-sdk/client-emr-containers` +- `pnpm add @aws-sdk/client-emr-containers` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EMRContainersClient` and +the commands you need, for example `CancelJobRunCommand`: + +```js +// ES5 example +const { EMRContainersClient, CancelJobRunCommand } = require("@aws-sdk/client-emr-containers"); +``` + +```ts +// ES6+ example +import { EMRContainersClient, CancelJobRunCommand } from "@aws-sdk/client-emr-containers"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EMRContainersClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelJobRunCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-emr-containers"; +const client = new AWS.EMRContainers({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelJobRun(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelJobRun(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelJobRun(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-emr-containers` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-emr/README.md b/clients/client-emr/README.md index e8498d9294a6..a1957c0b3ae9 100644 --- a/clients/client-emr/README.md +++ b/clients/client-emr/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-emr/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-emr) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-emr.svg)](https://www.npmjs.com/package/@aws-sdk/client-emr) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EMR Client for Node.js, Browser and React Native. + +

Amazon EMR is a web service that makes it easier to process large amounts of data +efficiently. Amazon EMR uses Hadoop processing combined with several AWS services to do +tasks such as web indexing, data mining, log file analysis, machine learning, scientific +simulation, and data warehouse management.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-emr +using your favorite package manager: + +- `npm install @aws-sdk/client-emr` +- `yarn add @aws-sdk/client-emr` +- `pnpm add @aws-sdk/client-emr` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EMRClient` and +the commands you need, for example `AddInstanceFleetCommand`: + +```js +// ES5 example +const { EMRClient, AddInstanceFleetCommand } = require("@aws-sdk/client-emr"); +``` + +```ts +// ES6+ example +import { EMRClient, AddInstanceFleetCommand } from "@aws-sdk/client-emr"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EMRClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddInstanceFleetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-emr"; +const client = new AWS.EMR({ region: "REGION" }); + +// async/await. +try { + const data = client.addInstanceFleet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addInstanceFleet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addInstanceFleet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-emr` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-eventbridge/README.md b/clients/client-eventbridge/README.md index 495197ac34a3..0dd019ca7367 100644 --- a/clients/client-eventbridge/README.md +++ b/clients/client-eventbridge/README.md @@ -3,4 +3,222 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-eventbridge/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-eventbridge) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-eventbridge.svg)](https://www.npmjs.com/package/@aws-sdk/client-eventbridge) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EventBridge Client for Node.js, Browser and React Native. + +

Amazon EventBridge helps you to respond to state changes in your AWS resources. +When your resources change state, they automatically send events into an event stream. +You can create rules that match selected events in the stream and route them to targets +to take action. You can also use rules to take action on a predetermined schedule. For +example, you can configure rules to:

+ +

For more information about the features of Amazon EventBridge, see the Amazon EventBridge User +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-eventbridge +using your favorite package manager: + +- `npm install @aws-sdk/client-eventbridge` +- `yarn add @aws-sdk/client-eventbridge` +- `pnpm add @aws-sdk/client-eventbridge` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EventBridgeClient` and +the commands you need, for example `ActivateEventSourceCommand`: + +```js +// ES5 example +const { EventBridgeClient, ActivateEventSourceCommand } = require("@aws-sdk/client-eventbridge"); +``` + +```ts +// ES6+ example +import { EventBridgeClient, ActivateEventSourceCommand } from "@aws-sdk/client-eventbridge"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EventBridgeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ActivateEventSourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-eventbridge"; +const client = new AWS.EventBridge({ region: "REGION" }); + +// async/await. +try { + const data = client.activateEventSource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .activateEventSource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.activateEventSource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-eventbridge` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-firehose/README.md b/clients/client-firehose/README.md index 665c85557817..6f55fff14d4e 100644 --- a/clients/client-firehose/README.md +++ b/clients/client-firehose/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-firehose/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-firehose) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-firehose.svg)](https://www.npmjs.com/package/@aws-sdk/client-firehose) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Firehose Client for Node.js, Browser and React Native. + +Amazon Kinesis Data Firehose API Reference + +

Amazon Kinesis Data Firehose is a fully managed service that delivers real-time +streaming data to destinations such as Amazon Simple Storage Service (Amazon S3), Amazon +Elasticsearch Service (Amazon ES), Amazon Redshift, and Splunk.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-firehose +using your favorite package manager: + +- `npm install @aws-sdk/client-firehose` +- `yarn add @aws-sdk/client-firehose` +- `pnpm add @aws-sdk/client-firehose` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `FirehoseClient` and +the commands you need, for example `CreateDeliveryStreamCommand`: + +```js +// ES5 example +const { FirehoseClient, CreateDeliveryStreamCommand } = require("@aws-sdk/client-firehose"); +``` + +```ts +// ES6+ example +import { FirehoseClient, CreateDeliveryStreamCommand } from "@aws-sdk/client-firehose"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new FirehoseClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDeliveryStreamCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-firehose"; +const client = new AWS.Firehose({ region: "REGION" }); + +// async/await. +try { + const data = client.createDeliveryStream(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDeliveryStream(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDeliveryStream(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-firehose` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-fms/README.md b/clients/client-fms/README.md index e490922488c7..8462bf35d13e 100644 --- a/clients/client-fms/README.md +++ b/clients/client-fms/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-fms/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-fms) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-fms.svg)](https://www.npmjs.com/package/@aws-sdk/client-fms) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript FMS Client for Node.js, Browser and React Native. + +AWS Firewall Manager + +

This is the AWS Firewall Manager API Reference. This guide is for +developers who need detailed information about the AWS Firewall Manager API actions, data +types, and errors. For detailed information about AWS Firewall Manager features, see the +AWS Firewall Manager Developer Guide.

+

Some API actions require explicit resource permissions. For information, see the developer guide topic +Firewall Manager required permissions for API actions. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-fms +using your favorite package manager: + +- `npm install @aws-sdk/client-fms` +- `yarn add @aws-sdk/client-fms` +- `pnpm add @aws-sdk/client-fms` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `FMSClient` and +the commands you need, for example `AssociateAdminAccountCommand`: + +```js +// ES5 example +const { FMSClient, AssociateAdminAccountCommand } = require("@aws-sdk/client-fms"); +``` + +```ts +// ES6+ example +import { FMSClient, AssociateAdminAccountCommand } from "@aws-sdk/client-fms"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new FMSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateAdminAccountCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-fms"; +const client = new AWS.FMS({ region: "REGION" }); + +// async/await. +try { + const data = client.associateAdminAccount(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateAdminAccount(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateAdminAccount(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-fms` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-forecast/README.md b/clients/client-forecast/README.md index 51a36c4c2ae3..33ea35c274fd 100644 --- a/clients/client-forecast/README.md +++ b/clients/client-forecast/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-forecast/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-forecast) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-forecast.svg)](https://www.npmjs.com/package/@aws-sdk/client-forecast) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Forecast Client for Node.js, Browser and React Native. + +

Provides APIs for creating and managing Amazon Forecast resources.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-forecast +using your favorite package manager: + +- `npm install @aws-sdk/client-forecast` +- `yarn add @aws-sdk/client-forecast` +- `pnpm add @aws-sdk/client-forecast` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ForecastClient` and +the commands you need, for example `CreateDatasetCommand`: + +```js +// ES5 example +const { ForecastClient, CreateDatasetCommand } = require("@aws-sdk/client-forecast"); +``` + +```ts +// ES6+ example +import { ForecastClient, CreateDatasetCommand } from "@aws-sdk/client-forecast"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ForecastClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDatasetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-forecast"; +const client = new AWS.Forecast({ region: "REGION" }); + +// async/await. +try { + const data = client.createDataset(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDataset(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDataset(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-forecast` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-forecastquery/README.md b/clients/client-forecastquery/README.md index 2a92d265d1d1..2a316249dccd 100644 --- a/clients/client-forecastquery/README.md +++ b/clients/client-forecastquery/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-forecastquery/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-forecastquery) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-forecastquery.svg)](https://www.npmjs.com/package/@aws-sdk/client-forecastquery) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Forecastquery Client for Node.js, Browser and React Native. + +

Provides APIs for creating and managing Amazon Forecast resources.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-forecastquery +using your favorite package manager: + +- `npm install @aws-sdk/client-forecastquery` +- `yarn add @aws-sdk/client-forecastquery` +- `pnpm add @aws-sdk/client-forecastquery` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ForecastqueryClient` and +the commands you need, for example `QueryForecastCommand`: + +```js +// ES5 example +const { ForecastqueryClient, QueryForecastCommand } = require("@aws-sdk/client-forecastquery"); +``` + +```ts +// ES6+ example +import { ForecastqueryClient, QueryForecastCommand } from "@aws-sdk/client-forecastquery"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ForecastqueryClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new QueryForecastCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-forecastquery"; +const client = new AWS.Forecastquery({ region: "REGION" }); + +// async/await. +try { + const data = client.queryForecast(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .queryForecast(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.queryForecast(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-forecastquery` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-frauddetector/README.md b/clients/client-frauddetector/README.md index 666fa42de2d5..8421c43dfa0a 100644 --- a/clients/client-frauddetector/README.md +++ b/clients/client-frauddetector/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-frauddetector/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-frauddetector) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-frauddetector.svg)](https://www.npmjs.com/package/@aws-sdk/client-frauddetector) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript FraudDetector Client for Node.js, Browser and React Native. + +

This is the Amazon Fraud Detector API Reference. This guide is for developers who need +detailed information about Amazon Fraud Detector API actions, data types, and errors. For +more information about Amazon Fraud Detector features, see the Amazon Fraud Detector User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-frauddetector +using your favorite package manager: + +- `npm install @aws-sdk/client-frauddetector` +- `yarn add @aws-sdk/client-frauddetector` +- `pnpm add @aws-sdk/client-frauddetector` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `FraudDetectorClient` and +the commands you need, for example `BatchCreateVariableCommand`: + +```js +// ES5 example +const { FraudDetectorClient, BatchCreateVariableCommand } = require("@aws-sdk/client-frauddetector"); +``` + +```ts +// ES6+ example +import { FraudDetectorClient, BatchCreateVariableCommand } from "@aws-sdk/client-frauddetector"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new FraudDetectorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchCreateVariableCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-frauddetector"; +const client = new AWS.FraudDetector({ region: "REGION" }); + +// async/await. +try { + const data = client.batchCreateVariable(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchCreateVariable(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchCreateVariable(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-frauddetector` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-fsx/README.md b/clients/client-fsx/README.md index 0c2de2db1635..bafca0024a9b 100644 --- a/clients/client-fsx/README.md +++ b/clients/client-fsx/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-fsx/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-fsx) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-fsx.svg)](https://www.npmjs.com/package/@aws-sdk/client-fsx) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript FSx Client for Node.js, Browser and React Native. + +

Amazon FSx is a fully managed service that makes it easy for storage and +application administrators to launch and use shared file storage.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-fsx +using your favorite package manager: + +- `npm install @aws-sdk/client-fsx` +- `yarn add @aws-sdk/client-fsx` +- `pnpm add @aws-sdk/client-fsx` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `FSxClient` and +the commands you need, for example `AssociateFileSystemAliasesCommand`: + +```js +// ES5 example +const { FSxClient, AssociateFileSystemAliasesCommand } = require("@aws-sdk/client-fsx"); +``` + +```ts +// ES6+ example +import { FSxClient, AssociateFileSystemAliasesCommand } from "@aws-sdk/client-fsx"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new FSxClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateFileSystemAliasesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-fsx"; +const client = new AWS.FSx({ region: "REGION" }); + +// async/await. +try { + const data = client.associateFileSystemAliases(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateFileSystemAliases(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateFileSystemAliases(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-fsx` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-gamelift/README.md b/clients/client-gamelift/README.md index 006d39c75542..aaa9c67e8605 100644 --- a/clients/client-gamelift/README.md +++ b/clients/client-gamelift/README.md @@ -3,4 +3,252 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-gamelift/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-gamelift) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-gamelift.svg)](https://www.npmjs.com/package/@aws-sdk/client-gamelift) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript GameLift Client for Node.js, Browser and React Native. + +Amazon GameLift Service + +

GameLift provides solutions for hosting session-based multiplayer game servers in the +cloud, including tools for deploying, operating, and scaling game servers. Built on AWS +global computing infrastructure, GameLift helps you deliver high-performance, +high-reliability, low-cost game servers while dynamically scaling your resource usage to +meet player demand.

+

+About GameLift solutions +

+

Get more information on these GameLift solutions in the Amazon GameLift Developer Guide.

+ +

+About this API Reference +

+

This reference guide describes the low-level service API for Amazon GameLift. You can find +links to language-specific SDK guides and the AWS CLI reference with each operation and +data type topic. Useful links:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-gamelift +using your favorite package manager: + +- `npm install @aws-sdk/client-gamelift` +- `yarn add @aws-sdk/client-gamelift` +- `pnpm add @aws-sdk/client-gamelift` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GameLiftClient` and +the commands you need, for example `AcceptMatchCommand`: + +```js +// ES5 example +const { GameLiftClient, AcceptMatchCommand } = require("@aws-sdk/client-gamelift"); +``` + +```ts +// ES6+ example +import { GameLiftClient, AcceptMatchCommand } from "@aws-sdk/client-gamelift"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GameLiftClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptMatchCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-gamelift"; +const client = new AWS.GameLift({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptMatch(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptMatch(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptMatch(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-gamelift` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-glacier/README.md b/clients/client-glacier/README.md index 81aadc6c2f62..a832597a7d1a 100644 --- a/clients/client-glacier/README.md +++ b/clients/client-glacier/README.md @@ -3,4 +3,238 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-glacier/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-glacier) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-glacier.svg)](https://www.npmjs.com/package/@aws-sdk/client-glacier) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Glacier Client for Node.js, Browser and React Native. + +

Amazon S3 Glacier (Glacier) is a storage solution for "cold data."

+ +

Glacier is an extremely low-cost storage service that provides secure, +durable, and easy-to-use storage for data backup and archival. With Glacier, +customers can store their data cost effectively for months, years, or decades. +Glacier also enables customers to offload the administrative burdens of operating and +scaling storage to AWS, so they don't have to worry about capacity planning, hardware +provisioning, data replication, hardware failure and recovery, or time-consuming hardware +migrations.

+ +

Glacier is a great storage choice when low storage cost is paramount and your +data is rarely retrieved. If your +application requires fast or frequent access to your data, consider using Amazon S3. For +more information, see Amazon Simple Storage Service +(Amazon S3).

+ +

You can store any kind of data in any format. There is no maximum limit on the total +amount of data you can store in Glacier.

+ +

If you are a first-time user of Glacier, we recommend that you begin by +reading the following sections in the Amazon S3 Glacier Developer +Guide:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-glacier +using your favorite package manager: + +- `npm install @aws-sdk/client-glacier` +- `yarn add @aws-sdk/client-glacier` +- `pnpm add @aws-sdk/client-glacier` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GlacierClient` and +the commands you need, for example `AbortMultipartUploadCommand`: + +```js +// ES5 example +const { GlacierClient, AbortMultipartUploadCommand } = require("@aws-sdk/client-glacier"); +``` + +```ts +// ES6+ example +import { GlacierClient, AbortMultipartUploadCommand } from "@aws-sdk/client-glacier"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GlacierClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AbortMultipartUploadCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-glacier"; +const client = new AWS.Glacier({ region: "REGION" }); + +// async/await. +try { + const data = client.abortMultipartUpload(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .abortMultipartUpload(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.abortMultipartUpload(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-glacier` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-global-accelerator/README.md b/clients/client-global-accelerator/README.md index ab26a065b2dc..d11bb3cc97ff 100644 --- a/clients/client-global-accelerator/README.md +++ b/clients/client-global-accelerator/README.md @@ -3,4 +3,349 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-global-accelerator/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-global-accelerator) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-global-accelerator.svg)](https://www.npmjs.com/package/@aws-sdk/client-global-accelerator) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript GlobalAccelerator Client for Node.js, Browser and React Native. + +AWS Global Accelerator + +

This is the AWS Global Accelerator API Reference. This guide is for developers who need detailed information about +AWS Global Accelerator API actions, data types, and errors. For more information about Global Accelerator features, see the +AWS Global Accelerator Developer Guide.

+ +

AWS Global Accelerator is a service in which you create accelerators to improve the performance +of your applications for local and global users. Depending on the type of accelerator you choose, you can +gain additional benefits.

+ + +

Global Accelerator is a global service that supports endpoints in multiple AWS Regions but you must specify the +US West (Oregon) Region to create or update accelerators.

+
+

By default, Global Accelerator provides you with two static IP addresses that you associate with your accelerator. With +a standard accelerator, instead of using the +IP addresses that Global Accelerator provides, you can configure these entry points to be IPv4 addresses from your own IP address ranges +that you bring to Global Accelerator. The static IP addresses are anycast from the AWS edge network. For a standard accelerator, +they distribute incoming application traffic across multiple endpoint resources in multiple AWS Regions, which increases +the availability of your applications. Endpoints for standard accelerators can be Network Load Balancers, Application Load Balancers, +Amazon EC2 instances, or Elastic IP addresses that are located in one AWS Region or multiple Regions. For custom routing +accelerators, you map traffic that arrives to the static IP addresses to specific Amazon EC2 servers in endpoints that +are virtual private cloud (VPC) subnets.

+ + +

The static IP addresses remain assigned to your accelerator for as long as it exists, even if you +disable the accelerator and it no longer accepts or routes traffic. However, when you +delete an accelerator, you lose the static IP addresses that +are assigned to it, so you can no longer route traffic by using them. You can use +IAM policies like tag-based permissions with Global Accelerator to limit the users who have +permissions to delete an accelerator. For more information, see Tag-based policies.

+
+

For standard accelerators, Global Accelerator uses the AWS global network to route traffic to the optimal regional endpoint based +on health, client location, and policies that you configure. The service reacts instantly to +changes in health or configuration to ensure that internet traffic from clients is always +directed to healthy endpoints.

+ +

For a list of the AWS Regions where Global Accelerator and other services are currently supported, see the +AWS +Region Table.

+ +

AWS Global Accelerator includes the following components:

+
+
Static IP addresses
+
+

Global Accelerator provides you with a set of two static IP addresses that are anycast from the AWS edge +network. If you bring your own IP address range to AWS (BYOIP) to use with a standard accelerator, you +can instead assign IP addresses from your own pool to use with your accelerator. For more information, +see +Bring your own IP addresses (BYOIP) in AWS Global Accelerator.

+

The IP addresses serve as single fixed entry points for your clients. If you already have Elastic +Load Balancing load balancers, Amazon EC2 instances, or Elastic IP address resources set up for your applications, +you can easily add those to a standard accelerator in Global Accelerator. This allows Global Accelerator to use static IP addresses +to access the resources.

+

The static IP addresses remain assigned to your accelerator for as long as it exists, even +if you disable the accelerator and it no longer accepts or routes traffic. +However, when you delete an accelerator, you lose the +static IP addresses that are assigned to it, so you can no longer route +traffic by using them. You can use IAM policies like tag-based permissions +with Global Accelerator to delete an accelerator. For more information, see Tag-based policies.

+
+
Accelerator
+
+

An accelerator directs traffic to endpoints over the AWS global network to improve the +performance of your internet applications. Each accelerator includes one or more listeners.

+

There are two types of accelerators:

+ +

For more information, see Types of accelerators.

+
+
DNS name
+
+

Global Accelerator assigns each accelerator a default Domain Name System (DNS) name, similar to +a1234567890abcdef.awsglobalaccelerator.com, that points to +the static IP addresses that Global Accelerator assigns to you or that you choose from your +own IP address range. Depending on the use +case, you can use your accelerator's static IP addresses or DNS name to +route traffic to your accelerator, or set up DNS records to route traffic using +your own custom domain name.

+
+
Network zone
+
+

A network zone services the static IP addresses for your accelerator from a unique IP subnet. Similar to an +AWS Availability Zone, a network zone is an isolated unit with its own set of physical infrastructure. +When you configure an accelerator, by default, Global Accelerator allocates two IPv4 addresses for it. If one IP address from a +network zone becomes unavailable due to IP address blocking by certain client networks, or network +disruptions, then client applications can retry on the healthy static IP address from the other isolated +network zone.

+
+
Listener
+
+

A listener processes inbound connections from clients to Global Accelerator, based on the port (or port range) +and protocol (or protocols) that you configure. A listener can be configured for TCP, UDP, or both TCP and UDP protocols. Each +listener has one or more endpoint groups associated with it, and traffic is forwarded +to endpoints in one of the groups. You associate endpoint groups with listeners by specifying the Regions that you +want to distribute traffic to. With a standard accelerator, traffic is distributed to optimal endpoints within the endpoint +groups associated with a listener.

+
+
Endpoint group
+
+

Each endpoint group is associated with a specific AWS Region. Endpoint groups include one or +more endpoints in the Region. With a standard accelerator, you can increase or reduce the percentage of +traffic that would be otherwise directed to an endpoint group by adjusting a +setting called a traffic dial. The traffic dial lets +you easily do performance testing or blue/green deployment testing, for example, for new +releases across different AWS Regions.

+
+
Endpoint
+
+

An endpoint is a resource that Global Accelerator directs traffic to.

+

Endpoints for standard accelerators can be Network Load Balancers, Application Load Balancers, Amazon EC2 instances, or Elastic IP +addresses. An Application Load Balancer endpoint can be internet-facing or internal. Traffic for +standard accelerators is routed to endpoints based on the health of the +endpoint along with configuration options that you choose, such as endpoint +weights. For each endpoint, you can configure weights, which are numbers +that you can use to specify the proportion of traffic to route to each one. +This can be useful, for example, to do performance testing within a +Region.

+

Endpoints for custom routing accelerators are virtual private cloud (VPC) subnets with one +or many EC2 instances.

+
+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-global-accelerator +using your favorite package manager: + +- `npm install @aws-sdk/client-global-accelerator` +- `yarn add @aws-sdk/client-global-accelerator` +- `pnpm add @aws-sdk/client-global-accelerator` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GlobalAcceleratorClient` and +the commands you need, for example `AddCustomRoutingEndpointsCommand`: + +```js +// ES5 example +const { GlobalAcceleratorClient, AddCustomRoutingEndpointsCommand } = require("@aws-sdk/client-global-accelerator"); +``` + +```ts +// ES6+ example +import { GlobalAcceleratorClient, AddCustomRoutingEndpointsCommand } from "@aws-sdk/client-global-accelerator"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GlobalAcceleratorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddCustomRoutingEndpointsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-global-accelerator"; +const client = new AWS.GlobalAccelerator({ region: "REGION" }); + +// async/await. +try { + const data = client.addCustomRoutingEndpoints(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addCustomRoutingEndpoints(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addCustomRoutingEndpoints(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-global-accelerator` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-glue/README.md b/clients/client-glue/README.md index dbfb43078a8e..f7f493c276c3 100644 --- a/clients/client-glue/README.md +++ b/clients/client-glue/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-glue/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-glue) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-glue.svg)](https://www.npmjs.com/package/@aws-sdk/client-glue) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Glue Client for Node.js, Browser and React Native. + +AWS Glue + +

Defines the public endpoint for the AWS Glue service.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-glue +using your favorite package manager: + +- `npm install @aws-sdk/client-glue` +- `yarn add @aws-sdk/client-glue` +- `pnpm add @aws-sdk/client-glue` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GlueClient` and +the commands you need, for example `BatchCreatePartitionCommand`: + +```js +// ES5 example +const { GlueClient, BatchCreatePartitionCommand } = require("@aws-sdk/client-glue"); +``` + +```ts +// ES6+ example +import { GlueClient, BatchCreatePartitionCommand } from "@aws-sdk/client-glue"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GlueClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchCreatePartitionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-glue"; +const client = new AWS.Glue({ region: "REGION" }); + +// async/await. +try { + const data = client.batchCreatePartition(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchCreatePartition(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchCreatePartition(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-glue` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-greengrass/README.md b/clients/client-greengrass/README.md index 0ef1b851790c..9c3e0c2f0290 100644 --- a/clients/client-greengrass/README.md +++ b/clients/client-greengrass/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-greengrass/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-greengrass) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-greengrass.svg)](https://www.npmjs.com/package/@aws-sdk/client-greengrass) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Greengrass Client for Node.js, Browser and React Native. + +AWS IoT Greengrass seamlessly extends AWS onto physical devices so they can act locally on the data they generate, while still using the cloud for management, analytics, and durable storage. AWS IoT Greengrass ensures your devices can respond quickly to local events and operate with intermittent connectivity. AWS IoT Greengrass minimizes the cost of transmitting data to the cloud by allowing you to author AWS Lambda functions that execute locally. + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-greengrass +using your favorite package manager: + +- `npm install @aws-sdk/client-greengrass` +- `yarn add @aws-sdk/client-greengrass` +- `pnpm add @aws-sdk/client-greengrass` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GreengrassClient` and +the commands you need, for example `AssociateRoleToGroupCommand`: + +```js +// ES5 example +const { GreengrassClient, AssociateRoleToGroupCommand } = require("@aws-sdk/client-greengrass"); +``` + +```ts +// ES6+ example +import { GreengrassClient, AssociateRoleToGroupCommand } from "@aws-sdk/client-greengrass"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GreengrassClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateRoleToGroupCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-greengrass"; +const client = new AWS.Greengrass({ region: "REGION" }); + +// async/await. +try { + const data = client.associateRoleToGroup(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateRoleToGroup(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateRoleToGroup(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-greengrass` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-groundstation/README.md b/clients/client-groundstation/README.md index db704e101722..b1abe84ba1e9 100644 --- a/clients/client-groundstation/README.md +++ b/clients/client-groundstation/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-groundstation/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-groundstation) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-groundstation.svg)](https://www.npmjs.com/package/@aws-sdk/client-groundstation) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript GroundStation Client for Node.js, Browser and React Native. + +

Welcome to the AWS Ground Station API Reference. AWS Ground Station is a fully managed service that +enables you to control satellite communications, downlink and process satellite data, and +scale your satellite operations efficiently and cost-effectively without having +to build or manage your own ground station infrastructure.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-groundstation +using your favorite package manager: + +- `npm install @aws-sdk/client-groundstation` +- `yarn add @aws-sdk/client-groundstation` +- `pnpm add @aws-sdk/client-groundstation` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GroundStationClient` and +the commands you need, for example `CancelContactCommand`: + +```js +// ES5 example +const { GroundStationClient, CancelContactCommand } = require("@aws-sdk/client-groundstation"); +``` + +```ts +// ES6+ example +import { GroundStationClient, CancelContactCommand } from "@aws-sdk/client-groundstation"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GroundStationClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelContactCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-groundstation"; +const client = new AWS.GroundStation({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelContact(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelContact(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelContact(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-groundstation` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-guardduty/README.md b/clients/client-guardduty/README.md index 1b9295bb835f..fffcd7b561f3 100644 --- a/clients/client-guardduty/README.md +++ b/clients/client-guardduty/README.md @@ -3,4 +3,217 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-guardduty/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-guardduty) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-guardduty.svg)](https://www.npmjs.com/package/@aws-sdk/client-guardduty) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript GuardDuty Client for Node.js, Browser and React Native. + +

Amazon GuardDuty is a continuous security monitoring service that analyzes and processes +the following data sources: VPC Flow Logs, AWS CloudTrail event logs, and DNS logs. It uses +threat intelligence feeds (such as lists of malicious IPs and domains) and machine learning to +identify unexpected, potentially unauthorized, and malicious activity within your AWS +environment. This can include issues like escalations of privileges, uses of exposed +credentials, or communication with malicious IPs, URLs, or domains. For example, GuardDuty can +detect compromised EC2 instances that serve malware or mine bitcoin.

+

GuardDuty also monitors AWS account access behavior for signs of compromise. Some examples +of this are unauthorized infrastructure deployments such as EC2 instances deployed in a Region +that has never been used, or unusual API calls like a password policy change to reduce +password strength.

+

GuardDuty informs you of the status of your AWS environment by producing security findings +that you can view in the GuardDuty console or through Amazon CloudWatch events. For more +information, see the +Amazon +GuardDuty User Guide +.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-guardduty +using your favorite package manager: + +- `npm install @aws-sdk/client-guardduty` +- `yarn add @aws-sdk/client-guardduty` +- `pnpm add @aws-sdk/client-guardduty` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `GuardDutyClient` and +the commands you need, for example `AcceptInvitationCommand`: + +```js +// ES5 example +const { GuardDutyClient, AcceptInvitationCommand } = require("@aws-sdk/client-guardduty"); +``` + +```ts +// ES6+ example +import { GuardDutyClient, AcceptInvitationCommand } from "@aws-sdk/client-guardduty"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new GuardDutyClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptInvitationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-guardduty"; +const client = new AWS.GuardDuty({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptInvitation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptInvitation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptInvitation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-guardduty` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-health/README.md b/clients/client-health/README.md index 9ceefa081ca5..0a49f32b5014 100644 --- a/clients/client-health/README.md +++ b/clients/client-health/README.md @@ -3,4 +3,238 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-health/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-health) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-health.svg)](https://www.npmjs.com/package/@aws-sdk/client-health) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Health Client for Node.js, Browser and React Native. + +AWS Health + +

The AWS Health API provides programmatic access to the AWS Health information that +appears in the AWS Personal Health Dashboard. You +can use the API operations to get information about AWS Health events that affect your +AWS services and resources.

+ +

You must have a Business or Enterprise support plan from AWS Support to use the AWS Health API. If you call the +AWS Health API from an AWS account that doesn't have a Business or Enterprise support +plan, you receive a SubscriptionRequiredException error.

+
+

AWS Health has a single endpoint: health.us-east-1.amazonaws.com (HTTPS). Use this +endpoint to call the AWS Health API operations.

+

For authentication of requests, AWS Health uses the Signature Version 4 Signing +Process.

+

If your AWS account is part of AWS Organizations, you can use the AWS Health organizational +view feature. This feature provides a centralized view of AWS Health events across all +accounts in your organization. You can aggregate AWS Health events in real time to +identify accounts in your organization that are affected by an operational event or get +notified of security vulnerabilities. Use the organizational view API operations to enable +this feature and return event information. For more information, see Aggregating +AWS Health events in the AWS Health User Guide.

+ +

When you use the AWS Health API operations to return AWS Health events, see the +following recommendations:

+ +
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-health +using your favorite package manager: + +- `npm install @aws-sdk/client-health` +- `yarn add @aws-sdk/client-health` +- `pnpm add @aws-sdk/client-health` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `HealthClient` and +the commands you need, for example `DescribeAffectedAccountsForOrganizationCommand`: + +```js +// ES5 example +const { HealthClient, DescribeAffectedAccountsForOrganizationCommand } = require("@aws-sdk/client-health"); +``` + +```ts +// ES6+ example +import { HealthClient, DescribeAffectedAccountsForOrganizationCommand } from "@aws-sdk/client-health"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new HealthClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeAffectedAccountsForOrganizationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-health"; +const client = new AWS.Health({ region: "REGION" }); + +// async/await. +try { + const data = client.describeAffectedAccountsForOrganization(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeAffectedAccountsForOrganization(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeAffectedAccountsForOrganization(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-health` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-healthlake/README.md b/clients/client-healthlake/README.md index de10b4393dea..6fb5136f8a60 100644 --- a/clients/client-healthlake/README.md +++ b/clients/client-healthlake/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-healthlake/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-healthlake) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-healthlake.svg)](https://www.npmjs.com/package/@aws-sdk/client-healthlake) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript HealthLake Client for Node.js, Browser and React Native. + +

Amazon HealthLake is a HIPAA eligibile service that allows customers to store, +transform, query, and analyze their data in a consistent fashion in the cloud.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-healthlake +using your favorite package manager: + +- `npm install @aws-sdk/client-healthlake` +- `yarn add @aws-sdk/client-healthlake` +- `pnpm add @aws-sdk/client-healthlake` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `HealthLakeClient` and +the commands you need, for example `CreateFHIRDatastoreCommand`: + +```js +// ES5 example +const { HealthLakeClient, CreateFHIRDatastoreCommand } = require("@aws-sdk/client-healthlake"); +``` + +```ts +// ES6+ example +import { HealthLakeClient, CreateFHIRDatastoreCommand } from "@aws-sdk/client-healthlake"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new HealthLakeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateFHIRDatastoreCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-healthlake"; +const client = new AWS.HealthLake({ region: "REGION" }); + +// async/await. +try { + const data = client.createFHIRDatastore(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createFHIRDatastore(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createFHIRDatastore(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-healthlake` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-honeycode/README.md b/clients/client-honeycode/README.md index 4aaf99e7f0b9..869fde131715 100644 --- a/clients/client-honeycode/README.md +++ b/clients/client-honeycode/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-honeycode/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-honeycode) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-honeycode.svg)](https://www.npmjs.com/package/@aws-sdk/client-honeycode) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Honeycode Client for Node.js, Browser and React Native. + +

+Amazon Honeycode is a fully managed service that allows you to quickly build mobile and web apps for teams—without +programming. Build Honeycode apps for managing almost anything, like projects, customers, operations, approvals, +resources, and even your team. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-honeycode +using your favorite package manager: + +- `npm install @aws-sdk/client-honeycode` +- `yarn add @aws-sdk/client-honeycode` +- `pnpm add @aws-sdk/client-honeycode` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `HoneycodeClient` and +the commands you need, for example `BatchCreateTableRowsCommand`: + +```js +// ES5 example +const { HoneycodeClient, BatchCreateTableRowsCommand } = require("@aws-sdk/client-honeycode"); +``` + +```ts +// ES6+ example +import { HoneycodeClient, BatchCreateTableRowsCommand } from "@aws-sdk/client-honeycode"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new HoneycodeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchCreateTableRowsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-honeycode"; +const client = new AWS.Honeycode({ region: "REGION" }); + +// async/await. +try { + const data = client.batchCreateTableRows(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchCreateTableRows(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchCreateTableRows(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-honeycode` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iam/README.md b/clients/client-iam/README.md index 5d9a77546a1c..8d40d54de487 100644 --- a/clients/client-iam/README.md +++ b/clients/client-iam/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iam/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iam) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iam.svg)](https://www.npmjs.com/package/@aws-sdk/client-iam) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IAM Client for Node.js, Browser and React Native. + +AWS Identity and Access Management + +

AWS Identity and Access Management (IAM) is a web service for securely controlling +access to AWS services. With IAM, you can centrally manage users, security credentials +such as access keys, and permissions that control which AWS resources users and +applications can access. For more information about IAM, see AWS Identity and Access Management (IAM) and the AWS Identity and Access Management User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iam +using your favorite package manager: + +- `npm install @aws-sdk/client-iam` +- `yarn add @aws-sdk/client-iam` +- `pnpm add @aws-sdk/client-iam` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IAMClient` and +the commands you need, for example `AddClientIDToOpenIDConnectProviderCommand`: + +```js +// ES5 example +const { IAMClient, AddClientIDToOpenIDConnectProviderCommand } = require("@aws-sdk/client-iam"); +``` + +```ts +// ES6+ example +import { IAMClient, AddClientIDToOpenIDConnectProviderCommand } from "@aws-sdk/client-iam"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IAMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddClientIDToOpenIDConnectProviderCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iam"; +const client = new AWS.IAM({ region: "REGION" }); + +// async/await. +try { + const data = client.addClientIDToOpenIDConnectProvider(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addClientIDToOpenIDConnectProvider(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addClientIDToOpenIDConnectProvider(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iam` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-identitystore/README.md b/clients/client-identitystore/README.md index a91c6553ebd7..c4bd252760e7 100644 --- a/clients/client-identitystore/README.md +++ b/clients/client-identitystore/README.md @@ -3,4 +3,199 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-identitystore/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-identitystore) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-identitystore.svg)](https://www.npmjs.com/package/@aws-sdk/client-identitystore) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Identitystore Client for Node.js, Browser and React Native. + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-identitystore +using your favorite package manager: + +- `npm install @aws-sdk/client-identitystore` +- `yarn add @aws-sdk/client-identitystore` +- `pnpm add @aws-sdk/client-identitystore` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IdentitystoreClient` and +the commands you need, for example `DescribeGroupCommand`: + +```js +// ES5 example +const { IdentitystoreClient, DescribeGroupCommand } = require("@aws-sdk/client-identitystore"); +``` + +```ts +// ES6+ example +import { IdentitystoreClient, DescribeGroupCommand } from "@aws-sdk/client-identitystore"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IdentitystoreClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeGroupCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-identitystore"; +const client = new AWS.Identitystore({ region: "REGION" }); + +// async/await. +try { + const data = client.describeGroup(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeGroup(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeGroup(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-identitystore` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-imagebuilder/README.md b/clients/client-imagebuilder/README.md index 0f4af3cd8a64..646b4cf2174b 100644 --- a/clients/client-imagebuilder/README.md +++ b/clients/client-imagebuilder/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-imagebuilder/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-imagebuilder) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-imagebuilder.svg)](https://www.npmjs.com/package/@aws-sdk/client-imagebuilder) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Imagebuilder Client for Node.js, Browser and React Native. + +

EC2 Image Builder is a fully managed AWS service that makes it easier to automate the creation, management, and deployment of customized, secure, and up-to-date “golden” server images that are pre-installed and pre-configured with software and settings to meet specific IT standards.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-imagebuilder +using your favorite package manager: + +- `npm install @aws-sdk/client-imagebuilder` +- `yarn add @aws-sdk/client-imagebuilder` +- `pnpm add @aws-sdk/client-imagebuilder` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ImagebuilderClient` and +the commands you need, for example `CancelImageCreationCommand`: + +```js +// ES5 example +const { ImagebuilderClient, CancelImageCreationCommand } = require("@aws-sdk/client-imagebuilder"); +``` + +```ts +// ES6+ example +import { ImagebuilderClient, CancelImageCreationCommand } from "@aws-sdk/client-imagebuilder"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ImagebuilderClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelImageCreationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-imagebuilder"; +const client = new AWS.Imagebuilder({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelImageCreation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelImageCreation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelImageCreation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-imagebuilder` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-inspector/README.md b/clients/client-inspector/README.md index 998bc11e2c8e..1a13598fb839 100644 --- a/clients/client-inspector/README.md +++ b/clients/client-inspector/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-inspector/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-inspector) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-inspector.svg)](https://www.npmjs.com/package/@aws-sdk/client-inspector) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Inspector Client for Node.js, Browser and React Native. + +Amazon Inspector + +

Amazon Inspector enables you to analyze the behavior of your AWS resources and to +identify potential security issues. For more information, see Amazon Inspector User +Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-inspector +using your favorite package manager: + +- `npm install @aws-sdk/client-inspector` +- `yarn add @aws-sdk/client-inspector` +- `pnpm add @aws-sdk/client-inspector` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `InspectorClient` and +the commands you need, for example `AddAttributesToFindingsCommand`: + +```js +// ES5 example +const { InspectorClient, AddAttributesToFindingsCommand } = require("@aws-sdk/client-inspector"); +``` + +```ts +// ES6+ example +import { InspectorClient, AddAttributesToFindingsCommand } from "@aws-sdk/client-inspector"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new InspectorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddAttributesToFindingsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-inspector"; +const client = new AWS.Inspector({ region: "REGION" }); + +// async/await. +try { + const data = client.addAttributesToFindings(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addAttributesToFindings(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addAttributesToFindings(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-inspector` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot-1click-devices-service/README.md b/clients/client-iot-1click-devices-service/README.md index 8ee19e4a2eb5..05bd420ff896 100644 --- a/clients/client-iot-1click-devices-service/README.md +++ b/clients/client-iot-1click-devices-service/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot-1click-devices-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-1click-devices-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot-1click-devices-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-1click-devices-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoT1ClickDevicesService Client for Node.js, Browser and React Native. + +

Describes all of the AWS IoT 1-Click device-related API operations for the service. +Also provides sample requests, responses, and errors for the supported web services +protocols.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot-1click-devices-service +using your favorite package manager: + +- `npm install @aws-sdk/client-iot-1click-devices-service` +- `yarn add @aws-sdk/client-iot-1click-devices-service` +- `pnpm add @aws-sdk/client-iot-1click-devices-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoT1ClickDevicesServiceClient` and +the commands you need, for example `ClaimDevicesByClaimCodeCommand`: + +```js +// ES5 example +const { + IoT1ClickDevicesServiceClient, + ClaimDevicesByClaimCodeCommand, +} = require("@aws-sdk/client-iot-1click-devices-service"); +``` + +```ts +// ES6+ example +import { + IoT1ClickDevicesServiceClient, + ClaimDevicesByClaimCodeCommand, +} from "@aws-sdk/client-iot-1click-devices-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoT1ClickDevicesServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ClaimDevicesByClaimCodeCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot-1click-devices-service"; +const client = new AWS.IoT1ClickDevicesService({ region: "REGION" }); + +// async/await. +try { + const data = client.claimDevicesByClaimCode(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .claimDevicesByClaimCode(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.claimDevicesByClaimCode(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot-1click-devices-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot-1click-projects/README.md b/clients/client-iot-1click-projects/README.md index 908064655176..0c8d368dd6d9 100644 --- a/clients/client-iot-1click-projects/README.md +++ b/clients/client-iot-1click-projects/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot-1click-projects/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-1click-projects) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot-1click-projects.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-1click-projects) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoT1ClickProjects Client for Node.js, Browser and React Native. + +

The AWS IoT 1-Click Projects API Reference

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot-1click-projects +using your favorite package manager: + +- `npm install @aws-sdk/client-iot-1click-projects` +- `yarn add @aws-sdk/client-iot-1click-projects` +- `pnpm add @aws-sdk/client-iot-1click-projects` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoT1ClickProjectsClient` and +the commands you need, for example `AssociateDeviceWithPlacementCommand`: + +```js +// ES5 example +const { IoT1ClickProjectsClient, AssociateDeviceWithPlacementCommand } = require("@aws-sdk/client-iot-1click-projects"); +``` + +```ts +// ES6+ example +import { IoT1ClickProjectsClient, AssociateDeviceWithPlacementCommand } from "@aws-sdk/client-iot-1click-projects"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoT1ClickProjectsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateDeviceWithPlacementCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot-1click-projects"; +const client = new AWS.IoT1ClickProjects({ region: "REGION" }); + +// async/await. +try { + const data = client.associateDeviceWithPlacement(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateDeviceWithPlacement(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateDeviceWithPlacement(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot-1click-projects` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot-data-plane/README.md b/clients/client-iot-data-plane/README.md index 5d7e2497655c..3df36be992a1 100644 --- a/clients/client-iot-data-plane/README.md +++ b/clients/client-iot-data-plane/README.md @@ -3,4 +3,212 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot-data-plane/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-data-plane) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot-data-plane.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-data-plane) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTDataPlane Client for Node.js, Browser and React Native. + +AWS IoT + +

AWS IoT-Data enables secure, bi-directional communication between Internet-connected things (such as sensors, +actuators, embedded devices, or smart appliances) and the AWS cloud. It implements a broker for applications and +things to publish messages over HTTP (Publish) and retrieve, update, and delete shadows. A shadow is a +persistent representation of your things and their state in the AWS cloud.

+

Find the endpoint address for actions in the AWS IoT data plane by running this CLI command:

+

+aws iot describe-endpoint --endpoint-type iot:Data-ATS +

+

The service name used by AWS Signature Version 4 +to sign requests is: iotdevicegateway.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot-data-plane +using your favorite package manager: + +- `npm install @aws-sdk/client-iot-data-plane` +- `yarn add @aws-sdk/client-iot-data-plane` +- `pnpm add @aws-sdk/client-iot-data-plane` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTDataPlaneClient` and +the commands you need, for example `DeleteThingShadowCommand`: + +```js +// ES5 example +const { IoTDataPlaneClient, DeleteThingShadowCommand } = require("@aws-sdk/client-iot-data-plane"); +``` + +```ts +// ES6+ example +import { IoTDataPlaneClient, DeleteThingShadowCommand } from "@aws-sdk/client-iot-data-plane"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTDataPlaneClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteThingShadowCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot-data-plane"; +const client = new AWS.IoTDataPlane({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteThingShadow(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteThingShadow(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteThingShadow(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot-data-plane` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot-events-data/README.md b/clients/client-iot-events-data/README.md index 3845846646a5..36e20cab55e9 100644 --- a/clients/client-iot-events-data/README.md +++ b/clients/client-iot-events-data/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot-events-data/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-events-data) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot-events-data.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-events-data) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTEventsData Client for Node.js, Browser and React Native. + +

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, +and triggers actions when such events occur. AWS IoT Events Data API commands enable you to send +inputs to detectors, list detectors, and view or update a detector's status.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot-events-data +using your favorite package manager: + +- `npm install @aws-sdk/client-iot-events-data` +- `yarn add @aws-sdk/client-iot-events-data` +- `pnpm add @aws-sdk/client-iot-events-data` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTEventsDataClient` and +the commands you need, for example `BatchPutMessageCommand`: + +```js +// ES5 example +const { IoTEventsDataClient, BatchPutMessageCommand } = require("@aws-sdk/client-iot-events-data"); +``` + +```ts +// ES6+ example +import { IoTEventsDataClient, BatchPutMessageCommand } from "@aws-sdk/client-iot-events-data"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTEventsDataClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchPutMessageCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot-events-data"; +const client = new AWS.IoTEventsData({ region: "REGION" }); + +// async/await. +try { + const data = client.batchPutMessage(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchPutMessage(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchPutMessage(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot-events-data` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot-events/README.md b/clients/client-iot-events/README.md index 18aa11b455fb..284d98fd59a6 100644 --- a/clients/client-iot-events/README.md +++ b/clients/client-iot-events/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot-events/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-events) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot-events.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-events) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTEvents Client for Node.js, Browser and React Native. + +

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and +triggers actions when such events occur. You can use AWS IoT Events API operations to create, read, +update, and delete inputs and detector models, and to list their versions.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot-events +using your favorite package manager: + +- `npm install @aws-sdk/client-iot-events` +- `yarn add @aws-sdk/client-iot-events` +- `pnpm add @aws-sdk/client-iot-events` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTEventsClient` and +the commands you need, for example `CreateDetectorModelCommand`: + +```js +// ES5 example +const { IoTEventsClient, CreateDetectorModelCommand } = require("@aws-sdk/client-iot-events"); +``` + +```ts +// ES6+ example +import { IoTEventsClient, CreateDetectorModelCommand } from "@aws-sdk/client-iot-events"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTEventsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDetectorModelCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot-events"; +const client = new AWS.IoTEvents({ region: "REGION" }); + +// async/await. +try { + const data = client.createDetectorModel(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDetectorModel(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDetectorModel(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot-events` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot-jobs-data-plane/README.md b/clients/client-iot-jobs-data-plane/README.md index 75c15303d6ec..1ddd10172730 100644 --- a/clients/client-iot-jobs-data-plane/README.md +++ b/clients/client-iot-jobs-data-plane/README.md @@ -3,4 +3,211 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot-jobs-data-plane/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-jobs-data-plane) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot-jobs-data-plane.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot-jobs-data-plane) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTJobsDataPlane Client for Node.js, Browser and React Native. + +

AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to +and executed on one or more devices connected to AWS IoT. For example, you can define a job that instructs a +set of devices to download and install application or firmware updates, reboot, rotate certificates, or perform +remote troubleshooting operations.

+

To create a job, you make a job document which is a description of the remote operations to be +performed, and you specify a list of targets that should perform the operations. The targets can be individual +things, thing groups or both.

+

AWS IoT Jobs sends a message to inform the targets that a job is available. The target starts the +execution of the job by downloading the job document, performing the operations it specifies, and reporting its +progress to AWS IoT. The Jobs service provides commands to track the progress of a job on a specific target and +for all the targets of the job

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot-jobs-data-plane +using your favorite package manager: + +- `npm install @aws-sdk/client-iot-jobs-data-plane` +- `yarn add @aws-sdk/client-iot-jobs-data-plane` +- `pnpm add @aws-sdk/client-iot-jobs-data-plane` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTJobsDataPlaneClient` and +the commands you need, for example `DescribeJobExecutionCommand`: + +```js +// ES5 example +const { IoTJobsDataPlaneClient, DescribeJobExecutionCommand } = require("@aws-sdk/client-iot-jobs-data-plane"); +``` + +```ts +// ES6+ example +import { IoTJobsDataPlaneClient, DescribeJobExecutionCommand } from "@aws-sdk/client-iot-jobs-data-plane"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTJobsDataPlaneClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeJobExecutionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot-jobs-data-plane"; +const client = new AWS.IoTJobsDataPlane({ region: "REGION" }); + +// async/await. +try { + const data = client.describeJobExecution(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeJobExecution(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeJobExecution(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot-jobs-data-plane` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iot/README.md b/clients/client-iot/README.md index 5d9a5c46a4b0..6280fbad9b4d 100644 --- a/clients/client-iot/README.md +++ b/clients/client-iot/README.md @@ -3,4 +3,217 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iot/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iot.svg)](https://www.npmjs.com/package/@aws-sdk/client-iot) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoT Client for Node.js, Browser and React Native. + +AWS IoT + +

AWS IoT provides secure, bi-directional communication between Internet-connected +devices (such as sensors, actuators, embedded devices, or smart appliances) and the AWS +cloud. You can discover your custom IoT-Data endpoint to communicate with, configure +rules for data processing and integration with other services, organize resources +associated with each device (Registry), configure logging, and create and manage +policies and credentials to authenticate devices.

+

The service endpoints that expose this API are listed in +AWS IoT Core Endpoints and Quotas. +You must use the endpoint for the region that has the resources you want to access.

+

The service name used by AWS +Signature Version 4 to sign the request is: +execute-api.

+

For more information about how AWS IoT works, see the Developer +Guide.

+

For information about how to use the credentials provider for AWS IoT, see Authorizing Direct Calls to AWS Services.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iot +using your favorite package manager: + +- `npm install @aws-sdk/client-iot` +- `yarn add @aws-sdk/client-iot` +- `pnpm add @aws-sdk/client-iot` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTClient` and +the commands you need, for example `AcceptCertificateTransferCommand`: + +```js +// ES5 example +const { IoTClient, AcceptCertificateTransferCommand } = require("@aws-sdk/client-iot"); +``` + +```ts +// ES6+ example +import { IoTClient, AcceptCertificateTransferCommand } from "@aws-sdk/client-iot"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptCertificateTransferCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iot"; +const client = new AWS.IoT({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptCertificateTransfer(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptCertificateTransfer(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptCertificateTransfer(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iot` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iotanalytics/README.md b/clients/client-iotanalytics/README.md index 5902f1dea1b1..46962e08ad8a 100644 --- a/clients/client-iotanalytics/README.md +++ b/clients/client-iotanalytics/README.md @@ -3,4 +3,219 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iotanalytics/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotanalytics) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iotanalytics.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotanalytics) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTAnalytics Client for Node.js, Browser and React Native. + +

AWS IoT Analytics allows you to collect large amounts of device data, process messages, and store them. +You can then query the data and run sophisticated analytics on it. AWS IoT Analytics enables advanced +data exploration through integration with Jupyter Notebooks and data visualization through integration +with Amazon QuickSight.

+ +

Traditional analytics and business intelligence tools are designed to process structured data. IoT data +often comes from devices that record noisy processes (such as temperature, motion, or sound). As a result +the data from these devices can have significant gaps, corrupted messages, and false readings that must be +cleaned up before analysis can occur. Also, IoT data is often only meaningful in the context of other data +from external sources.

+ +

AWS IoT Analytics automates the steps required to analyze data from IoT devices. AWS IoT Analytics +filters, transforms, and enriches IoT data before storing it in a time-series data store for analysis. You +can set up the service to collect only the data you need from your devices, apply mathematical transforms +to process the data, and enrich the data with device-specific metadata such as device type and location +before storing it. Then, you can analyze your data by running queries using the built-in SQL query engine, +or perform more complex analytics and machine learning inference. AWS IoT Analytics includes pre-built models +for common IoT use cases so you can answer questions like which devices are about to fail or which customers +are at risk of abandoning their wearable devices.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iotanalytics +using your favorite package manager: + +- `npm install @aws-sdk/client-iotanalytics` +- `yarn add @aws-sdk/client-iotanalytics` +- `pnpm add @aws-sdk/client-iotanalytics` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTAnalyticsClient` and +the commands you need, for example `BatchPutMessageCommand`: + +```js +// ES5 example +const { IoTAnalyticsClient, BatchPutMessageCommand } = require("@aws-sdk/client-iotanalytics"); +``` + +```ts +// ES6+ example +import { IoTAnalyticsClient, BatchPutMessageCommand } from "@aws-sdk/client-iotanalytics"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTAnalyticsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchPutMessageCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iotanalytics"; +const client = new AWS.IoTAnalytics({ region: "REGION" }); + +// async/await. +try { + const data = client.batchPutMessage(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchPutMessage(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchPutMessage(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iotanalytics` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iotsecuretunneling/README.md b/clients/client-iotsecuretunneling/README.md index 3f08339180af..e348a95b55dc 100644 --- a/clients/client-iotsecuretunneling/README.md +++ b/clients/client-iotsecuretunneling/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iotsecuretunneling/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotsecuretunneling) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iotsecuretunneling.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotsecuretunneling) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTSecureTunneling Client for Node.js, Browser and React Native. + +AWS IoT Secure Tunneling + +

AWS IoT Secure Tunnling enables you to create remote connections to devices +deployed in the field.

+ +

For more information about how AWS IoT Secure Tunneling works, see AWS IoT Secure Tunneling.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iotsecuretunneling +using your favorite package manager: + +- `npm install @aws-sdk/client-iotsecuretunneling` +- `yarn add @aws-sdk/client-iotsecuretunneling` +- `pnpm add @aws-sdk/client-iotsecuretunneling` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTSecureTunnelingClient` and +the commands you need, for example `CloseTunnelCommand`: + +```js +// ES5 example +const { IoTSecureTunnelingClient, CloseTunnelCommand } = require("@aws-sdk/client-iotsecuretunneling"); +``` + +```ts +// ES6+ example +import { IoTSecureTunnelingClient, CloseTunnelCommand } from "@aws-sdk/client-iotsecuretunneling"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTSecureTunnelingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CloseTunnelCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iotsecuretunneling"; +const client = new AWS.IoTSecureTunneling({ region: "REGION" }); + +// async/await. +try { + const data = client.closeTunnel(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .closeTunnel(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.closeTunnel(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iotsecuretunneling` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iotsitewise/README.md b/clients/client-iotsitewise/README.md index c88d7ee1bd61..ee9ad3fd29a5 100644 --- a/clients/client-iotsitewise/README.md +++ b/clients/client-iotsitewise/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iotsitewise/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotsitewise) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iotsitewise.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotsitewise) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTSiteWise Client for Node.js, Browser and React Native. + +

Welcome to the AWS IoT SiteWise API Reference. AWS IoT SiteWise is an AWS service that connects Industrial Internet of Things (IIoT) devices to the power of the AWS Cloud. For more information, see the +AWS IoT SiteWise User Guide. For information about AWS IoT SiteWise quotas, see Quotas in the AWS IoT SiteWise User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iotsitewise +using your favorite package manager: + +- `npm install @aws-sdk/client-iotsitewise` +- `yarn add @aws-sdk/client-iotsitewise` +- `pnpm add @aws-sdk/client-iotsitewise` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTSiteWiseClient` and +the commands you need, for example `AssociateAssetsCommand`: + +```js +// ES5 example +const { IoTSiteWiseClient, AssociateAssetsCommand } = require("@aws-sdk/client-iotsitewise"); +``` + +```ts +// ES6+ example +import { IoTSiteWiseClient, AssociateAssetsCommand } from "@aws-sdk/client-iotsitewise"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTSiteWiseClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateAssetsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iotsitewise"; +const client = new AWS.IoTSiteWise({ region: "REGION" }); + +// async/await. +try { + const data = client.associateAssets(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateAssets(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateAssets(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iotsitewise` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-iotthingsgraph/README.md b/clients/client-iotthingsgraph/README.md index b180d200928d..601b5572a8f3 100644 --- a/clients/client-iotthingsgraph/README.md +++ b/clients/client-iotthingsgraph/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-iotthingsgraph/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotthingsgraph) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-iotthingsgraph.svg)](https://www.npmjs.com/package/@aws-sdk/client-iotthingsgraph) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript IoTThingsGraph Client for Node.js, Browser and React Native. + +AWS IoT Things Graph + +

AWS IoT Things Graph provides an integrated set of tools that enable developers to connect devices and services that use different standards, +such as units of measure and communication protocols. AWS IoT Things Graph makes it possible to build IoT applications with little to no code by connecting devices and services +and defining how they interact at an abstract level.

+

For more information about how AWS IoT Things Graph works, see the User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-iotthingsgraph +using your favorite package manager: + +- `npm install @aws-sdk/client-iotthingsgraph` +- `yarn add @aws-sdk/client-iotthingsgraph` +- `pnpm add @aws-sdk/client-iotthingsgraph` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IoTThingsGraphClient` and +the commands you need, for example `AssociateEntityToThingCommand`: + +```js +// ES5 example +const { IoTThingsGraphClient, AssociateEntityToThingCommand } = require("@aws-sdk/client-iotthingsgraph"); +``` + +```ts +// ES6+ example +import { IoTThingsGraphClient, AssociateEntityToThingCommand } from "@aws-sdk/client-iotthingsgraph"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IoTThingsGraphClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateEntityToThingCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-iotthingsgraph"; +const client = new AWS.IoTThingsGraph({ region: "REGION" }); + +// async/await. +try { + const data = client.associateEntityToThing(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateEntityToThing(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateEntityToThing(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-iotthingsgraph` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ivs/README.md b/clients/client-ivs/README.md index 636ca75b380b..147e3b422f54 100644 --- a/clients/client-ivs/README.md +++ b/clients/client-ivs/README.md @@ -3,4 +3,473 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ivs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ivs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ivs.svg)](https://www.npmjs.com/package/@aws-sdk/client-ivs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Ivs Client for Node.js, Browser and React Native. + +

+Introduction +

+ +

The Amazon Interactive Video Service (IVS) API is REST compatible, using a standard HTTP +API and an AWS SNS event stream for responses. JSON +is used for both requests and responses, including errors.

+ +

The API is an AWS regional service, currently in these regions: us-west-2, us-east-1, and +eu-west-1.

+

+ +All API request parameters and URLs are case sensitive. + + +

+ +

For a summary of notable documentation changes in each release, see Document +History.

+ +

+Service Endpoints +

+

The following are the Amazon IVS service endpoints (all HTTPS):

+

Region name: US West (Oregon)

+ +

Region name: US East (Virginia)

+ +

Region name: EU West (Dublin)

+ + +

+Allowed Header Values +

+ + + +

+Resources +

+

The following resources contain information about your IVS live stream (see Getting Started with Amazon +IVS):

+ + + +

+Tagging +

+ +

A tag is a metadata label that you assign to an AWS resource. A tag +comprises a key and a value, both set by you. For +example, you might set a tag as topic:nature to label a particular video +category. See Tagging AWS +Resources for more information, including restrictions that apply to tags.

+ +

Tags can help you identify and organize your AWS resources. For example, you can use the +same tag for different resources to indicate that they are related. You can also use tags to +manage access (see +Access Tags).

+ +

The Amazon IVS API has these tag-related endpoints: TagResource, UntagResource, and ListTagsForResource. The following +resources support tagging: Channels, Stream Keys, and Playback Key Pairs.

+ +

+Channel Endpoints +

+ + +

+StreamKey Endpoints +

+ + +

+Stream Endpoints +

+ + +

+PlaybackKeyPair Endpoints +

+ + +

+AWS Tags Endpoints +

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ivs +using your favorite package manager: + +- `npm install @aws-sdk/client-ivs` +- `yarn add @aws-sdk/client-ivs` +- `pnpm add @aws-sdk/client-ivs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `IvsClient` and +the commands you need, for example `BatchGetChannelCommand`: + +```js +// ES5 example +const { IvsClient, BatchGetChannelCommand } = require("@aws-sdk/client-ivs"); +``` + +```ts +// ES6+ example +import { IvsClient, BatchGetChannelCommand } from "@aws-sdk/client-ivs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new IvsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchGetChannelCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ivs"; +const client = new AWS.Ivs({ region: "REGION" }); + +// async/await. +try { + const data = client.batchGetChannel(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchGetChannel(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchGetChannel(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ivs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kafka/README.md b/clients/client-kafka/README.md index f41cf929e958..fcf056c91ec4 100644 --- a/clients/client-kafka/README.md +++ b/clients/client-kafka/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kafka/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kafka) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kafka.svg)](https://www.npmjs.com/package/@aws-sdk/client-kafka) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Kafka Client for Node.js, Browser and React Native. + +

The operations for managing an Amazon MSK cluster.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kafka +using your favorite package manager: + +- `npm install @aws-sdk/client-kafka` +- `yarn add @aws-sdk/client-kafka` +- `pnpm add @aws-sdk/client-kafka` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KafkaClient` and +the commands you need, for example `BatchAssociateScramSecretCommand`: + +```js +// ES5 example +const { KafkaClient, BatchAssociateScramSecretCommand } = require("@aws-sdk/client-kafka"); +``` + +```ts +// ES6+ example +import { KafkaClient, BatchAssociateScramSecretCommand } from "@aws-sdk/client-kafka"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KafkaClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchAssociateScramSecretCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kafka"; +const client = new AWS.Kafka({ region: "REGION" }); + +// async/await. +try { + const data = client.batchAssociateScramSecret(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchAssociateScramSecret(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchAssociateScramSecret(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kafka` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kendra/README.md b/clients/client-kendra/README.md index f5439cf26b58..1fa4af445d72 100644 --- a/clients/client-kendra/README.md +++ b/clients/client-kendra/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kendra/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kendra) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kendra.svg)](https://www.npmjs.com/package/@aws-sdk/client-kendra) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Kendra Client for Node.js, Browser and React Native. + +

Amazon Kendra is a service for indexing large document sets.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kendra +using your favorite package manager: + +- `npm install @aws-sdk/client-kendra` +- `yarn add @aws-sdk/client-kendra` +- `pnpm add @aws-sdk/client-kendra` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KendraClient` and +the commands you need, for example `BatchDeleteDocumentCommand`: + +```js +// ES5 example +const { KendraClient, BatchDeleteDocumentCommand } = require("@aws-sdk/client-kendra"); +``` + +```ts +// ES6+ example +import { KendraClient, BatchDeleteDocumentCommand } from "@aws-sdk/client-kendra"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KendraClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchDeleteDocumentCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kendra"; +const client = new AWS.Kendra({ region: "REGION" }); + +// async/await. +try { + const data = client.batchDeleteDocument(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchDeleteDocument(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchDeleteDocument(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kendra` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis-analytics-v2/README.md b/clients/client-kinesis-analytics-v2/README.md index 4ff2128e3d68..280024bc5b0f 100644 --- a/clients/client-kinesis-analytics-v2/README.md +++ b/clients/client-kinesis-analytics-v2/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-analytics-v2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-analytics-v2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis-analytics-v2.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-analytics-v2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KinesisAnalyticsV2 Client for Node.js, Browser and React Native. + +

Amazon Kinesis Data Analytics is a fully managed service that you can use to process and analyze streaming data using Java, SQL, or Scala. The service +enables you to quickly author and run Java, SQL, or Scala code against streaming sources to perform time +series analytics, feed real-time dashboards, and create real-time metrics.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis-analytics-v2 +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis-analytics-v2` +- `yarn add @aws-sdk/client-kinesis-analytics-v2` +- `pnpm add @aws-sdk/client-kinesis-analytics-v2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisAnalyticsV2Client` and +the commands you need, for example `AddApplicationCloudWatchLoggingOptionCommand`: + +```js +// ES5 example +const { + KinesisAnalyticsV2Client, + AddApplicationCloudWatchLoggingOptionCommand, +} = require("@aws-sdk/client-kinesis-analytics-v2"); +``` + +```ts +// ES6+ example +import { + KinesisAnalyticsV2Client, + AddApplicationCloudWatchLoggingOptionCommand, +} from "@aws-sdk/client-kinesis-analytics-v2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisAnalyticsV2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddApplicationCloudWatchLoggingOptionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis-analytics-v2"; +const client = new AWS.KinesisAnalyticsV2({ region: "REGION" }); + +// async/await. +try { + const data = client.addApplicationCloudWatchLoggingOption(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addApplicationCloudWatchLoggingOption(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addApplicationCloudWatchLoggingOption(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis-analytics-v2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis-analytics/README.md b/clients/client-kinesis-analytics/README.md index 6926ae264b82..5c53a3907724 100644 --- a/clients/client-kinesis-analytics/README.md +++ b/clients/client-kinesis-analytics/README.md @@ -3,4 +3,217 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-analytics/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-analytics) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis-analytics.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-analytics) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KinesisAnalytics Client for Node.js, Browser and React Native. + +Amazon Kinesis Analytics + +

+Overview +

+ +

This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see Amazon Kinesis Data Analytics API V2 Documentation.

+
+

This is the Amazon Kinesis Analytics v1 API Reference. +The Amazon Kinesis Analytics Developer Guide provides additional information. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis-analytics +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis-analytics` +- `yarn add @aws-sdk/client-kinesis-analytics` +- `pnpm add @aws-sdk/client-kinesis-analytics` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisAnalyticsClient` and +the commands you need, for example `AddApplicationCloudWatchLoggingOptionCommand`: + +```js +// ES5 example +const { + KinesisAnalyticsClient, + AddApplicationCloudWatchLoggingOptionCommand, +} = require("@aws-sdk/client-kinesis-analytics"); +``` + +```ts +// ES6+ example +import { + KinesisAnalyticsClient, + AddApplicationCloudWatchLoggingOptionCommand, +} from "@aws-sdk/client-kinesis-analytics"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisAnalyticsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddApplicationCloudWatchLoggingOptionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis-analytics"; +const client = new AWS.KinesisAnalytics({ region: "REGION" }); + +// async/await. +try { + const data = client.addApplicationCloudWatchLoggingOption(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addApplicationCloudWatchLoggingOption(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addApplicationCloudWatchLoggingOption(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis-analytics` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis-video-archived-media/README.md b/clients/client-kinesis-video-archived-media/README.md index 0d01e6f75e70..3968da641f9f 100644 --- a/clients/client-kinesis-video-archived-media/README.md +++ b/clients/client-kinesis-video-archived-media/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-video-archived-media/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-archived-media) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis-video-archived-media.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-archived-media) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KinesisVideoArchivedMedia Client for Node.js, Browser and React Native. + +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis-video-archived-media +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis-video-archived-media` +- `yarn add @aws-sdk/client-kinesis-video-archived-media` +- `pnpm add @aws-sdk/client-kinesis-video-archived-media` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisVideoArchivedMediaClient` and +the commands you need, for example `GetClipCommand`: + +```js +// ES5 example +const { KinesisVideoArchivedMediaClient, GetClipCommand } = require("@aws-sdk/client-kinesis-video-archived-media"); +``` + +```ts +// ES6+ example +import { KinesisVideoArchivedMediaClient, GetClipCommand } from "@aws-sdk/client-kinesis-video-archived-media"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisVideoArchivedMediaClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetClipCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis-video-archived-media"; +const client = new AWS.KinesisVideoArchivedMedia({ region: "REGION" }); + +// async/await. +try { + const data = client.getClip(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getClip(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getClip(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis-video-archived-media` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis-video-media/README.md b/clients/client-kinesis-video-media/README.md index 77a8253bfb9a..d7de4f5b5062 100644 --- a/clients/client-kinesis-video-media/README.md +++ b/clients/client-kinesis-video-media/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-video-media/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-media) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis-video-media.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-media) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KinesisVideoMedia Client for Node.js, Browser and React Native. + +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis-video-media +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis-video-media` +- `yarn add @aws-sdk/client-kinesis-video-media` +- `pnpm add @aws-sdk/client-kinesis-video-media` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisVideoMediaClient` and +the commands you need, for example `GetMediaCommand`: + +```js +// ES5 example +const { KinesisVideoMediaClient, GetMediaCommand } = require("@aws-sdk/client-kinesis-video-media"); +``` + +```ts +// ES6+ example +import { KinesisVideoMediaClient, GetMediaCommand } from "@aws-sdk/client-kinesis-video-media"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisVideoMediaClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetMediaCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis-video-media"; +const client = new AWS.KinesisVideoMedia({ region: "REGION" }); + +// async/await. +try { + const data = client.getMedia(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getMedia(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getMedia(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis-video-media` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis-video-signaling/README.md b/clients/client-kinesis-video-signaling/README.md index 5fdea3014801..c743622faa98 100644 --- a/clients/client-kinesis-video-signaling/README.md +++ b/clients/client-kinesis-video-signaling/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-video-signaling/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-signaling) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis-video-signaling.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video-signaling) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KinesisVideoSignaling Client for Node.js, Browser and React Native. + +

Kinesis Video Streams Signaling Service is a intermediate service that establishes a +communication channel for discovering peers, transmitting offers and answers in order to +establish peer-to-peer connection in webRTC technology.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis-video-signaling +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis-video-signaling` +- `yarn add @aws-sdk/client-kinesis-video-signaling` +- `pnpm add @aws-sdk/client-kinesis-video-signaling` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisVideoSignalingClient` and +the commands you need, for example `GetIceServerConfigCommand`: + +```js +// ES5 example +const { KinesisVideoSignalingClient, GetIceServerConfigCommand } = require("@aws-sdk/client-kinesis-video-signaling"); +``` + +```ts +// ES6+ example +import { KinesisVideoSignalingClient, GetIceServerConfigCommand } from "@aws-sdk/client-kinesis-video-signaling"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisVideoSignalingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetIceServerConfigCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis-video-signaling"; +const client = new AWS.KinesisVideoSignaling({ region: "REGION" }); + +// async/await. +try { + const data = client.getIceServerConfig(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getIceServerConfig(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getIceServerConfig(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis-video-signaling` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis-video/README.md b/clients/client-kinesis-video/README.md index 639126abfb5a..610713d3f051 100644 --- a/clients/client-kinesis-video/README.md +++ b/clients/client-kinesis-video/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis-video/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis-video.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis-video) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KinesisVideo Client for Node.js, Browser and React Native. + +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis-video +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis-video` +- `yarn add @aws-sdk/client-kinesis-video` +- `pnpm add @aws-sdk/client-kinesis-video` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisVideoClient` and +the commands you need, for example `CreateSignalingChannelCommand`: + +```js +// ES5 example +const { KinesisVideoClient, CreateSignalingChannelCommand } = require("@aws-sdk/client-kinesis-video"); +``` + +```ts +// ES6+ example +import { KinesisVideoClient, CreateSignalingChannelCommand } from "@aws-sdk/client-kinesis-video"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisVideoClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateSignalingChannelCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis-video"; +const client = new AWS.KinesisVideo({ region: "REGION" }); + +// async/await. +try { + const data = client.createSignalingChannel(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createSignalingChannel(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createSignalingChannel(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis-video` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kinesis/README.md b/clients/client-kinesis/README.md index 5d746b50b0cc..dd1a5cbde4ba 100644 --- a/clients/client-kinesis/README.md +++ b/clients/client-kinesis/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kinesis/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kinesis.svg)](https://www.npmjs.com/package/@aws-sdk/client-kinesis) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Kinesis Client for Node.js, Browser and React Native. + +Amazon Kinesis Data Streams Service API Reference + +

Amazon Kinesis Data Streams is a managed service that scales elastically for +real-time processing of streaming big data.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kinesis +using your favorite package manager: + +- `npm install @aws-sdk/client-kinesis` +- `yarn add @aws-sdk/client-kinesis` +- `pnpm add @aws-sdk/client-kinesis` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KinesisClient` and +the commands you need, for example `AddTagsToStreamCommand`: + +```js +// ES5 example +const { KinesisClient, AddTagsToStreamCommand } = require("@aws-sdk/client-kinesis"); +``` + +```ts +// ES6+ example +import { KinesisClient, AddTagsToStreamCommand } from "@aws-sdk/client-kinesis"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KinesisClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToStreamCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kinesis"; +const client = new AWS.Kinesis({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToStream(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToStream(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToStream(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kinesis` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-kms/README.md b/clients/client-kms/README.md index 198f10bbd3ee..1f46e14604b7 100644 --- a/clients/client-kms/README.md +++ b/clients/client-kms/README.md @@ -3,4 +3,290 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-kms/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-kms) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-kms.svg)](https://www.npmjs.com/package/@aws-sdk/client-kms) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript KMS Client for Node.js, Browser and React Native. + +AWS Key Management Service + +

AWS Key Management Service (AWS KMS) is an encryption and key management web service. This guide describes +the AWS KMS operations that you can call programmatically. For general information about AWS KMS, +see the +AWS Key Management Service Developer Guide +.

+ +

AWS provides SDKs that consist of libraries and sample code for various programming +languages and platforms (Java, Ruby, .Net, macOS, Android, etc.). The SDKs provide a +convenient way to create programmatic access to AWS KMS and other AWS services. For example, +the SDKs take care of tasks such as signing requests (see below), managing errors, and +retrying requests automatically. For more information about the AWS SDKs, including how to +download and install them, see Tools for Amazon Web +Services.

+
+

We recommend that you use the AWS SDKs to make programmatic API calls to AWS KMS.

+

Clients must support TLS (Transport Layer Security) 1.0. We recommend TLS 1.2. Clients +must also support cipher suites with Perfect Forward Secrecy (PFS) such as Ephemeral +Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems +such as Java 7 and later support these modes.

+

+Signing Requests +

+

Requests must be signed by using an access key ID and a secret access key. We strongly +recommend that you do not use your AWS account (root) access key ID and +secret key for everyday work with AWS KMS. Instead, use the access key ID and secret access key +for an IAM user. You can also use the AWS Security Token Service to generate temporary +security credentials that you can use to sign requests.

+

All AWS KMS operations require Signature Version 4.

+

+Logging API Requests +

+

AWS KMS supports AWS CloudTrail, a service that logs AWS API calls and related events for your AWS +account and delivers them to an Amazon S3 bucket that you specify. By using the information +collected by CloudTrail, you can determine what requests were made to AWS KMS, who made the request, +when it was made, and so on. To learn more about CloudTrail, including how to turn it on and find +your log files, see the AWS CloudTrail User Guide.

+

+Additional Resources +

+

For more information about credentials and request signing, see the following:

+ +

+Commonly Used API Operations +

+

Of the API operations discussed in this guide, the following will prove the most useful +for most applications. You will likely perform operations other than these, such as creating +keys and assigning policies, by using the console.

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-kms +using your favorite package manager: + +- `npm install @aws-sdk/client-kms` +- `yarn add @aws-sdk/client-kms` +- `pnpm add @aws-sdk/client-kms` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `KMSClient` and +the commands you need, for example `CancelKeyDeletionCommand`: + +```js +// ES5 example +const { KMSClient, CancelKeyDeletionCommand } = require("@aws-sdk/client-kms"); +``` + +```ts +// ES6+ example +import { KMSClient, CancelKeyDeletionCommand } from "@aws-sdk/client-kms"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new KMSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelKeyDeletionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-kms"; +const client = new AWS.KMS({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelKeyDeletion(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelKeyDeletion(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelKeyDeletion(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-kms` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-lakeformation/README.md b/clients/client-lakeformation/README.md index 656124d0ed03..9c834c281513 100644 --- a/clients/client-lakeformation/README.md +++ b/clients/client-lakeformation/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-lakeformation/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-lakeformation) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-lakeformation.svg)](https://www.npmjs.com/package/@aws-sdk/client-lakeformation) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript LakeFormation Client for Node.js, Browser and React Native. + +AWS Lake Formation + +

Defines the public endpoint for the AWS Lake Formation service.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-lakeformation +using your favorite package manager: + +- `npm install @aws-sdk/client-lakeformation` +- `yarn add @aws-sdk/client-lakeformation` +- `pnpm add @aws-sdk/client-lakeformation` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LakeFormationClient` and +the commands you need, for example `BatchGrantPermissionsCommand`: + +```js +// ES5 example +const { LakeFormationClient, BatchGrantPermissionsCommand } = require("@aws-sdk/client-lakeformation"); +``` + +```ts +// ES6+ example +import { LakeFormationClient, BatchGrantPermissionsCommand } from "@aws-sdk/client-lakeformation"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LakeFormationClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchGrantPermissionsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-lakeformation"; +const client = new AWS.LakeFormation({ region: "REGION" }); + +// async/await. +try { + const data = client.batchGrantPermissions(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchGrantPermissions(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchGrantPermissions(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-lakeformation` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-lambda/README.md b/clients/client-lambda/README.md index 0e7dcd51ead5..00292d713e08 100644 --- a/clients/client-lambda/README.md +++ b/clients/client-lambda/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-lambda/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-lambda) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-lambda.svg)](https://www.npmjs.com/package/@aws-sdk/client-lambda) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native. + +AWS Lambda + +

+Overview +

+

This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides additional +information. For the service overview, see What is +AWS Lambda, and for information about how the service works, see AWS Lambda: How it Works in the AWS Lambda Developer Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-lambda +using your favorite package manager: + +- `npm install @aws-sdk/client-lambda` +- `yarn add @aws-sdk/client-lambda` +- `pnpm add @aws-sdk/client-lambda` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LambdaClient` and +the commands you need, for example `AddLayerVersionPermissionCommand`: + +```js +// ES5 example +const { LambdaClient, AddLayerVersionPermissionCommand } = require("@aws-sdk/client-lambda"); +``` + +```ts +// ES6+ example +import { LambdaClient, AddLayerVersionPermissionCommand } from "@aws-sdk/client-lambda"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LambdaClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddLayerVersionPermissionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-lambda"; +const client = new AWS.Lambda({ region: "REGION" }); + +// async/await. +try { + const data = client.addLayerVersionPermission(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addLayerVersionPermission(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addLayerVersionPermission(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-lambda` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-lex-model-building-service/README.md b/clients/client-lex-model-building-service/README.md index aba9160fcb44..d6954a78106f 100644 --- a/clients/client-lex-model-building-service/README.md +++ b/clients/client-lex-model-building-service/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-lex-model-building-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-lex-model-building-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-lex-model-building-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-lex-model-building-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript LexModelBuildingService Client for Node.js, Browser and React Native. + +Amazon Lex Build-Time Actions + +

Amazon Lex is an AWS service for building conversational voice and text +interfaces. Use these actions to create, update, and delete conversational +bots for new and existing client applications.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-lex-model-building-service +using your favorite package manager: + +- `npm install @aws-sdk/client-lex-model-building-service` +- `yarn add @aws-sdk/client-lex-model-building-service` +- `pnpm add @aws-sdk/client-lex-model-building-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LexModelBuildingServiceClient` and +the commands you need, for example `CreateBotVersionCommand`: + +```js +// ES5 example +const { + LexModelBuildingServiceClient, + CreateBotVersionCommand, +} = require("@aws-sdk/client-lex-model-building-service"); +``` + +```ts +// ES6+ example +import { LexModelBuildingServiceClient, CreateBotVersionCommand } from "@aws-sdk/client-lex-model-building-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LexModelBuildingServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateBotVersionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-lex-model-building-service"; +const client = new AWS.LexModelBuildingService({ region: "REGION" }); + +// async/await. +try { + const data = client.createBotVersion(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createBotVersion(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createBotVersion(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-lex-model-building-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-lex-runtime-service/README.md b/clients/client-lex-runtime-service/README.md index 17e34ab87612..2133b7a08329 100644 --- a/clients/client-lex-runtime-service/README.md +++ b/clients/client-lex-runtime-service/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-lex-runtime-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-lex-runtime-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-lex-runtime-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-lex-runtime-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript LexRuntimeService Client for Node.js, Browser and React Native. + +

Amazon Lex provides both build and runtime endpoints. Each endpoint provides a set of +operations (API). Your conversational bot uses the runtime API to understand user utterances +(user input text or voice). For example, suppose a user says "I want pizza", your bot sends +this input to Amazon Lex using the runtime API. Amazon Lex recognizes that the user request is +for the OrderPizza intent (one of the intents defined in the bot). Then Amazon Lex engages in +user conversation on behalf of the bot to elicit required information (slot values, such as +pizza size and crust type), and then performs fulfillment activity (that you configured when +you created the bot). You use the build-time API to create and manage your Amazon Lex bot. For +a list of build-time operations, see the build-time API, .

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-lex-runtime-service +using your favorite package manager: + +- `npm install @aws-sdk/client-lex-runtime-service` +- `yarn add @aws-sdk/client-lex-runtime-service` +- `pnpm add @aws-sdk/client-lex-runtime-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LexRuntimeServiceClient` and +the commands you need, for example `DeleteSessionCommand`: + +```js +// ES5 example +const { LexRuntimeServiceClient, DeleteSessionCommand } = require("@aws-sdk/client-lex-runtime-service"); +``` + +```ts +// ES6+ example +import { LexRuntimeServiceClient, DeleteSessionCommand } from "@aws-sdk/client-lex-runtime-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LexRuntimeServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteSessionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-lex-runtime-service"; +const client = new AWS.LexRuntimeService({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteSession(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteSession(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteSession(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-lex-runtime-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-license-manager/README.md b/clients/client-license-manager/README.md index b0d3db700cb2..6dd9c59890f3 100644 --- a/clients/client-license-manager/README.md +++ b/clients/client-license-manager/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-license-manager/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-license-manager) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-license-manager.svg)](https://www.npmjs.com/package/@aws-sdk/client-license-manager) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript LicenseManager Client for Node.js, Browser and React Native. + + AWS License Manager + +

AWS License Manager makes it easier to manage licenses from software vendors across multiple +AWS accounts and on-premises servers.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-license-manager +using your favorite package manager: + +- `npm install @aws-sdk/client-license-manager` +- `yarn add @aws-sdk/client-license-manager` +- `pnpm add @aws-sdk/client-license-manager` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LicenseManagerClient` and +the commands you need, for example `AcceptGrantCommand`: + +```js +// ES5 example +const { LicenseManagerClient, AcceptGrantCommand } = require("@aws-sdk/client-license-manager"); +``` + +```ts +// ES6+ example +import { LicenseManagerClient, AcceptGrantCommand } from "@aws-sdk/client-license-manager"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LicenseManagerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptGrantCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-license-manager"; +const client = new AWS.LicenseManager({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptGrant(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptGrant(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptGrant(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-license-manager` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-lightsail/README.md b/clients/client-lightsail/README.md index c382b2561ca7..0fb932d57ac6 100644 --- a/clients/client-lightsail/README.md +++ b/clients/client-lightsail/README.md @@ -3,4 +3,215 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-lightsail/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-lightsail) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-lightsail.svg)](https://www.npmjs.com/package/@aws-sdk/client-lightsail) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Lightsail Client for Node.js, Browser and React Native. + +

Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for developers +who need to build websites or web applications. It includes everything you need to launch your +project quickly - instances (virtual private servers), container services, managed databases, +SSD-based block storage, static IP addresses, load balancers, content delivery network (CDN) +distributions, DNS management of registered domains, and resource snapshots (backups) - for a +low, predictable monthly price.

+ +

You can manage your Lightsail resources using the Lightsail console, Lightsail API, +AWS Command Line Interface (AWS CLI), or SDKs. For more information about Lightsail concepts +and tasks, see the Lightsail Dev Guide.

+ +

This API Reference provides detailed information about the actions, data types, +parameters, and errors of the Lightsail service. For more information about the supported +AWS Regions, endpoints, and service quotas of the Lightsail service, see Amazon Lightsail Endpoints and +Quotas in the AWS General Reference.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-lightsail +using your favorite package manager: + +- `npm install @aws-sdk/client-lightsail` +- `yarn add @aws-sdk/client-lightsail` +- `pnpm add @aws-sdk/client-lightsail` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LightsailClient` and +the commands you need, for example `AllocateStaticIpCommand`: + +```js +// ES5 example +const { LightsailClient, AllocateStaticIpCommand } = require("@aws-sdk/client-lightsail"); +``` + +```ts +// ES6+ example +import { LightsailClient, AllocateStaticIpCommand } from "@aws-sdk/client-lightsail"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LightsailClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AllocateStaticIpCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-lightsail"; +const client = new AWS.Lightsail({ region: "REGION" }); + +// async/await. +try { + const data = client.allocateStaticIp(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .allocateStaticIp(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.allocateStaticIp(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-lightsail` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-lookoutvision/README.md b/clients/client-lookoutvision/README.md index fa159c6f86da..3436b21e20f1 100644 --- a/clients/client-lookoutvision/README.md +++ b/clients/client-lookoutvision/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-lookoutvision/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-lookoutvision) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-lookoutvision.svg)](https://www.npmjs.com/package/@aws-sdk/client-lookoutvision) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript LookoutVision Client for Node.js, Browser and React Native. + +

This is the Amazon Lookout for Vision API Reference. It provides descriptions of actions, +data types, common parameters, and common errors.

+

Amazon Lookout for Vision enables you to find visual defects in industrial products, +accurately and at scale. It uses computer vision to identify missing components in an industrial product, +damage to vehicles or structures, irregularities in production lines, and even minuscule defects in +silicon wafers — or any other physical item where quality is important such as a missing capacitor +on printed circuit boards.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-lookoutvision +using your favorite package manager: + +- `npm install @aws-sdk/client-lookoutvision` +- `yarn add @aws-sdk/client-lookoutvision` +- `pnpm add @aws-sdk/client-lookoutvision` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `LookoutVisionClient` and +the commands you need, for example `CreateDatasetCommand`: + +```js +// ES5 example +const { LookoutVisionClient, CreateDatasetCommand } = require("@aws-sdk/client-lookoutvision"); +``` + +```ts +// ES6+ example +import { LookoutVisionClient, CreateDatasetCommand } from "@aws-sdk/client-lookoutvision"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new LookoutVisionClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDatasetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-lookoutvision"; +const client = new AWS.LookoutVision({ region: "REGION" }); + +// async/await. +try { + const data = client.createDataset(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDataset(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDataset(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-lookoutvision` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-machine-learning/README.md b/clients/client-machine-learning/README.md index a2c283d5af2a..9fa96c4333c3 100644 --- a/clients/client-machine-learning/README.md +++ b/clients/client-machine-learning/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-machine-learning/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-machine-learning) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-machine-learning.svg)](https://www.npmjs.com/package/@aws-sdk/client-machine-learning) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MachineLearning Client for Node.js, Browser and React Native. + +

Definition of the public APIs +exposed by Amazon Machine Learning

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-machine-learning +using your favorite package manager: + +- `npm install @aws-sdk/client-machine-learning` +- `yarn add @aws-sdk/client-machine-learning` +- `pnpm add @aws-sdk/client-machine-learning` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MachineLearningClient` and +the commands you need, for example `AddTagsCommand`: + +```js +// ES5 example +const { MachineLearningClient, AddTagsCommand } = require("@aws-sdk/client-machine-learning"); +``` + +```ts +// ES6+ example +import { MachineLearningClient, AddTagsCommand } from "@aws-sdk/client-machine-learning"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MachineLearningClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-machine-learning"; +const client = new AWS.MachineLearning({ region: "REGION" }); + +// async/await. +try { + const data = client.addTags(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTags(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTags(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-machine-learning` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-macie/README.md b/clients/client-macie/README.md index 082bf63a8201..152dfbd291cb 100644 --- a/clients/client-macie/README.md +++ b/clients/client-macie/README.md @@ -3,4 +3,212 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-macie/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-macie) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-macie.svg)](https://www.npmjs.com/package/@aws-sdk/client-macie) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Macie Client for Node.js, Browser and React Native. + +Amazon Macie Classic + +

Amazon Macie Classic is a security service that uses machine learning to automatically +discover, classify, and protect sensitive data in AWS. Macie Classic recognizes sensitive data +such as personally identifiable information (PII) or intellectual property, and provides you +with dashboards and alerts that give visibility into how this data is being accessed or moved. +For more information, see the Amazon Macie +Classic User Guide.

+

A new Amazon Macie is now available with significant design improvements and additional +features, at a lower price and in most AWS Regions. We encourage you to explore and use +the new and improved features, and benefit from the reduced cost. To learn about features and +pricing for the new Amazon Macie, see Amazon Macie.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-macie +using your favorite package manager: + +- `npm install @aws-sdk/client-macie` +- `yarn add @aws-sdk/client-macie` +- `pnpm add @aws-sdk/client-macie` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MacieClient` and +the commands you need, for example `AssociateMemberAccountCommand`: + +```js +// ES5 example +const { MacieClient, AssociateMemberAccountCommand } = require("@aws-sdk/client-macie"); +``` + +```ts +// ES6+ example +import { MacieClient, AssociateMemberAccountCommand } from "@aws-sdk/client-macie"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MacieClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateMemberAccountCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-macie"; +const client = new AWS.Macie({ region: "REGION" }); + +// async/await. +try { + const data = client.associateMemberAccount(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateMemberAccount(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateMemberAccount(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-macie` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-macie2/README.md b/clients/client-macie2/README.md index 6fda353e8e87..ddd3f805b635 100644 --- a/clients/client-macie2/README.md +++ b/clients/client-macie2/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-macie2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-macie2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-macie2.svg)](https://www.npmjs.com/package/@aws-sdk/client-macie2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Macie2 Client for Node.js, Browser and React Native. + +

Amazon Macie is a fully managed data security and data privacy service that uses machine learning and pattern matching to discover and protect your sensitive data in AWS. Macie automates the discovery of sensitive data, such as PII and intellectual property, to provide you with insight into the data that your organization stores in AWS. Macie also provides an inventory of your Amazon S3 buckets, which it continually monitors for you. If Macie detects sensitive data or potential data access issues, it generates detailed findings for you to review and act upon as necessary.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-macie2 +using your favorite package manager: + +- `npm install @aws-sdk/client-macie2` +- `yarn add @aws-sdk/client-macie2` +- `pnpm add @aws-sdk/client-macie2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `Macie2Client` and +the commands you need, for example `AcceptInvitationCommand`: + +```js +// ES5 example +const { Macie2Client, AcceptInvitationCommand } = require("@aws-sdk/client-macie2"); +``` + +```ts +// ES6+ example +import { Macie2Client, AcceptInvitationCommand } from "@aws-sdk/client-macie2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new Macie2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptInvitationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-macie2"; +const client = new AWS.Macie2({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptInvitation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptInvitation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptInvitation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-macie2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-managedblockchain/README.md b/clients/client-managedblockchain/README.md index 5a739f47b236..1e3c68e20be0 100644 --- a/clients/client-managedblockchain/README.md +++ b/clients/client-managedblockchain/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-managedblockchain/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-managedblockchain) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-managedblockchain.svg)](https://www.npmjs.com/package/@aws-sdk/client-managedblockchain) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ManagedBlockchain Client for Node.js, Browser and React Native. + +

+

Amazon Managed Blockchain is a fully managed service for creating and managing blockchain networks using open source frameworks. Blockchain allows you to build applications where multiple parties can securely and transparently run transactions and share data without the need for a trusted, central authority. Currently, Managed Blockchain supports the Hyperledger Fabric open source framework.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-managedblockchain +using your favorite package manager: + +- `npm install @aws-sdk/client-managedblockchain` +- `yarn add @aws-sdk/client-managedblockchain` +- `pnpm add @aws-sdk/client-managedblockchain` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ManagedBlockchainClient` and +the commands you need, for example `CreateMemberCommand`: + +```js +// ES5 example +const { ManagedBlockchainClient, CreateMemberCommand } = require("@aws-sdk/client-managedblockchain"); +``` + +```ts +// ES6+ example +import { ManagedBlockchainClient, CreateMemberCommand } from "@aws-sdk/client-managedblockchain"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ManagedBlockchainClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateMemberCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-managedblockchain"; +const client = new AWS.ManagedBlockchain({ region: "REGION" }); + +// async/await. +try { + const data = client.createMember(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createMember(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createMember(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-managedblockchain` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-marketplace-catalog/README.md b/clients/client-marketplace-catalog/README.md index eb284197094f..0da9188fb9b4 100644 --- a/clients/client-marketplace-catalog/README.md +++ b/clients/client-marketplace-catalog/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-marketplace-catalog/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-catalog) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-marketplace-catalog.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-catalog) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MarketplaceCatalog Client for Node.js, Browser and React Native. + +

Catalog API actions allow you to manage your entities through list, describe, and update +capabilities. An entity can be a product or an offer on AWS Marketplace.

+ +

You can automate your entity update process by integrating the AWS Marketplace Catalog +API with your AWS Marketplace product build or deployment pipelines. You can also create +your own applications on top of the Catalog API to manage your products on AWS +Marketplace.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-marketplace-catalog +using your favorite package manager: + +- `npm install @aws-sdk/client-marketplace-catalog` +- `yarn add @aws-sdk/client-marketplace-catalog` +- `pnpm add @aws-sdk/client-marketplace-catalog` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MarketplaceCatalogClient` and +the commands you need, for example `CancelChangeSetCommand`: + +```js +// ES5 example +const { MarketplaceCatalogClient, CancelChangeSetCommand } = require("@aws-sdk/client-marketplace-catalog"); +``` + +```ts +// ES6+ example +import { MarketplaceCatalogClient, CancelChangeSetCommand } from "@aws-sdk/client-marketplace-catalog"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MarketplaceCatalogClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelChangeSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-marketplace-catalog"; +const client = new AWS.MarketplaceCatalog({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelChangeSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelChangeSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelChangeSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-marketplace-catalog` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-marketplace-commerce-analytics/README.md b/clients/client-marketplace-commerce-analytics/README.md index 22a65afb0fd1..c795488ae9af 100644 --- a/clients/client-marketplace-commerce-analytics/README.md +++ b/clients/client-marketplace-commerce-analytics/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-marketplace-commerce-analytics/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-commerce-analytics) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-marketplace-commerce-analytics.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-commerce-analytics) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MarketplaceCommerceAnalytics Client for Node.js, Browser and React Native. + +Provides AWS Marketplace business intelligence data on-demand. + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-marketplace-commerce-analytics +using your favorite package manager: + +- `npm install @aws-sdk/client-marketplace-commerce-analytics` +- `yarn add @aws-sdk/client-marketplace-commerce-analytics` +- `pnpm add @aws-sdk/client-marketplace-commerce-analytics` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MarketplaceCommerceAnalyticsClient` and +the commands you need, for example `GenerateDataSetCommand`: + +```js +// ES5 example +const { + MarketplaceCommerceAnalyticsClient, + GenerateDataSetCommand, +} = require("@aws-sdk/client-marketplace-commerce-analytics"); +``` + +```ts +// ES6+ example +import { + MarketplaceCommerceAnalyticsClient, + GenerateDataSetCommand, +} from "@aws-sdk/client-marketplace-commerce-analytics"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MarketplaceCommerceAnalyticsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GenerateDataSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-marketplace-commerce-analytics"; +const client = new AWS.MarketplaceCommerceAnalytics({ region: "REGION" }); + +// async/await. +try { + const data = client.generateDataSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .generateDataSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.generateDataSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-marketplace-commerce-analytics` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-marketplace-entitlement-service/README.md b/clients/client-marketplace-entitlement-service/README.md index 56faf86d2e64..7a6c72d0ee0b 100644 --- a/clients/client-marketplace-entitlement-service/README.md +++ b/clients/client-marketplace-entitlement-service/README.md @@ -3,4 +3,224 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-marketplace-entitlement-service/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-entitlement-service) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-marketplace-entitlement-service.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-entitlement-service) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MarketplaceEntitlementService Client for Node.js, Browser and React Native. + +AWS Marketplace Entitlement Service + +

This reference provides descriptions of the AWS Marketplace Entitlement Service +API.

+

AWS Marketplace Entitlement Service is used to determine the entitlement of a customer to +a given product. An entitlement represents capacity in a product owned by the customer. For +example, a customer might own some number of users or seats in an SaaS application or some +amount of data capacity in a multi-tenant database.

+

+Getting Entitlement Records +

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-marketplace-entitlement-service +using your favorite package manager: + +- `npm install @aws-sdk/client-marketplace-entitlement-service` +- `yarn add @aws-sdk/client-marketplace-entitlement-service` +- `pnpm add @aws-sdk/client-marketplace-entitlement-service` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MarketplaceEntitlementServiceClient` and +the commands you need, for example `GetEntitlementsCommand`: + +```js +// ES5 example +const { + MarketplaceEntitlementServiceClient, + GetEntitlementsCommand, +} = require("@aws-sdk/client-marketplace-entitlement-service"); +``` + +```ts +// ES6+ example +import { + MarketplaceEntitlementServiceClient, + GetEntitlementsCommand, +} from "@aws-sdk/client-marketplace-entitlement-service"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MarketplaceEntitlementServiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetEntitlementsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-marketplace-entitlement-service"; +const client = new AWS.MarketplaceEntitlementService({ region: "REGION" }); + +// async/await. +try { + const data = client.getEntitlements(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getEntitlements(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getEntitlements(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-marketplace-entitlement-service` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-marketplace-metering/README.md b/clients/client-marketplace-metering/README.md index 82de5737079f..df3dbbb6c21c 100644 --- a/clients/client-marketplace-metering/README.md +++ b/clients/client-marketplace-metering/README.md @@ -3,4 +3,258 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-marketplace-metering/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-metering) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-marketplace-metering.svg)](https://www.npmjs.com/package/@aws-sdk/client-marketplace-metering) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MarketplaceMetering Client for Node.js, Browser and React Native. + +AWS Marketplace Metering Service + +

This reference provides descriptions of the low-level AWS Marketplace Metering +Service API.

+

AWS Marketplace sellers can use this API to submit usage data for custom usage +dimensions.

+

For information on the permissions you need to use this API, see +AWS Marketing metering and entitlement API permissions in the AWS Marketplace Seller Guide. +

+

+Submitting Metering Records +

+ +

+Accepting New Customers +

+ +

+Entitlement and Metering for Paid Container Products +

+ +

BatchMeterUsage API calls are captured by AWS CloudTrail. You can use Cloudtrail to +verify that the SaaS metering records that you sent are accurate by searching for +records with the eventName of BatchMeterUsage. You can also use CloudTrail to audit +records over time. For more information, see the +AWS CloudTrail User Guide +.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-marketplace-metering +using your favorite package manager: + +- `npm install @aws-sdk/client-marketplace-metering` +- `yarn add @aws-sdk/client-marketplace-metering` +- `pnpm add @aws-sdk/client-marketplace-metering` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MarketplaceMeteringClient` and +the commands you need, for example `BatchMeterUsageCommand`: + +```js +// ES5 example +const { MarketplaceMeteringClient, BatchMeterUsageCommand } = require("@aws-sdk/client-marketplace-metering"); +``` + +```ts +// ES6+ example +import { MarketplaceMeteringClient, BatchMeterUsageCommand } from "@aws-sdk/client-marketplace-metering"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MarketplaceMeteringClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchMeterUsageCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-marketplace-metering"; +const client = new AWS.MarketplaceMetering({ region: "REGION" }); + +// async/await. +try { + const data = client.batchMeterUsage(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchMeterUsage(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchMeterUsage(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-marketplace-metering` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediaconnect/README.md b/clients/client-mediaconnect/README.md index f8e4256dd277..8f90de1ed7ea 100644 --- a/clients/client-mediaconnect/README.md +++ b/clients/client-mediaconnect/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediaconnect/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediaconnect) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediaconnect.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediaconnect) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaConnect Client for Node.js, Browser and React Native. + +API for AWS Elemental MediaConnect + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediaconnect +using your favorite package manager: + +- `npm install @aws-sdk/client-mediaconnect` +- `yarn add @aws-sdk/client-mediaconnect` +- `pnpm add @aws-sdk/client-mediaconnect` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaConnectClient` and +the commands you need, for example `AddFlowOutputsCommand`: + +```js +// ES5 example +const { MediaConnectClient, AddFlowOutputsCommand } = require("@aws-sdk/client-mediaconnect"); +``` + +```ts +// ES6+ example +import { MediaConnectClient, AddFlowOutputsCommand } from "@aws-sdk/client-mediaconnect"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaConnectClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddFlowOutputsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediaconnect"; +const client = new AWS.MediaConnect({ region: "REGION" }); + +// async/await. +try { + const data = client.addFlowOutputs(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addFlowOutputs(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addFlowOutputs(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediaconnect` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediaconvert/README.md b/clients/client-mediaconvert/README.md index 2aa148abd5e0..81a14354e28d 100644 --- a/clients/client-mediaconvert/README.md +++ b/clients/client-mediaconvert/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediaconvert/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediaconvert) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediaconvert.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediaconvert) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaConvert Client for Node.js, Browser and React Native. + +AWS Elemental MediaConvert + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediaconvert +using your favorite package manager: + +- `npm install @aws-sdk/client-mediaconvert` +- `yarn add @aws-sdk/client-mediaconvert` +- `pnpm add @aws-sdk/client-mediaconvert` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaConvertClient` and +the commands you need, for example `AssociateCertificateCommand`: + +```js +// ES5 example +const { MediaConvertClient, AssociateCertificateCommand } = require("@aws-sdk/client-mediaconvert"); +``` + +```ts +// ES6+ example +import { MediaConvertClient, AssociateCertificateCommand } from "@aws-sdk/client-mediaconvert"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaConvertClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateCertificateCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediaconvert"; +const client = new AWS.MediaConvert({ region: "REGION" }); + +// async/await. +try { + const data = client.associateCertificate(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateCertificate(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateCertificate(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediaconvert` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-medialive/README.md b/clients/client-medialive/README.md index 37daafad2d4d..0968ae85bf6d 100644 --- a/clients/client-medialive/README.md +++ b/clients/client-medialive/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-medialive/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-medialive) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-medialive.svg)](https://www.npmjs.com/package/@aws-sdk/client-medialive) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaLive Client for Node.js, Browser and React Native. + +API for AWS Elemental MediaLive + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-medialive +using your favorite package manager: + +- `npm install @aws-sdk/client-medialive` +- `yarn add @aws-sdk/client-medialive` +- `pnpm add @aws-sdk/client-medialive` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaLiveClient` and +the commands you need, for example `AcceptInputDeviceTransferCommand`: + +```js +// ES5 example +const { MediaLiveClient, AcceptInputDeviceTransferCommand } = require("@aws-sdk/client-medialive"); +``` + +```ts +// ES6+ example +import { MediaLiveClient, AcceptInputDeviceTransferCommand } from "@aws-sdk/client-medialive"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaLiveClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptInputDeviceTransferCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-medialive"; +const client = new AWS.MediaLive({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptInputDeviceTransfer(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptInputDeviceTransfer(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptInputDeviceTransfer(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-medialive` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediapackage-vod/README.md b/clients/client-mediapackage-vod/README.md index bfb428abf948..c95d4dce8281 100644 --- a/clients/client-mediapackage-vod/README.md +++ b/clients/client-mediapackage-vod/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediapackage-vod/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediapackage-vod) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediapackage-vod.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediapackage-vod) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaPackageVod Client for Node.js, Browser and React Native. + +AWS Elemental MediaPackage VOD + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediapackage-vod +using your favorite package manager: + +- `npm install @aws-sdk/client-mediapackage-vod` +- `yarn add @aws-sdk/client-mediapackage-vod` +- `pnpm add @aws-sdk/client-mediapackage-vod` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaPackageVodClient` and +the commands you need, for example `CreateAssetCommand`: + +```js +// ES5 example +const { MediaPackageVodClient, CreateAssetCommand } = require("@aws-sdk/client-mediapackage-vod"); +``` + +```ts +// ES6+ example +import { MediaPackageVodClient, CreateAssetCommand } from "@aws-sdk/client-mediapackage-vod"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaPackageVodClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAssetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediapackage-vod"; +const client = new AWS.MediaPackageVod({ region: "REGION" }); + +// async/await. +try { + const data = client.createAsset(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAsset(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAsset(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediapackage-vod` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediapackage/README.md b/clients/client-mediapackage/README.md index 361ca0e39cd8..1d71714144f9 100644 --- a/clients/client-mediapackage/README.md +++ b/clients/client-mediapackage/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediapackage/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediapackage) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediapackage.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediapackage) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaPackage Client for Node.js, Browser and React Native. + +AWS Elemental MediaPackage + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediapackage +using your favorite package manager: + +- `npm install @aws-sdk/client-mediapackage` +- `yarn add @aws-sdk/client-mediapackage` +- `pnpm add @aws-sdk/client-mediapackage` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaPackageClient` and +the commands you need, for example `ConfigureLogsCommand`: + +```js +// ES5 example +const { MediaPackageClient, ConfigureLogsCommand } = require("@aws-sdk/client-mediapackage"); +``` + +```ts +// ES6+ example +import { MediaPackageClient, ConfigureLogsCommand } from "@aws-sdk/client-mediapackage"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaPackageClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ConfigureLogsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediapackage"; +const client = new AWS.MediaPackage({ region: "REGION" }); + +// async/await. +try { + const data = client.configureLogs(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .configureLogs(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.configureLogs(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediapackage` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediastore-data/README.md b/clients/client-mediastore-data/README.md index 1d8688d5fd94..98e7c9f8c94f 100644 --- a/clients/client-mediastore-data/README.md +++ b/clients/client-mediastore-data/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediastore-data/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediastore-data) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediastore-data.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediastore-data) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaStoreData Client for Node.js, Browser and React Native. + +

An AWS Elemental MediaStore asset is an object, similar to an object in the Amazon S3 +service. Objects are the fundamental entities that are stored in AWS Elemental +MediaStore.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediastore-data +using your favorite package manager: + +- `npm install @aws-sdk/client-mediastore-data` +- `yarn add @aws-sdk/client-mediastore-data` +- `pnpm add @aws-sdk/client-mediastore-data` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaStoreDataClient` and +the commands you need, for example `DeleteObjectCommand`: + +```js +// ES5 example +const { MediaStoreDataClient, DeleteObjectCommand } = require("@aws-sdk/client-mediastore-data"); +``` + +```ts +// ES6+ example +import { MediaStoreDataClient, DeleteObjectCommand } from "@aws-sdk/client-mediastore-data"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaStoreDataClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteObjectCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediastore-data"; +const client = new AWS.MediaStoreData({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteObject(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteObject(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteObject(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediastore-data` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediastore/README.md b/clients/client-mediastore/README.md index e95652aa86aa..b3af45eeeaa1 100644 --- a/clients/client-mediastore/README.md +++ b/clients/client-mediastore/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediastore/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediastore) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediastore.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediastore) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaStore Client for Node.js, Browser and React Native. + +

An AWS Elemental MediaStore container is a namespace that holds folders and objects. +You use a container endpoint to create, read, and delete objects.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediastore +using your favorite package manager: + +- `npm install @aws-sdk/client-mediastore` +- `yarn add @aws-sdk/client-mediastore` +- `pnpm add @aws-sdk/client-mediastore` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaStoreClient` and +the commands you need, for example `CreateContainerCommand`: + +```js +// ES5 example +const { MediaStoreClient, CreateContainerCommand } = require("@aws-sdk/client-mediastore"); +``` + +```ts +// ES6+ example +import { MediaStoreClient, CreateContainerCommand } from "@aws-sdk/client-mediastore"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaStoreClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateContainerCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediastore"; +const client = new AWS.MediaStore({ region: "REGION" }); + +// async/await. +try { + const data = client.createContainer(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createContainer(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createContainer(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediastore` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mediatailor/README.md b/clients/client-mediatailor/README.md index 7b45f91d93ea..9d4471b4520d 100644 --- a/clients/client-mediatailor/README.md +++ b/clients/client-mediatailor/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mediatailor/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediatailor) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mediatailor.svg)](https://www.npmjs.com/package/@aws-sdk/client-mediatailor) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MediaTailor Client for Node.js, Browser and React Native. + +

Use the AWS Elemental MediaTailor SDK to configure scalable ad insertion for your live and VOD content. With AWS Elemental MediaTailor, you can serve targeted ads to viewers while maintaining broadcast quality in over-the-top (OTT) video applications. For information about using the service, including detailed information about the settings covered in this guide, see the AWS Elemental MediaTailor User Guide.

Through the SDK, you manage AWS Elemental MediaTailor configurations the same as you do through the console. For example, you specify ad insertion behavior and mapping information for the origin server and the ad decision server (ADS).

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mediatailor +using your favorite package manager: + +- `npm install @aws-sdk/client-mediatailor` +- `yarn add @aws-sdk/client-mediatailor` +- `pnpm add @aws-sdk/client-mediatailor` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MediaTailorClient` and +the commands you need, for example `DeletePlaybackConfigurationCommand`: + +```js +// ES5 example +const { MediaTailorClient, DeletePlaybackConfigurationCommand } = require("@aws-sdk/client-mediatailor"); +``` + +```ts +// ES6+ example +import { MediaTailorClient, DeletePlaybackConfigurationCommand } from "@aws-sdk/client-mediatailor"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MediaTailorClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeletePlaybackConfigurationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mediatailor"; +const client = new AWS.MediaTailor({ region: "REGION" }); + +// async/await. +try { + const data = client.deletePlaybackConfiguration(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deletePlaybackConfiguration(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deletePlaybackConfiguration(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mediatailor` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-migration-hub/README.md b/clients/client-migration-hub/README.md index eb222d695ebd..658204bf04c1 100644 --- a/clients/client-migration-hub/README.md +++ b/clients/client-migration-hub/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-migration-hub/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-migration-hub) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-migration-hub.svg)](https://www.npmjs.com/package/@aws-sdk/client-migration-hub) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MigrationHub Client for Node.js, Browser and React Native. + +

The AWS Migration Hub API methods help to obtain server and application migration status +and integrate your resource-specific migration tool by providing a programmatic interface +to Migration Hub.

+

Remember that you must set your AWS Migration Hub home region before you call any of +these APIs, or a HomeRegionNotSetException error will be returned. Also, you +must make the API calls while in your home region.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-migration-hub +using your favorite package manager: + +- `npm install @aws-sdk/client-migration-hub` +- `yarn add @aws-sdk/client-migration-hub` +- `pnpm add @aws-sdk/client-migration-hub` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MigrationHubClient` and +the commands you need, for example `AssociateCreatedArtifactCommand`: + +```js +// ES5 example +const { MigrationHubClient, AssociateCreatedArtifactCommand } = require("@aws-sdk/client-migration-hub"); +``` + +```ts +// ES6+ example +import { MigrationHubClient, AssociateCreatedArtifactCommand } from "@aws-sdk/client-migration-hub"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MigrationHubClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateCreatedArtifactCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-migration-hub"; +const client = new AWS.MigrationHub({ region: "REGION" }); + +// async/await. +try { + const data = client.associateCreatedArtifact(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateCreatedArtifact(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateCreatedArtifact(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-migration-hub` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-migrationhub-config/README.md b/clients/client-migrationhub-config/README.md index 27e6f7d9ff64..1ceee682d696 100644 --- a/clients/client-migrationhub-config/README.md +++ b/clients/client-migrationhub-config/README.md @@ -3,4 +3,226 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-migrationhub-config/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-migrationhub-config) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-migrationhub-config.svg)](https://www.npmjs.com/package/@aws-sdk/client-migrationhub-config) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MigrationHubConfig Client for Node.js, Browser and React Native. + +

The AWS Migration Hub home region APIs are available specifically for working with your +Migration Hub home region. You can use these APIs to determine a home region, as well as to +create and work with controls that describe the home region.

+ + + +

For specific API usage, see the sections that follow in this AWS Migration Hub Home Region +API reference.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-migrationhub-config +using your favorite package manager: + +- `npm install @aws-sdk/client-migrationhub-config` +- `yarn add @aws-sdk/client-migrationhub-config` +- `pnpm add @aws-sdk/client-migrationhub-config` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MigrationHubConfigClient` and +the commands you need, for example `CreateHomeRegionControlCommand`: + +```js +// ES5 example +const { MigrationHubConfigClient, CreateHomeRegionControlCommand } = require("@aws-sdk/client-migrationhub-config"); +``` + +```ts +// ES6+ example +import { MigrationHubConfigClient, CreateHomeRegionControlCommand } from "@aws-sdk/client-migrationhub-config"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MigrationHubConfigClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateHomeRegionControlCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-migrationhub-config"; +const client = new AWS.MigrationHubConfig({ region: "REGION" }); + +// async/await. +try { + const data = client.createHomeRegionControl(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createHomeRegionControl(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createHomeRegionControl(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-migrationhub-config` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mobile/README.md b/clients/client-mobile/README.md index 2552befc799a..3a47bc15aed3 100644 --- a/clients/client-mobile/README.md +++ b/clients/client-mobile/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mobile/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mobile) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mobile.svg)](https://www.npmjs.com/package/@aws-sdk/client-mobile) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Mobile Client for Node.js, Browser and React Native. + +

+AWS Mobile Service provides mobile app and website developers with capabilities +required to configure AWS resources and bootstrap their developer desktop projects +with the necessary SDKs, constants, tools and samples to make use of those resources. +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mobile +using your favorite package manager: + +- `npm install @aws-sdk/client-mobile` +- `yarn add @aws-sdk/client-mobile` +- `pnpm add @aws-sdk/client-mobile` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MobileClient` and +the commands you need, for example `CreateProjectCommand`: + +```js +// ES5 example +const { MobileClient, CreateProjectCommand } = require("@aws-sdk/client-mobile"); +``` + +```ts +// ES6+ example +import { MobileClient, CreateProjectCommand } from "@aws-sdk/client-mobile"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MobileClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateProjectCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mobile"; +const client = new AWS.Mobile({ region: "REGION" }); + +// async/await. +try { + const data = client.createProject(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createProject(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createProject(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mobile` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mq/README.md b/clients/client-mq/README.md index b2985ea536cb..3ada8914c669 100644 --- a/clients/client-mq/README.md +++ b/clients/client-mq/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mq/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mq) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mq.svg)](https://www.npmjs.com/package/@aws-sdk/client-mq) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Mq Client for Node.js, Browser and React Native. + +Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that makes it easy to set up and operate message brokers in the cloud. A message broker allows software applications and components to communicate using various programming languages, operating systems, and formal messaging protocols. + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mq +using your favorite package manager: + +- `npm install @aws-sdk/client-mq` +- `yarn add @aws-sdk/client-mq` +- `pnpm add @aws-sdk/client-mq` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MqClient` and +the commands you need, for example `CreateBrokerCommand`: + +```js +// ES5 example +const { MqClient, CreateBrokerCommand } = require("@aws-sdk/client-mq"); +``` + +```ts +// ES6+ example +import { MqClient, CreateBrokerCommand } from "@aws-sdk/client-mq"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MqClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateBrokerCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mq"; +const client = new AWS.Mq({ region: "REGION" }); + +// async/await. +try { + const data = client.createBroker(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createBroker(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createBroker(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mq` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-mturk/README.md b/clients/client-mturk/README.md index dd0c6885596e..faac73dac1d5 100644 --- a/clients/client-mturk/README.md +++ b/clients/client-mturk/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-mturk/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-mturk) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-mturk.svg)](https://www.npmjs.com/package/@aws-sdk/client-mturk) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript MTurk Client for Node.js, Browser and React Native. + +Amazon Mechanical Turk API Reference + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-mturk +using your favorite package manager: + +- `npm install @aws-sdk/client-mturk` +- `yarn add @aws-sdk/client-mturk` +- `pnpm add @aws-sdk/client-mturk` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `MTurkClient` and +the commands you need, for example `AcceptQualificationRequestCommand`: + +```js +// ES5 example +const { MTurkClient, AcceptQualificationRequestCommand } = require("@aws-sdk/client-mturk"); +``` + +```ts +// ES6+ example +import { MTurkClient, AcceptQualificationRequestCommand } from "@aws-sdk/client-mturk"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new MTurkClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptQualificationRequestCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-mturk"; +const client = new AWS.MTurk({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptQualificationRequest(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptQualificationRequest(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptQualificationRequest(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-mturk` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-neptune/README.md b/clients/client-neptune/README.md index 34bae0330154..e607bf34aa55 100644 --- a/clients/client-neptune/README.md +++ b/clients/client-neptune/README.md @@ -3,4 +3,219 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-neptune/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-neptune) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-neptune.svg)](https://www.npmjs.com/package/@aws-sdk/client-neptune) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Neptune Client for Node.js, Browser and React Native. + +Amazon Neptune + +

Amazon Neptune is a fast, reliable, fully-managed graph database service that makes it +easy to build and run applications that work with highly connected datasets. The core of +Amazon Neptune is a purpose-built, high-performance graph database engine optimized for +storing billions of relationships and querying the graph with milliseconds latency. Amazon +Neptune supports popular graph models Property Graph and W3C's RDF, and their respective query +languages Apache TinkerPop Gremlin and SPARQL, allowing you to easily build queries that +efficiently navigate highly connected datasets. Neptune powers graph use cases such as +recommendation engines, fraud detection, knowledge graphs, drug discovery, and network +security.

+ +

This interface reference for Amazon Neptune contains documentation for a programming or +command line interface you can use to manage Amazon Neptune. Note that Amazon Neptune is +asynchronous, which means that some interfaces might require techniques such as polling or +callback functions to determine when a command has been applied. In this reference, the +parameter descriptions indicate whether a command is applied immediately, on the next instance +reboot, or during the maintenance window. The reference structure is as follows, and we list +following some related topics from the user guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-neptune +using your favorite package manager: + +- `npm install @aws-sdk/client-neptune` +- `yarn add @aws-sdk/client-neptune` +- `pnpm add @aws-sdk/client-neptune` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `NeptuneClient` and +the commands you need, for example `AddRoleToDBClusterCommand`: + +```js +// ES5 example +const { NeptuneClient, AddRoleToDBClusterCommand } = require("@aws-sdk/client-neptune"); +``` + +```ts +// ES6+ example +import { NeptuneClient, AddRoleToDBClusterCommand } from "@aws-sdk/client-neptune"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new NeptuneClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddRoleToDBClusterCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-neptune"; +const client = new AWS.Neptune({ region: "REGION" }); + +// async/await. +try { + const data = client.addRoleToDBCluster(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addRoleToDBCluster(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addRoleToDBCluster(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-neptune` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-network-firewall/README.md b/clients/client-network-firewall/README.md index f19d911f3f2d..817d884c3823 100644 --- a/clients/client-network-firewall/README.md +++ b/clients/client-network-firewall/README.md @@ -3,4 +3,280 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-network-firewall/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-network-firewall) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-network-firewall.svg)](https://www.npmjs.com/package/@aws-sdk/client-network-firewall) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript NetworkFirewall Client for Node.js, Browser and React Native. + +

This is the API Reference for AWS Network Firewall. This guide is for developers who need +detailed information about the Network Firewall API actions, data types, and errors.

+ +

Network Firewall is a stateful, managed, network firewall and intrusion detection and +prevention service for Amazon Virtual Private Cloud (Amazon VPC). With Network Firewall, you can filter traffic at the +perimeter of your VPC. This includes filtering traffic going to and coming from an internet +gateway, NAT gateway, or over VPN or AWS Direct Connect. Network Firewall uses rules that are compatible +with Suricata, a free, open source intrusion detection system (IDS) engine. For information about Suricata, +see the Suricata website.

+

You can use Network Firewall to monitor and protect your VPC traffic in a number of ways. +The following are just a few examples:

+ +

To enable Network Firewall for your VPCs, you perform steps in both Amazon VPC and in +Network Firewall. For information about using Amazon VPC, see Amazon VPC User Guide.

+

To start using Network Firewall, do the following:

+
    +
  1. +

    (Optional) If you don't already have a VPC that you want to protect, create it in +Amazon VPC.

    +
  2. +
  3. +

    In Amazon VPC, in each Availability Zone where you want to have a firewall endpoint, create a +subnet for the sole use of Network Firewall.

    +
  4. +
  5. +

    In Network Firewall, create stateless and stateful rule groups, +to define the components of the network traffic filtering behavior that you want your firewall to have.

    +
  6. +
  7. +

    In Network Firewall, create a firewall policy that uses your rule groups and +specifies additional default traffic filtering behavior.

    +
  8. +
  9. +

    In Network Firewall, create a firewall and specify your new firewall policy and +VPC subnets. Network Firewall creates a firewall endpoint in each subnet that you +specify, with the behavior that's defined in the firewall policy.

    +
  10. +
  11. +

    In Amazon VPC, use ingress routing enhancements to route traffic through the new firewall +endpoints.

    +
  12. +
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-network-firewall +using your favorite package manager: + +- `npm install @aws-sdk/client-network-firewall` +- `yarn add @aws-sdk/client-network-firewall` +- `pnpm add @aws-sdk/client-network-firewall` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `NetworkFirewallClient` and +the commands you need, for example `AssociateFirewallPolicyCommand`: + +```js +// ES5 example +const { NetworkFirewallClient, AssociateFirewallPolicyCommand } = require("@aws-sdk/client-network-firewall"); +``` + +```ts +// ES6+ example +import { NetworkFirewallClient, AssociateFirewallPolicyCommand } from "@aws-sdk/client-network-firewall"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new NetworkFirewallClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateFirewallPolicyCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-network-firewall"; +const client = new AWS.NetworkFirewall({ region: "REGION" }); + +// async/await. +try { + const data = client.associateFirewallPolicy(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateFirewallPolicy(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateFirewallPolicy(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-network-firewall` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-networkmanager/README.md b/clients/client-networkmanager/README.md index f26ffcc8abff..ca982e6eebea 100644 --- a/clients/client-networkmanager/README.md +++ b/clients/client-networkmanager/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-networkmanager/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-networkmanager) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-networkmanager.svg)](https://www.npmjs.com/package/@aws-sdk/client-networkmanager) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript NetworkManager Client for Node.js, Browser and React Native. + +

Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor your +AWS and on-premises networks that are built around transit gateways.

+

The Network Manager APIs are supported in the US West (Oregon) Region only. You must specify the us-west-2 Region in all requests made to Network Manager.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-networkmanager +using your favorite package manager: + +- `npm install @aws-sdk/client-networkmanager` +- `yarn add @aws-sdk/client-networkmanager` +- `pnpm add @aws-sdk/client-networkmanager` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `NetworkManagerClient` and +the commands you need, for example `AssociateCustomerGatewayCommand`: + +```js +// ES5 example +const { NetworkManagerClient, AssociateCustomerGatewayCommand } = require("@aws-sdk/client-networkmanager"); +``` + +```ts +// ES6+ example +import { NetworkManagerClient, AssociateCustomerGatewayCommand } from "@aws-sdk/client-networkmanager"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new NetworkManagerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateCustomerGatewayCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-networkmanager"; +const client = new AWS.NetworkManager({ region: "REGION" }); + +// async/await. +try { + const data = client.associateCustomerGateway(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateCustomerGateway(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateCustomerGateway(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-networkmanager` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-opsworks/README.md b/clients/client-opsworks/README.md index 3572a71ad3e3..9c41845faf26 100644 --- a/clients/client-opsworks/README.md +++ b/clients/client-opsworks/README.md @@ -3,4 +3,316 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-opsworks/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-opsworks) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-opsworks.svg)](https://www.npmjs.com/package/@aws-sdk/client-opsworks) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript OpsWorks Client for Node.js, Browser and React Native. + +AWS OpsWorks + +

Welcome to the AWS OpsWorks Stacks API Reference. This guide provides descriptions, syntax, and +usage examples for AWS OpsWorks Stacks actions and data types, including common parameters and error +codes.

+

AWS OpsWorks Stacks is an application management service that provides an integrated experience for +overseeing the complete application lifecycle. For information about this product, go to the +AWS OpsWorks details page.

+ +

+SDKs and CLI +

+

The most common way to use the AWS OpsWorks Stacks API is by using the AWS Command Line Interface (CLI) or by using one of the AWS SDKs to implement applications in your preferred language. For more information, see:

+ + +

+Endpoints +

+

AWS OpsWorks Stacks supports the following endpoints, all HTTPS. You must connect to one of the following endpoints. Stacks +can only be accessed or managed within the endpoint in which they are created.

+ +

+Chef Versions +

+

When you call CreateStack, CloneStack, or UpdateStack we recommend you +use the ConfigurationManager parameter to specify the Chef version. +The recommended and default value for Linux stacks is currently 12. Windows stacks use Chef 12.2. For more information, +see Chef Versions.

+ +

You can specify Chef 12, 11.10, or 11.4 for your Linux stack. We recommend migrating your existing Linux stacks to Chef 12 as soon as possible.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-opsworks +using your favorite package manager: + +- `npm install @aws-sdk/client-opsworks` +- `yarn add @aws-sdk/client-opsworks` +- `pnpm add @aws-sdk/client-opsworks` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `OpsWorksClient` and +the commands you need, for example `AssignInstanceCommand`: + +```js +// ES5 example +const { OpsWorksClient, AssignInstanceCommand } = require("@aws-sdk/client-opsworks"); +``` + +```ts +// ES6+ example +import { OpsWorksClient, AssignInstanceCommand } from "@aws-sdk/client-opsworks"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new OpsWorksClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssignInstanceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-opsworks"; +const client = new AWS.OpsWorks({ region: "REGION" }); + +// async/await. +try { + const data = client.assignInstance(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .assignInstance(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.assignInstance(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-opsworks` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-opsworkscm/README.md b/clients/client-opsworkscm/README.md index df28c5d94677..9a43d269f8f7 100644 --- a/clients/client-opsworkscm/README.md +++ b/clients/client-opsworkscm/README.md @@ -3,4 +3,289 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-opsworkscm/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-opsworkscm) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-opsworkscm.svg)](https://www.npmjs.com/package/@aws-sdk/client-opsworkscm) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript OpsWorksCM Client for Node.js, Browser and React Native. + +AWS OpsWorks CM + +

AWS OpsWorks for configuration management (CM) is a service that runs and manages +configuration management servers. You can use AWS OpsWorks CM to create and manage AWS +OpsWorks for Chef Automate and AWS OpsWorks for Puppet Enterprise servers, and add or remove +nodes for the servers to manage.

+

+Glossary of terms +

+ +

+Endpoints +

+

AWS OpsWorks CM supports the following endpoints, all HTTPS. You must connect to one of the following endpoints. Your servers +can only be accessed or managed within the endpoint in which they are created.

+ +

For more information, see AWS OpsWorks endpoints and quotas in the AWS General Reference.

+

+Throttling limits +

+

All API operations allow for five requests per second with a burst of 10 requests per second.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-opsworkscm +using your favorite package manager: + +- `npm install @aws-sdk/client-opsworkscm` +- `yarn add @aws-sdk/client-opsworkscm` +- `pnpm add @aws-sdk/client-opsworkscm` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `OpsWorksCMClient` and +the commands you need, for example `AssociateNodeCommand`: + +```js +// ES5 example +const { OpsWorksCMClient, AssociateNodeCommand } = require("@aws-sdk/client-opsworkscm"); +``` + +```ts +// ES6+ example +import { OpsWorksCMClient, AssociateNodeCommand } from "@aws-sdk/client-opsworkscm"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new OpsWorksCMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateNodeCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-opsworkscm"; +const client = new AWS.OpsWorksCM({ region: "REGION" }); + +// async/await. +try { + const data = client.associateNode(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateNode(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateNode(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-opsworkscm` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-organizations/README.md b/clients/client-organizations/README.md index 916b0763d949..16908f77b89f 100644 --- a/clients/client-organizations/README.md +++ b/clients/client-organizations/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-organizations/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-organizations) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-organizations.svg)](https://www.npmjs.com/package/@aws-sdk/client-organizations) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Organizations Client for Node.js, Browser and React Native. + +AWS Organizations + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-organizations +using your favorite package manager: + +- `npm install @aws-sdk/client-organizations` +- `yarn add @aws-sdk/client-organizations` +- `pnpm add @aws-sdk/client-organizations` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `OrganizationsClient` and +the commands you need, for example `AcceptHandshakeCommand`: + +```js +// ES5 example +const { OrganizationsClient, AcceptHandshakeCommand } = require("@aws-sdk/client-organizations"); +``` + +```ts +// ES6+ example +import { OrganizationsClient, AcceptHandshakeCommand } from "@aws-sdk/client-organizations"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new OrganizationsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptHandshakeCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-organizations"; +const client = new AWS.Organizations({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptHandshake(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptHandshake(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptHandshake(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-organizations` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-outposts/README.md b/clients/client-outposts/README.md index 322f23a694c0..b42b7ff01267 100644 --- a/clients/client-outposts/README.md +++ b/clients/client-outposts/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-outposts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-outposts) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-outposts.svg)](https://www.npmjs.com/package/@aws-sdk/client-outposts) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Outposts Client for Node.js, Browser and React Native. + +

AWS Outposts is a fully-managed service that extends AWS infrastructure, +APIs, and tools to customer premises. By providing local access to AWS-managed +infrastructure, AWS Outposts enables customers to build and run applications +on premises using the same programming interfaces as in AWS Regions, while +using local compute and storage resources for lower latency and local data +processing needs.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-outposts +using your favorite package manager: + +- `npm install @aws-sdk/client-outposts` +- `yarn add @aws-sdk/client-outposts` +- `pnpm add @aws-sdk/client-outposts` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `OutpostsClient` and +the commands you need, for example `CreateOutpostCommand`: + +```js +// ES5 example +const { OutpostsClient, CreateOutpostCommand } = require("@aws-sdk/client-outposts"); +``` + +```ts +// ES6+ example +import { OutpostsClient, CreateOutpostCommand } from "@aws-sdk/client-outposts"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new OutpostsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateOutpostCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-outposts"; +const client = new AWS.Outposts({ region: "REGION" }); + +// async/await. +try { + const data = client.createOutpost(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createOutpost(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createOutpost(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-outposts` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-personalize-events/README.md b/clients/client-personalize-events/README.md index 4f9f8152d79e..158d1a829e18 100644 --- a/clients/client-personalize-events/README.md +++ b/clients/client-personalize-events/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-personalize-events/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-personalize-events) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-personalize-events.svg)](https://www.npmjs.com/package/@aws-sdk/client-personalize-events) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript PersonalizeEvents Client for Node.js, Browser and React Native. + +

Amazon Personalize can consume real-time user event data, such as stream or click data, and use +it for model training either alone or combined with historical data. For more information see recording-events.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-personalize-events +using your favorite package manager: + +- `npm install @aws-sdk/client-personalize-events` +- `yarn add @aws-sdk/client-personalize-events` +- `pnpm add @aws-sdk/client-personalize-events` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PersonalizeEventsClient` and +the commands you need, for example `PutEventsCommand`: + +```js +// ES5 example +const { PersonalizeEventsClient, PutEventsCommand } = require("@aws-sdk/client-personalize-events"); +``` + +```ts +// ES6+ example +import { PersonalizeEventsClient, PutEventsCommand } from "@aws-sdk/client-personalize-events"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PersonalizeEventsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new PutEventsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-personalize-events"; +const client = new AWS.PersonalizeEvents({ region: "REGION" }); + +// async/await. +try { + const data = client.putEvents(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .putEvents(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.putEvents(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-personalize-events` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-personalize-runtime/README.md b/clients/client-personalize-runtime/README.md index 3a32305ec7d1..2c45593317b4 100644 --- a/clients/client-personalize-runtime/README.md +++ b/clients/client-personalize-runtime/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-personalize-runtime/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-personalize-runtime) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-personalize-runtime.svg)](https://www.npmjs.com/package/@aws-sdk/client-personalize-runtime) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript PersonalizeRuntime Client for Node.js, Browser and React Native. + +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-personalize-runtime +using your favorite package manager: + +- `npm install @aws-sdk/client-personalize-runtime` +- `yarn add @aws-sdk/client-personalize-runtime` +- `pnpm add @aws-sdk/client-personalize-runtime` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PersonalizeRuntimeClient` and +the commands you need, for example `GetPersonalizedRankingCommand`: + +```js +// ES5 example +const { PersonalizeRuntimeClient, GetPersonalizedRankingCommand } = require("@aws-sdk/client-personalize-runtime"); +``` + +```ts +// ES6+ example +import { PersonalizeRuntimeClient, GetPersonalizedRankingCommand } from "@aws-sdk/client-personalize-runtime"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PersonalizeRuntimeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetPersonalizedRankingCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-personalize-runtime"; +const client = new AWS.PersonalizeRuntime({ region: "REGION" }); + +// async/await. +try { + const data = client.getPersonalizedRanking(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getPersonalizedRanking(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getPersonalizedRanking(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-personalize-runtime` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-personalize/README.md b/clients/client-personalize/README.md index 3c9514cb3e42..5ccf89560931 100644 --- a/clients/client-personalize/README.md +++ b/clients/client-personalize/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-personalize/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-personalize) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-personalize.svg)](https://www.npmjs.com/package/@aws-sdk/client-personalize) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Personalize Client for Node.js, Browser and React Native. + +

Amazon Personalize is a machine learning service that makes it easy to add individualized +recommendations to customers.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-personalize +using your favorite package manager: + +- `npm install @aws-sdk/client-personalize` +- `yarn add @aws-sdk/client-personalize` +- `pnpm add @aws-sdk/client-personalize` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PersonalizeClient` and +the commands you need, for example `CreateBatchInferenceJobCommand`: + +```js +// ES5 example +const { PersonalizeClient, CreateBatchInferenceJobCommand } = require("@aws-sdk/client-personalize"); +``` + +```ts +// ES6+ example +import { PersonalizeClient, CreateBatchInferenceJobCommand } from "@aws-sdk/client-personalize"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PersonalizeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateBatchInferenceJobCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-personalize"; +const client = new AWS.Personalize({ region: "REGION" }); + +// async/await. +try { + const data = client.createBatchInferenceJob(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createBatchInferenceJob(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createBatchInferenceJob(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-personalize` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-pi/README.md b/clients/client-pi/README.md index 84ceba5d4659..1e07dee39e7e 100644 --- a/clients/client-pi/README.md +++ b/clients/client-pi/README.md @@ -3,4 +3,214 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-pi/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-pi) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-pi.svg)](https://www.npmjs.com/package/@aws-sdk/client-pi) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript PI Client for Node.js, Browser and React Native. + +

AWS Performance Insights enables you to monitor and explore different dimensions of +database load based on data captured from a running RDS instance. The guide provides detailed +information about Performance Insights data types, parameters and errors. For more information +about Performance Insights capabilities see Using Amazon RDS Performance +Insights in the Amazon RDS User Guide.

+ +

The AWS Performance Insights API provides visibility into the performance of your RDS +instance, when Performance Insights is enabled for supported engine types. While Amazon +CloudWatch provides the authoritative source for AWS service vended monitoring metrics, AWS +Performance Insights offers a domain-specific view of database load measured as Average Active +Sessions and provided to API consumers as a 2-dimensional time-series dataset. The time +dimension of the data provides DB load data for each time point in the queried time range, and +each time point decomposes overall load in relation to the requested dimensions, such as SQL, +Wait-event, User or Host, measured at that time point.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-pi +using your favorite package manager: + +- `npm install @aws-sdk/client-pi` +- `yarn add @aws-sdk/client-pi` +- `pnpm add @aws-sdk/client-pi` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PIClient` and +the commands you need, for example `DescribeDimensionKeysCommand`: + +```js +// ES5 example +const { PIClient, DescribeDimensionKeysCommand } = require("@aws-sdk/client-pi"); +``` + +```ts +// ES6+ example +import { PIClient, DescribeDimensionKeysCommand } from "@aws-sdk/client-pi"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PIClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeDimensionKeysCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-pi"; +const client = new AWS.PI({ region: "REGION" }); + +// async/await. +try { + const data = client.describeDimensionKeys(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeDimensionKeys(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeDimensionKeys(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-pi` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-pinpoint-email/README.md b/clients/client-pinpoint-email/README.md index 9ac6f016ac03..ccc18fbb0d95 100644 --- a/clients/client-pinpoint-email/README.md +++ b/clients/client-pinpoint-email/README.md @@ -3,4 +3,230 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-pinpoint-email/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-pinpoint-email) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-pinpoint-email.svg)](https://www.npmjs.com/package/@aws-sdk/client-pinpoint-email) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript PinpointEmail Client for Node.js, Browser and React Native. + +Amazon Pinpoint Email Service + +

Welcome to the Amazon Pinpoint Email API Reference. This guide provides +information about the Amazon Pinpoint Email API (version 1.0), including supported +operations, data types, parameters, and schemas.

+

+Amazon Pinpoint is an AWS service that you +can use to engage with your customers across multiple messaging channels. You can use +Amazon Pinpoint to send email, SMS text messages, voice messages, and push notifications. The +Amazon Pinpoint Email API provides programmatic access to options that are unique to the +email channel and supplement the options provided by the Amazon Pinpoint API.

+

If you're new to Amazon Pinpoint, you might find it helpful to also review the Amazon +Pinpoint Developer Guide. The Amazon Pinpoint Developer +Guide provides tutorials, code samples, and procedures that demonstrate +how to use Amazon Pinpoint features programmatically and how to integrate Amazon Pinpoint functionality into +mobile apps and other types of applications. The guide also provides information about +key topics such as Amazon Pinpoint integration with other AWS services and the limits that apply +to using the service.

+

The Amazon Pinpoint Email API is available in several AWS Regions and it provides an endpoint +for each of these Regions. For a list of all the Regions and endpoints where the API is +currently available, see AWS Service Endpoints in +the Amazon Web Services General Reference. To learn more about AWS Regions, see +Managing AWS +Regions in the Amazon Web Services General Reference.

+

In each Region, AWS maintains multiple Availability Zones. These Availability Zones +are physically isolated from each other, but are united by private, low-latency, +high-throughput, and highly redundant network connections. These Availability Zones +enable us to provide very high levels of availability and redundancy, while also +minimizing latency. To learn more about the number of Availability Zones that are +available in each Region, see AWS Global Infrastructure.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-pinpoint-email +using your favorite package manager: + +- `npm install @aws-sdk/client-pinpoint-email` +- `yarn add @aws-sdk/client-pinpoint-email` +- `pnpm add @aws-sdk/client-pinpoint-email` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PinpointEmailClient` and +the commands you need, for example `CreateConfigurationSetCommand`: + +```js +// ES5 example +const { PinpointEmailClient, CreateConfigurationSetCommand } = require("@aws-sdk/client-pinpoint-email"); +``` + +```ts +// ES6+ example +import { PinpointEmailClient, CreateConfigurationSetCommand } from "@aws-sdk/client-pinpoint-email"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PinpointEmailClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateConfigurationSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-pinpoint-email"; +const client = new AWS.PinpointEmail({ region: "REGION" }); + +// async/await. +try { + const data = client.createConfigurationSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createConfigurationSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createConfigurationSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-pinpoint-email` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-pinpoint-sms-voice/README.md b/clients/client-pinpoint-sms-voice/README.md index 79061147b5c3..185f5b51bde2 100644 --- a/clients/client-pinpoint-sms-voice/README.md +++ b/clients/client-pinpoint-sms-voice/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-pinpoint-sms-voice/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-pinpoint-sms-voice) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-pinpoint-sms-voice.svg)](https://www.npmjs.com/package/@aws-sdk/client-pinpoint-sms-voice) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript PinpointSMSVoice Client for Node.js, Browser and React Native. + +Pinpoint SMS and Voice Messaging public facing APIs + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-pinpoint-sms-voice +using your favorite package manager: + +- `npm install @aws-sdk/client-pinpoint-sms-voice` +- `yarn add @aws-sdk/client-pinpoint-sms-voice` +- `pnpm add @aws-sdk/client-pinpoint-sms-voice` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PinpointSMSVoiceClient` and +the commands you need, for example `CreateConfigurationSetCommand`: + +```js +// ES5 example +const { PinpointSMSVoiceClient, CreateConfigurationSetCommand } = require("@aws-sdk/client-pinpoint-sms-voice"); +``` + +```ts +// ES6+ example +import { PinpointSMSVoiceClient, CreateConfigurationSetCommand } from "@aws-sdk/client-pinpoint-sms-voice"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PinpointSMSVoiceClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateConfigurationSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-pinpoint-sms-voice"; +const client = new AWS.PinpointSMSVoice({ region: "REGION" }); + +// async/await. +try { + const data = client.createConfigurationSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createConfigurationSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createConfigurationSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-pinpoint-sms-voice` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-pinpoint/README.md b/clients/client-pinpoint/README.md index b0848d324660..41c6c8d8a684 100644 --- a/clients/client-pinpoint/README.md +++ b/clients/client-pinpoint/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-pinpoint/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-pinpoint) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-pinpoint.svg)](https://www.npmjs.com/package/@aws-sdk/client-pinpoint) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Pinpoint Client for Node.js, Browser and React Native. + +

Doc Engage API - Amazon Pinpoint API

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-pinpoint +using your favorite package manager: + +- `npm install @aws-sdk/client-pinpoint` +- `yarn add @aws-sdk/client-pinpoint` +- `pnpm add @aws-sdk/client-pinpoint` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PinpointClient` and +the commands you need, for example `CreateAppCommand`: + +```js +// ES5 example +const { PinpointClient, CreateAppCommand } = require("@aws-sdk/client-pinpoint"); +``` + +```ts +// ES6+ example +import { PinpointClient, CreateAppCommand } from "@aws-sdk/client-pinpoint"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PinpointClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAppCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-pinpoint"; +const client = new AWS.Pinpoint({ region: "REGION" }); + +// async/await. +try { + const data = client.createApp(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApp(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApp(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-pinpoint` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-polly/README.md b/clients/client-polly/README.md index 26f7a30ee668..70953c9e9e6b 100644 --- a/clients/client-polly/README.md +++ b/clients/client-polly/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-polly/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-polly) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-polly.svg)](https://www.npmjs.com/package/@aws-sdk/client-polly) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Polly Client for Node.js, Browser and React Native. + +

Amazon Polly is a web service that makes it easy to synthesize speech from +text.

+

The Amazon Polly service provides API operations for synthesizing high-quality speech +from plain text and Speech Synthesis Markup Language (SSML), along with managing +pronunciations lexicons that enable you to get the best results for your application +domain.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-polly +using your favorite package manager: + +- `npm install @aws-sdk/client-polly` +- `yarn add @aws-sdk/client-polly` +- `pnpm add @aws-sdk/client-polly` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PollyClient` and +the commands you need, for example `DeleteLexiconCommand`: + +```js +// ES5 example +const { PollyClient, DeleteLexiconCommand } = require("@aws-sdk/client-polly"); +``` + +```ts +// ES6+ example +import { PollyClient, DeleteLexiconCommand } from "@aws-sdk/client-polly"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PollyClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteLexiconCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-polly"; +const client = new AWS.Polly({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteLexicon(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteLexicon(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteLexicon(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-polly` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-pricing/README.md b/clients/client-pricing/README.md index 6dd4566d7226..75ca08a6c40f 100644 --- a/clients/client-pricing/README.md +++ b/clients/client-pricing/README.md @@ -3,4 +3,224 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-pricing/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-pricing) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-pricing.svg)](https://www.npmjs.com/package/@aws-sdk/client-pricing) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Pricing Client for Node.js, Browser and React Native. + +

AWS Price List Service API (AWS Price List Service) is a centralized and convenient way to +programmatically query Amazon Web Services for services, products, and pricing information. The AWS Price List Service +uses standardized product attributes such as Location, Storage +Class, and Operating System, and provides prices at the SKU +level. You can use the AWS Price List Service to build cost control and scenario planning tools, reconcile +billing data, forecast future spend for budgeting purposes, and provide cost benefit +analysis that compare your internal workloads with AWS.

+

Use GetServices without a service code to retrieve the service codes for all AWS services, then +GetServices with a service code to retreive the attribute names for +that service. After you have the service code and attribute names, you can use GetAttributeValues +to see what values are available for an attribute. With the service code and an attribute name and value, +you can use GetProducts to find specific products that you're interested in, such as +an AmazonEC2 instance, with a Provisioned IOPS +volumeType.

+

Service Endpoint

+

AWS Price List Service API provides the following two endpoints:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-pricing +using your favorite package manager: + +- `npm install @aws-sdk/client-pricing` +- `yarn add @aws-sdk/client-pricing` +- `pnpm add @aws-sdk/client-pricing` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `PricingClient` and +the commands you need, for example `DescribeServicesCommand`: + +```js +// ES5 example +const { PricingClient, DescribeServicesCommand } = require("@aws-sdk/client-pricing"); +``` + +```ts +// ES6+ example +import { PricingClient, DescribeServicesCommand } from "@aws-sdk/client-pricing"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new PricingClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeServicesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-pricing"; +const client = new AWS.Pricing({ region: "REGION" }); + +// async/await. +try { + const data = client.describeServices(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeServices(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeServices(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-pricing` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-qldb-session/README.md b/clients/client-qldb-session/README.md index 9c09c89a1778..af7df987dcff 100644 --- a/clients/client-qldb-session/README.md +++ b/clients/client-qldb-session/README.md @@ -3,4 +3,221 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-qldb-session/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-qldb-session) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-qldb-session.svg)](https://www.npmjs.com/package/@aws-sdk/client-qldb-session) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript QLDBSession Client for Node.js, Browser and React Native. + +

The transactional data APIs for Amazon QLDB

+ +

Instead of interacting directly with this API, we recommend that you use the +Amazon QLDB Driver or the QLDB Shell to execute data transactions on a ledger.

+ +
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-qldb-session +using your favorite package manager: + +- `npm install @aws-sdk/client-qldb-session` +- `yarn add @aws-sdk/client-qldb-session` +- `pnpm add @aws-sdk/client-qldb-session` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `QLDBSessionClient` and +the commands you need, for example `SendCommandCommand`: + +```js +// ES5 example +const { QLDBSessionClient, SendCommandCommand } = require("@aws-sdk/client-qldb-session"); +``` + +```ts +// ES6+ example +import { QLDBSessionClient, SendCommandCommand } from "@aws-sdk/client-qldb-session"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new QLDBSessionClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new SendCommandCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-qldb-session"; +const client = new AWS.QLDBSession({ region: "REGION" }); + +// async/await. +try { + const data = client.sendCommand(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .sendCommand(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.sendCommand(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-qldb-session` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-qldb/README.md b/clients/client-qldb/README.md index 5aa595c91a55..bc613adab9f1 100644 --- a/clients/client-qldb/README.md +++ b/clients/client-qldb/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-qldb/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-qldb) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-qldb.svg)](https://www.npmjs.com/package/@aws-sdk/client-qldb) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript QLDB Client for Node.js, Browser and React Native. + +

The control plane for Amazon QLDB

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-qldb +using your favorite package manager: + +- `npm install @aws-sdk/client-qldb` +- `yarn add @aws-sdk/client-qldb` +- `pnpm add @aws-sdk/client-qldb` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `QLDBClient` and +the commands you need, for example `CancelJournalKinesisStreamCommand`: + +```js +// ES5 example +const { QLDBClient, CancelJournalKinesisStreamCommand } = require("@aws-sdk/client-qldb"); +``` + +```ts +// ES6+ example +import { QLDBClient, CancelJournalKinesisStreamCommand } from "@aws-sdk/client-qldb"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new QLDBClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelJournalKinesisStreamCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-qldb"; +const client = new AWS.QLDB({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelJournalKinesisStream(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelJournalKinesisStream(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelJournalKinesisStream(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-qldb` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-quicksight/README.md b/clients/client-quicksight/README.md index 5753b52176e7..27eced5ccd83 100644 --- a/clients/client-quicksight/README.md +++ b/clients/client-quicksight/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-quicksight/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-quicksight) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-quicksight.svg)](https://www.npmjs.com/package/@aws-sdk/client-quicksight) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript QuickSight Client for Node.js, Browser and React Native. + +Amazon QuickSight API Reference + +

Amazon QuickSight is a fully managed, serverless business intelligence service for the +AWS Cloud that makes it easy to extend data and insights to every user in your +organization. This API reference contains documentation for a programming interface that +you can use to manage Amazon QuickSight.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-quicksight +using your favorite package manager: + +- `npm install @aws-sdk/client-quicksight` +- `yarn add @aws-sdk/client-quicksight` +- `pnpm add @aws-sdk/client-quicksight` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `QuickSightClient` and +the commands you need, for example `CancelIngestionCommand`: + +```js +// ES5 example +const { QuickSightClient, CancelIngestionCommand } = require("@aws-sdk/client-quicksight"); +``` + +```ts +// ES6+ example +import { QuickSightClient, CancelIngestionCommand } from "@aws-sdk/client-quicksight"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new QuickSightClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelIngestionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-quicksight"; +const client = new AWS.QuickSight({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelIngestion(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelIngestion(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelIngestion(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-quicksight` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ram/README.md b/clients/client-ram/README.md index 96ccce00292b..aba470be3c99 100644 --- a/clients/client-ram/README.md +++ b/clients/client-ram/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ram/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ram) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ram.svg)](https://www.npmjs.com/package/@aws-sdk/client-ram) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RAM Client for Node.js, Browser and React Native. + +

Use AWS Resource Access Manager to share AWS resources between AWS accounts. To share a resource, you +create a resource share, associate the resource with the resource share, and specify the principals that +can access the resources associated with the resource share. The following principals are supported: +AWS accounts, organizational units (OU) from AWS Organizations, and organizations from +AWS Organizations.

+

For more information, see the AWS Resource Access Manager User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ram +using your favorite package manager: + +- `npm install @aws-sdk/client-ram` +- `yarn add @aws-sdk/client-ram` +- `pnpm add @aws-sdk/client-ram` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RAMClient` and +the commands you need, for example `AcceptResourceShareInvitationCommand`: + +```js +// ES5 example +const { RAMClient, AcceptResourceShareInvitationCommand } = require("@aws-sdk/client-ram"); +``` + +```ts +// ES6+ example +import { RAMClient, AcceptResourceShareInvitationCommand } from "@aws-sdk/client-ram"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RAMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptResourceShareInvitationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ram"; +const client = new AWS.RAM({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptResourceShareInvitation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptResourceShareInvitation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptResourceShareInvitation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ram` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-rds-data/README.md b/clients/client-rds-data/README.md index a0ecbbf3c112..b088c1a6e0db 100644 --- a/clients/client-rds-data/README.md +++ b/clients/client-rds-data/README.md @@ -3,4 +3,211 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-rds-data/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds-data) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-rds-data.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds-data) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RDSData Client for Node.js, Browser and React Native. + +Amazon RDS Data Service + +

Amazon RDS provides an HTTP endpoint to run SQL statements on an Amazon Aurora +Serverless DB cluster. To run these statements, you work with the Data Service +API.

+

For more information about the Data Service API, see Using the Data API for Aurora +Serverless in the Amazon Aurora User Guide.

+ +

If you have questions or comments related to the Data API, send email to +Rds-data-api-feedback@amazon.com.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-rds-data +using your favorite package manager: + +- `npm install @aws-sdk/client-rds-data` +- `yarn add @aws-sdk/client-rds-data` +- `pnpm add @aws-sdk/client-rds-data` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RDSDataClient` and +the commands you need, for example `BatchExecuteStatementCommand`: + +```js +// ES5 example +const { RDSDataClient, BatchExecuteStatementCommand } = require("@aws-sdk/client-rds-data"); +``` + +```ts +// ES6+ example +import { RDSDataClient, BatchExecuteStatementCommand } from "@aws-sdk/client-rds-data"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RDSDataClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchExecuteStatementCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-rds-data"; +const client = new AWS.RDSData({ region: "REGION" }); + +// async/await. +try { + const data = client.batchExecuteStatement(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchExecuteStatement(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchExecuteStatement(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-rds-data` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-rds/README.md b/clients/client-rds/README.md index 7a16df6b267e..9fc83c7589be 100644 --- a/clients/client-rds/README.md +++ b/clients/client-rds/README.md @@ -3,4 +3,258 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-rds/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-rds.svg)](https://www.npmjs.com/package/@aws-sdk/client-rds) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RDS Client for Node.js, Browser and React Native. + +Amazon Relational Database Service + +

+

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and +scale a relational database in the cloud. It provides cost-efficient, resizeable capacity for an industry-standard relational +database and manages common database administration tasks, freeing up developers to focus on what makes their applications +and businesses unique.

+

Amazon RDS gives you access to the capabilities of a MySQL, MariaDB, PostgreSQL, Microsoft SQL Server, +Oracle, or Amazon Aurora database server. These capabilities mean that the code, applications, and tools +you already use today with your existing databases work with Amazon RDS without modification. Amazon RDS +automatically backs up your database and maintains the database software that powers your DB instance. Amazon RDS +is flexible: you can scale your DB instance's compute resources and storage capacity to meet your +application's demand. As with all Amazon Web Services, there are no up-front investments, and you pay only for +the resources you use.

+

This interface reference for Amazon RDS contains documentation for a programming or command line interface +you can use to manage Amazon RDS. Amazon RDS is asynchronous, which means that some interfaces might +require techniques such as polling or callback functions to determine when a command has been applied. In this +reference, the parameter descriptions indicate whether a command is applied immediately, on the next instance reboot, +or during the maintenance window. The reference structure is as follows, and we list following some related topics +from the user guide.

+ +

+Amazon RDS API Reference +

+ + + +

+Amazon RDS User Guide +

+ + + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-rds +using your favorite package manager: + +- `npm install @aws-sdk/client-rds` +- `yarn add @aws-sdk/client-rds` +- `pnpm add @aws-sdk/client-rds` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RDSClient` and +the commands you need, for example `AddRoleToDBClusterCommand`: + +```js +// ES5 example +const { RDSClient, AddRoleToDBClusterCommand } = require("@aws-sdk/client-rds"); +``` + +```ts +// ES6+ example +import { RDSClient, AddRoleToDBClusterCommand } from "@aws-sdk/client-rds"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RDSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddRoleToDBClusterCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-rds"; +const client = new AWS.RDS({ region: "REGION" }); + +// async/await. +try { + const data = client.addRoleToDBCluster(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addRoleToDBCluster(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addRoleToDBCluster(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-rds` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-redshift-data/README.md b/clients/client-redshift-data/README.md index 44c8dc925de9..ea30020eb94f 100644 --- a/clients/client-redshift-data/README.md +++ b/clients/client-redshift-data/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-redshift-data/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-redshift-data) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-redshift-data.svg)](https://www.npmjs.com/package/@aws-sdk/client-redshift-data) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RedshiftData Client for Node.js, Browser and React Native. + +

You can use the Amazon Redshift Data API to run queries on Amazon Redshift tables. You +can run individual SQL statements, which are committed if the statement succeeds.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-redshift-data +using your favorite package manager: + +- `npm install @aws-sdk/client-redshift-data` +- `yarn add @aws-sdk/client-redshift-data` +- `pnpm add @aws-sdk/client-redshift-data` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RedshiftDataClient` and +the commands you need, for example `CancelStatementCommand`: + +```js +// ES5 example +const { RedshiftDataClient, CancelStatementCommand } = require("@aws-sdk/client-redshift-data"); +``` + +```ts +// ES6+ example +import { RedshiftDataClient, CancelStatementCommand } from "@aws-sdk/client-redshift-data"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RedshiftDataClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelStatementCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-redshift-data"; +const client = new AWS.RedshiftData({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelStatement(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelStatement(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelStatement(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-redshift-data` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-redshift/README.md b/clients/client-redshift/README.md index c0187ede4157..c4b605849724 100644 --- a/clients/client-redshift/README.md +++ b/clients/client-redshift/README.md @@ -3,4 +3,223 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-redshift/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-redshift) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-redshift.svg)](https://www.npmjs.com/package/@aws-sdk/client-redshift) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Redshift Client for Node.js, Browser and React Native. + +Amazon Redshift + +

+Overview +

+

This is an interface reference for Amazon Redshift. It contains documentation for one of +the programming or command line interfaces you can use to manage Amazon Redshift clusters. +Note that Amazon Redshift is asynchronous, which means that some interfaces may require +techniques, such as polling or asynchronous callback handlers, to determine when a +command has been applied. In this reference, the parameter descriptions indicate whether +a change is applied immediately, on the next instance reboot, or during the next +maintenance window. For a summary of the Amazon Redshift cluster management interfaces, go to +Using the +Amazon Redshift Management Interfaces.

+

Amazon Redshift manages all the work of setting up, operating, and scaling a data +warehouse: provisioning capacity, monitoring and backing up the cluster, and applying +patches and upgrades to the Amazon Redshift engine. You can focus on using your data to +acquire new insights for your business and customers.

+

If you are a first-time user of Amazon Redshift, we recommend that you begin by reading +the Amazon Redshift Getting Started Guide.

+ +

If you are a database developer, the Amazon Redshift Database Developer Guide explains how to design, +build, query, and maintain the databases that make up your data warehouse.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-redshift +using your favorite package manager: + +- `npm install @aws-sdk/client-redshift` +- `yarn add @aws-sdk/client-redshift` +- `pnpm add @aws-sdk/client-redshift` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RedshiftClient` and +the commands you need, for example `AcceptReservedNodeExchangeCommand`: + +```js +// ES5 example +const { RedshiftClient, AcceptReservedNodeExchangeCommand } = require("@aws-sdk/client-redshift"); +``` + +```ts +// ES6+ example +import { RedshiftClient, AcceptReservedNodeExchangeCommand } from "@aws-sdk/client-redshift"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RedshiftClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptReservedNodeExchangeCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-redshift"; +const client = new AWS.Redshift({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptReservedNodeExchange(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptReservedNodeExchange(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptReservedNodeExchange(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-redshift` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-rekognition/README.md b/clients/client-rekognition/README.md index 9f3eb3046207..06b9ab499b38 100644 --- a/clients/client-rekognition/README.md +++ b/clients/client-rekognition/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-rekognition/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-rekognition) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-rekognition.svg)](https://www.npmjs.com/package/@aws-sdk/client-rekognition) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Rekognition Client for Node.js, Browser and React Native. + +

This is the Amazon Rekognition API reference.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-rekognition +using your favorite package manager: + +- `npm install @aws-sdk/client-rekognition` +- `yarn add @aws-sdk/client-rekognition` +- `pnpm add @aws-sdk/client-rekognition` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RekognitionClient` and +the commands you need, for example `CompareFacesCommand`: + +```js +// ES5 example +const { RekognitionClient, CompareFacesCommand } = require("@aws-sdk/client-rekognition"); +``` + +```ts +// ES6+ example +import { RekognitionClient, CompareFacesCommand } from "@aws-sdk/client-rekognition"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RekognitionClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CompareFacesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-rekognition"; +const client = new AWS.Rekognition({ region: "REGION" }); + +// async/await. +try { + const data = client.compareFaces(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .compareFaces(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.compareFaces(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-rekognition` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-resource-groups-tagging-api/README.md b/clients/client-resource-groups-tagging-api/README.md index a17ae06e2c1d..be685a8b5ad9 100644 --- a/clients/client-resource-groups-tagging-api/README.md +++ b/clients/client-resource-groups-tagging-api/README.md @@ -3,4 +3,964 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-resource-groups-tagging-api/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-resource-groups-tagging-api) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-resource-groups-tagging-api.svg)](https://www.npmjs.com/package/@aws-sdk/client-resource-groups-tagging-api) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ResourceGroupsTaggingAPI Client for Node.js, Browser and React Native. + +Resource Groups Tagging API + +

This guide describes the API operations for the resource groups tagging.

+

A tag is a label that you assign to an AWS resource. A tag consists of a key and a +value, both of which you define. For example, if you have two Amazon EC2 instances, you might +assign both a tag key of "Stack." But the value of "Stack" might be "Testing" for one +and "Production" for the other.

+ +

Do not store personally identifiable information (PII) or other confidential or +sensitive information in tags. We use tags to provide you with billing and +administration services. Tags are not intended to be used for private or sensitive +data.

+
+

Tagging can help you organize your resources and enables you to simplify resource +management, access management and cost allocation.

+

You can use the resource groups tagging API operations to complete the following +tasks:

+ +

To use resource groups tagging API operations, you must add the following permissions +to your IAM policy:

+ +

You'll also need permissions to access the resources of individual services so that +you can tag and untag those resources.

+

For more information on IAM policies, see Managing IAM +Policies in the IAM User Guide.

+

+ +Services that support the Resource Groups Tagging +API + +

+

You can use the Resource Groups Tagging API to tag resources for the following AWS +services.

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-resource-groups-tagging-api +using your favorite package manager: + +- `npm install @aws-sdk/client-resource-groups-tagging-api` +- `yarn add @aws-sdk/client-resource-groups-tagging-api` +- `pnpm add @aws-sdk/client-resource-groups-tagging-api` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ResourceGroupsTaggingAPIClient` and +the commands you need, for example `DescribeReportCreationCommand`: + +```js +// ES5 example +const { + ResourceGroupsTaggingAPIClient, + DescribeReportCreationCommand, +} = require("@aws-sdk/client-resource-groups-tagging-api"); +``` + +```ts +// ES6+ example +import { + ResourceGroupsTaggingAPIClient, + DescribeReportCreationCommand, +} from "@aws-sdk/client-resource-groups-tagging-api"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ResourceGroupsTaggingAPIClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DescribeReportCreationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-resource-groups-tagging-api"; +const client = new AWS.ResourceGroupsTaggingAPI({ region: "REGION" }); + +// async/await. +try { + const data = client.describeReportCreation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .describeReportCreation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.describeReportCreation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-resource-groups-tagging-api` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-resource-groups/README.md b/clients/client-resource-groups/README.md index dade5fffa330..ac1fc81a9409 100644 --- a/clients/client-resource-groups/README.md +++ b/clients/client-resource-groups/README.md @@ -3,4 +3,236 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-resource-groups/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-resource-groups) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-resource-groups.svg)](https://www.npmjs.com/package/@aws-sdk/client-resource-groups) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ResourceGroups Client for Node.js, Browser and React Native. + +AWS Resource Groups + +

AWS Resource Groups lets you organize AWS resources such as Amazon EC2 instances, Amazon Relational Database Service +databases, and Amazon S3 buckets into groups using criteria that you define as tags. A +resource group is a collection of resources that match the resource types specified in a +query, and share one or more tags or portions of tags. You can create a group of +resources based on their roles in your cloud infrastructure, lifecycle stages, regions, +application layers, or virtually any criteria. Resource Groups enable you to automate management +tasks, such as those in AWS Systems Manager Automation documents, on tag-related resources in +AWS Systems Manager. Groups of tagged resources also let you quickly view a custom console in +AWS Systems Manager that shows AWS Config compliance and other monitoring data about member +resources.

+

To create a resource group, build a resource query, and specify tags that identify the +criteria that members of the group have in common. Tags are key-value pairs.

+

For more information about Resource Groups, see the AWS Resource Groups User Guide.

+

AWS Resource Groups uses a REST-compliant API that you can use to perform the following types of +operations.

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-resource-groups +using your favorite package manager: + +- `npm install @aws-sdk/client-resource-groups` +- `yarn add @aws-sdk/client-resource-groups` +- `pnpm add @aws-sdk/client-resource-groups` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ResourceGroupsClient` and +the commands you need, for example `CreateGroupCommand`: + +```js +// ES5 example +const { ResourceGroupsClient, CreateGroupCommand } = require("@aws-sdk/client-resource-groups"); +``` + +```ts +// ES6+ example +import { ResourceGroupsClient, CreateGroupCommand } from "@aws-sdk/client-resource-groups"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ResourceGroupsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateGroupCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-resource-groups"; +const client = new AWS.ResourceGroups({ region: "REGION" }); + +// async/await. +try { + const data = client.createGroup(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createGroup(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createGroup(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-resource-groups` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-robomaker/README.md b/clients/client-robomaker/README.md index 58d7b0adcaf8..dc724b8b6f1c 100644 --- a/clients/client-robomaker/README.md +++ b/clients/client-robomaker/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-robomaker/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-robomaker) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-robomaker.svg)](https://www.npmjs.com/package/@aws-sdk/client-robomaker) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RoboMaker Client for Node.js, Browser and React Native. + +

This section provides documentation for the AWS RoboMaker API operations.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-robomaker +using your favorite package manager: + +- `npm install @aws-sdk/client-robomaker` +- `yarn add @aws-sdk/client-robomaker` +- `pnpm add @aws-sdk/client-robomaker` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RoboMakerClient` and +the commands you need, for example `BatchDeleteWorldsCommand`: + +```js +// ES5 example +const { RoboMakerClient, BatchDeleteWorldsCommand } = require("@aws-sdk/client-robomaker"); +``` + +```ts +// ES6+ example +import { RoboMakerClient, BatchDeleteWorldsCommand } from "@aws-sdk/client-robomaker"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RoboMakerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchDeleteWorldsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-robomaker"; +const client = new AWS.RoboMaker({ region: "REGION" }); + +// async/await. +try { + const data = client.batchDeleteWorlds(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchDeleteWorlds(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchDeleteWorlds(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-robomaker` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-route-53-domains/README.md b/clients/client-route-53-domains/README.md index 7bd5eea3e663..ab6dac8bb81f 100644 --- a/clients/client-route-53-domains/README.md +++ b/clients/client-route-53-domains/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-route-53-domains/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-route-53-domains) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-route-53-domains.svg)](https://www.npmjs.com/package/@aws-sdk/client-route-53-domains) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Route53Domains Client for Node.js, Browser and React Native. + +

Amazon Route 53 API actions let you register domain names and perform related operations.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-route-53-domains +using your favorite package manager: + +- `npm install @aws-sdk/client-route-53-domains` +- `yarn add @aws-sdk/client-route-53-domains` +- `pnpm add @aws-sdk/client-route-53-domains` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `Route53DomainsClient` and +the commands you need, for example `AcceptDomainTransferFromAnotherAwsAccountCommand`: + +```js +// ES5 example +const { + Route53DomainsClient, + AcceptDomainTransferFromAnotherAwsAccountCommand, +} = require("@aws-sdk/client-route-53-domains"); +``` + +```ts +// ES6+ example +import { + Route53DomainsClient, + AcceptDomainTransferFromAnotherAwsAccountCommand, +} from "@aws-sdk/client-route-53-domains"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new Route53DomainsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptDomainTransferFromAnotherAwsAccountCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-route-53-domains"; +const client = new AWS.Route53Domains({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptDomainTransferFromAnotherAwsAccount(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptDomainTransferFromAnotherAwsAccount(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptDomainTransferFromAnotherAwsAccount(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-route-53-domains` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-route-53/README.md b/clients/client-route-53/README.md index 37a590cd92aa..bc5a1beb2330 100644 --- a/clients/client-route-53/README.md +++ b/clients/client-route-53/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-route-53/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-route-53) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-route-53.svg)](https://www.npmjs.com/package/@aws-sdk/client-route-53) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Route53 Client for Node.js, Browser and React Native. + +

Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-route-53 +using your favorite package manager: + +- `npm install @aws-sdk/client-route-53` +- `yarn add @aws-sdk/client-route-53` +- `pnpm add @aws-sdk/client-route-53` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `Route53Client` and +the commands you need, for example `AssociateVPCWithHostedZoneCommand`: + +```js +// ES5 example +const { Route53Client, AssociateVPCWithHostedZoneCommand } = require("@aws-sdk/client-route-53"); +``` + +```ts +// ES6+ example +import { Route53Client, AssociateVPCWithHostedZoneCommand } from "@aws-sdk/client-route-53"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new Route53Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateVPCWithHostedZoneCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-route-53"; +const client = new AWS.Route53({ region: "REGION" }); + +// async/await. +try { + const data = client.associateVPCWithHostedZone(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateVPCWithHostedZone(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateVPCWithHostedZone(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-route-53` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-route53resolver/README.md b/clients/client-route53resolver/README.md index c653d2f14d6a..7dbafa475f76 100644 --- a/clients/client-route53resolver/README.md +++ b/clients/client-route53resolver/README.md @@ -3,4 +3,230 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-route53resolver/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-route53resolver) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-route53resolver.svg)](https://www.npmjs.com/package/@aws-sdk/client-route53resolver) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Route53Resolver Client for Node.js, Browser and React Native. + +

When you create a VPC using Amazon VPC, you automatically get DNS resolution within the VPC from Route 53 Resolver. +By default, Resolver answers DNS queries for VPC domain names such as domain names for EC2 instances or ELB load balancers. +Resolver performs recursive lookups against public name servers for all other domain names.

+ +

You can also configure DNS resolution between your VPC and your network over a Direct Connect or VPN connection:

+ +

+Forward DNS queries from resolvers on your network to Route 53 Resolver +

+ +

DNS resolvers on your network can forward DNS queries to Resolver in a specified VPC. This allows your DNS resolvers +to easily resolve domain names for AWS resources such as EC2 instances or records in a Route 53 private hosted zone. +For more information, see +How DNS Resolvers +on Your Network Forward DNS Queries to Route 53 Resolver in the Amazon Route 53 Developer Guide.

+ +

+Conditionally forward queries from a VPC to resolvers on your network +

+ +

You can configure Resolver to forward queries that it receives from EC2 instances in your VPCs to DNS resolvers on your network. +To forward selected queries, you create Resolver rules that specify the domain names for the DNS queries that you want to forward +(such as example.com), and the IP addresses of the DNS resolvers on your network that you want to forward the queries to. +If a query matches multiple rules (example.com, acme.example.com), Resolver chooses the rule with the most specific match +(acme.example.com) and forwards the query to the IP addresses that you specified in that rule. For more information, see +How Route 53 Resolver +Forwards DNS Queries from Your VPCs to Your Network in the Amazon Route 53 Developer Guide.

+ +

Like Amazon VPC, Resolver is regional. In each region where you have VPCs, you can choose whether to forward queries from your VPCs +to your network (outbound queries), from your network to your VPCs (inbound queries), or both.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-route53resolver +using your favorite package manager: + +- `npm install @aws-sdk/client-route53resolver` +- `yarn add @aws-sdk/client-route53resolver` +- `pnpm add @aws-sdk/client-route53resolver` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `Route53ResolverClient` and +the commands you need, for example `AssociateResolverEndpointIpAddressCommand`: + +```js +// ES5 example +const { Route53ResolverClient, AssociateResolverEndpointIpAddressCommand } = require("@aws-sdk/client-route53resolver"); +``` + +```ts +// ES6+ example +import { Route53ResolverClient, AssociateResolverEndpointIpAddressCommand } from "@aws-sdk/client-route53resolver"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new Route53ResolverClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateResolverEndpointIpAddressCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-route53resolver"; +const client = new AWS.Route53Resolver({ region: "REGION" }); + +// async/await. +try { + const data = client.associateResolverEndpointIpAddress(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateResolverEndpointIpAddress(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateResolverEndpointIpAddress(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-route53resolver` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-s3-control/README.md b/clients/client-s3-control/README.md index 2ece9889d612..b6e53e18b8e5 100644 --- a/clients/client-s3-control/README.md +++ b/clients/client-s3-control/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-s3-control/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3-control) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-s3-control.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3-control) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript S3Control Client for Node.js, Browser and React Native. + +

+AWS S3 Control provides access to Amazon S3 control plane operations. + +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-s3-control +using your favorite package manager: + +- `npm install @aws-sdk/client-s3-control` +- `yarn add @aws-sdk/client-s3-control` +- `pnpm add @aws-sdk/client-s3-control` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `S3ControlClient` and +the commands you need, for example `CreateAccessPointCommand`: + +```js +// ES5 example +const { S3ControlClient, CreateAccessPointCommand } = require("@aws-sdk/client-s3-control"); +``` + +```ts +// ES6+ example +import { S3ControlClient, CreateAccessPointCommand } from "@aws-sdk/client-s3-control"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new S3ControlClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAccessPointCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-s3-control"; +const client = new AWS.S3Control({ region: "REGION" }); + +// async/await. +try { + const data = client.createAccessPoint(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createAccessPoint(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createAccessPoint(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-s3-control` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-s3/README.md b/clients/client-s3/README.md index 1df6588d3fa0..03fb8b406d09 100644 --- a/clients/client-s3/README.md +++ b/clients/client-s3/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-s3/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-s3.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native. + +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-s3 +using your favorite package manager: + +- `npm install @aws-sdk/client-s3` +- `yarn add @aws-sdk/client-s3` +- `pnpm add @aws-sdk/client-s3` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `S3Client` and +the commands you need, for example `AbortMultipartUploadCommand`: + +```js +// ES5 example +const { S3Client, AbortMultipartUploadCommand } = require("@aws-sdk/client-s3"); +``` + +```ts +// ES6+ example +import { S3Client, AbortMultipartUploadCommand } from "@aws-sdk/client-s3"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new S3Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AbortMultipartUploadCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-s3"; +const client = new AWS.S3({ region: "REGION" }); + +// async/await. +try { + const data = client.abortMultipartUpload(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .abortMultipartUpload(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.abortMultipartUpload(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-s3` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-s3outposts/README.md b/clients/client-s3outposts/README.md index e89a21acad37..2001fb47eff4 100644 --- a/clients/client-s3outposts/README.md +++ b/clients/client-s3outposts/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-s3outposts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3outposts) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-s3outposts.svg)](https://www.npmjs.com/package/@aws-sdk/client-s3outposts) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript S3Outposts Client for Node.js, Browser and React Native. + +

Amazon S3 on Outposts provides access to S3 on Outposts operations.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-s3outposts +using your favorite package manager: + +- `npm install @aws-sdk/client-s3outposts` +- `yarn add @aws-sdk/client-s3outposts` +- `pnpm add @aws-sdk/client-s3outposts` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `S3OutpostsClient` and +the commands you need, for example `CreateEndpointCommand`: + +```js +// ES5 example +const { S3OutpostsClient, CreateEndpointCommand } = require("@aws-sdk/client-s3outposts"); +``` + +```ts +// ES6+ example +import { S3OutpostsClient, CreateEndpointCommand } from "@aws-sdk/client-s3outposts"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new S3OutpostsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateEndpointCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-s3outposts"; +const client = new AWS.S3Outposts({ region: "REGION" }); + +// async/await. +try { + const data = client.createEndpoint(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createEndpoint(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createEndpoint(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-s3outposts` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sagemaker-a2i-runtime/README.md b/clients/client-sagemaker-a2i-runtime/README.md index 1e035bdf35a0..7a38652c9130 100644 --- a/clients/client-sagemaker-a2i-runtime/README.md +++ b/clients/client-sagemaker-a2i-runtime/README.md @@ -3,4 +3,230 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sagemaker-a2i-runtime/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-a2i-runtime) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sagemaker-a2i-runtime.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-a2i-runtime) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SageMakerA2IRuntime Client for Node.js, Browser and React Native. + + +

Amazon Augmented AI is in preview release and is subject to change. We do not recommend using this +product in production environments.

+
+

Amazon Augmented AI (Amazon A2I) adds the benefit of human judgment to any machine learning +application. When an AI application can't evaluate data with a high degree of confidence, +human reviewers can take over. This human review is called a human review workflow. To create +and start a human review workflow, you need three resources: a worker task +template, a flow definition, and a human +loop.

+

For information about these resources and prerequisites for using Amazon A2I, see Get Started with +Amazon Augmented AI in the Amazon SageMaker Developer Guide.

+

This API reference includes information about API actions and data types that you can use +to interact with Amazon A2I programmatically. Use this guide to:

+ +

Amazon A2I integrates APIs from various AWS services to create and start human review +workflows for those services. To learn how Amazon A2I uses these APIs, see Use APIs in +Amazon A2I in the Amazon SageMaker Developer Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sagemaker-a2i-runtime +using your favorite package manager: + +- `npm install @aws-sdk/client-sagemaker-a2i-runtime` +- `yarn add @aws-sdk/client-sagemaker-a2i-runtime` +- `pnpm add @aws-sdk/client-sagemaker-a2i-runtime` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SageMakerA2IRuntimeClient` and +the commands you need, for example `DeleteHumanLoopCommand`: + +```js +// ES5 example +const { SageMakerA2IRuntimeClient, DeleteHumanLoopCommand } = require("@aws-sdk/client-sagemaker-a2i-runtime"); +``` + +```ts +// ES6+ example +import { SageMakerA2IRuntimeClient, DeleteHumanLoopCommand } from "@aws-sdk/client-sagemaker-a2i-runtime"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SageMakerA2IRuntimeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteHumanLoopCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sagemaker-a2i-runtime"; +const client = new AWS.SageMakerA2IRuntime({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteHumanLoop(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteHumanLoop(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteHumanLoop(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sagemaker-a2i-runtime` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sagemaker-edge/README.md b/clients/client-sagemaker-edge/README.md index e63dc681317e..a84d8e435c84 100644 --- a/clients/client-sagemaker-edge/README.md +++ b/clients/client-sagemaker-edge/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sagemaker-edge/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-edge) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sagemaker-edge.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-edge) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SagemakerEdge Client for Node.js, Browser and React Native. + +

SageMaker Edge Manager dataplane service for communicating with active agents.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sagemaker-edge +using your favorite package manager: + +- `npm install @aws-sdk/client-sagemaker-edge` +- `yarn add @aws-sdk/client-sagemaker-edge` +- `pnpm add @aws-sdk/client-sagemaker-edge` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SagemakerEdgeClient` and +the commands you need, for example `GetDeviceRegistrationCommand`: + +```js +// ES5 example +const { SagemakerEdgeClient, GetDeviceRegistrationCommand } = require("@aws-sdk/client-sagemaker-edge"); +``` + +```ts +// ES6+ example +import { SagemakerEdgeClient, GetDeviceRegistrationCommand } from "@aws-sdk/client-sagemaker-edge"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SagemakerEdgeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetDeviceRegistrationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sagemaker-edge"; +const client = new AWS.SagemakerEdge({ region: "REGION" }); + +// async/await. +try { + const data = client.getDeviceRegistration(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getDeviceRegistration(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getDeviceRegistration(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sagemaker-edge` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sagemaker-featurestore-runtime/README.md b/clients/client-sagemaker-featurestore-runtime/README.md index e79c3fff67c9..99524665ccc6 100644 --- a/clients/client-sagemaker-featurestore-runtime/README.md +++ b/clients/client-sagemaker-featurestore-runtime/README.md @@ -3,4 +3,233 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sagemaker-featurestore-runtime/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-featurestore-runtime) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sagemaker-featurestore-runtime.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-featurestore-runtime) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SageMakerFeatureStoreRuntime Client for Node.js, Browser and React Native. + +

Contains all data plane API operations and data types for the Amazon SageMaker Feature +Store. Use this API to put, delete, and retrieve (get) features from a feature +store.

+

Use the following operations to configure your OnlineStore and +OfflineStore features, and to create and manage feature groups:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sagemaker-featurestore-runtime +using your favorite package manager: + +- `npm install @aws-sdk/client-sagemaker-featurestore-runtime` +- `yarn add @aws-sdk/client-sagemaker-featurestore-runtime` +- `pnpm add @aws-sdk/client-sagemaker-featurestore-runtime` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SageMakerFeatureStoreRuntimeClient` and +the commands you need, for example `DeleteRecordCommand`: + +```js +// ES5 example +const { + SageMakerFeatureStoreRuntimeClient, + DeleteRecordCommand, +} = require("@aws-sdk/client-sagemaker-featurestore-runtime"); +``` + +```ts +// ES6+ example +import { + SageMakerFeatureStoreRuntimeClient, + DeleteRecordCommand, +} from "@aws-sdk/client-sagemaker-featurestore-runtime"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SageMakerFeatureStoreRuntimeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new DeleteRecordCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sagemaker-featurestore-runtime"; +const client = new AWS.SageMakerFeatureStoreRuntime({ region: "REGION" }); + +// async/await. +try { + const data = client.deleteRecord(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .deleteRecord(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.deleteRecord(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sagemaker-featurestore-runtime` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sagemaker-runtime/README.md b/clients/client-sagemaker-runtime/README.md index 542759d58148..fd72b7acd560 100644 --- a/clients/client-sagemaker-runtime/README.md +++ b/clients/client-sagemaker-runtime/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sagemaker-runtime/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-runtime) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sagemaker-runtime.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker-runtime) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SageMakerRuntime Client for Node.js, Browser and React Native. + +

The Amazon SageMaker runtime API.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sagemaker-runtime +using your favorite package manager: + +- `npm install @aws-sdk/client-sagemaker-runtime` +- `yarn add @aws-sdk/client-sagemaker-runtime` +- `pnpm add @aws-sdk/client-sagemaker-runtime` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SageMakerRuntimeClient` and +the commands you need, for example `InvokeEndpointCommand`: + +```js +// ES5 example +const { SageMakerRuntimeClient, InvokeEndpointCommand } = require("@aws-sdk/client-sagemaker-runtime"); +``` + +```ts +// ES6+ example +import { SageMakerRuntimeClient, InvokeEndpointCommand } from "@aws-sdk/client-sagemaker-runtime"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SageMakerRuntimeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new InvokeEndpointCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sagemaker-runtime"; +const client = new AWS.SageMakerRuntime({ region: "REGION" }); + +// async/await. +try { + const data = client.invokeEndpoint(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .invokeEndpoint(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.invokeEndpoint(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sagemaker-runtime` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sagemaker/README.md b/clients/client-sagemaker/README.md index e2c8c6467cc8..fdbffc7cf9b4 100644 --- a/clients/client-sagemaker/README.md +++ b/clients/client-sagemaker/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sagemaker/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sagemaker.svg)](https://www.npmjs.com/package/@aws-sdk/client-sagemaker) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SageMaker Client for Node.js, Browser and React Native. + +

Provides APIs for creating and managing Amazon SageMaker resources.

+

Other Resources:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sagemaker +using your favorite package manager: + +- `npm install @aws-sdk/client-sagemaker` +- `yarn add @aws-sdk/client-sagemaker` +- `pnpm add @aws-sdk/client-sagemaker` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SageMakerClient` and +the commands you need, for example `AddAssociationCommand`: + +```js +// ES5 example +const { SageMakerClient, AddAssociationCommand } = require("@aws-sdk/client-sagemaker"); +``` + +```ts +// ES6+ example +import { SageMakerClient, AddAssociationCommand } from "@aws-sdk/client-sagemaker"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SageMakerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddAssociationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sagemaker"; +const client = new AWS.SageMaker({ region: "REGION" }); + +// async/await. +try { + const data = client.addAssociation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addAssociation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addAssociation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sagemaker` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-savingsplans/README.md b/clients/client-savingsplans/README.md index 3f2c69d7902f..69523d087bac 100644 --- a/clients/client-savingsplans/README.md +++ b/clients/client-savingsplans/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-savingsplans/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-savingsplans) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-savingsplans.svg)](https://www.npmjs.com/package/@aws-sdk/client-savingsplans) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Savingsplans Client for Node.js, Browser and React Native. + +

Savings Plans are a pricing model that offer significant savings on AWS usage (for +example, on Amazon EC2 instances). You commit to a consistent amount of usage, in USD +per hour, for a term of 1 or 3 years, and receive a lower price for that usage. For +more information, see the AWS Savings Plans User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-savingsplans +using your favorite package manager: + +- `npm install @aws-sdk/client-savingsplans` +- `yarn add @aws-sdk/client-savingsplans` +- `pnpm add @aws-sdk/client-savingsplans` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SavingsplansClient` and +the commands you need, for example `CreateSavingsPlanCommand`: + +```js +// ES5 example +const { SavingsplansClient, CreateSavingsPlanCommand } = require("@aws-sdk/client-savingsplans"); +``` + +```ts +// ES6+ example +import { SavingsplansClient, CreateSavingsPlanCommand } from "@aws-sdk/client-savingsplans"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SavingsplansClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateSavingsPlanCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-savingsplans"; +const client = new AWS.Savingsplans({ region: "REGION" }); + +// async/await. +try { + const data = client.createSavingsPlan(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createSavingsPlan(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createSavingsPlan(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-savingsplans` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-schemas/README.md b/clients/client-schemas/README.md index 3f57ab57062c..39e55171ad53 100644 --- a/clients/client-schemas/README.md +++ b/clients/client-schemas/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-schemas/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-schemas) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-schemas.svg)](https://www.npmjs.com/package/@aws-sdk/client-schemas) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Schemas Client for Node.js, Browser and React Native. + +

Amazon EventBridge Schema Registry

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-schemas +using your favorite package manager: + +- `npm install @aws-sdk/client-schemas` +- `yarn add @aws-sdk/client-schemas` +- `pnpm add @aws-sdk/client-schemas` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SchemasClient` and +the commands you need, for example `CreateDiscovererCommand`: + +```js +// ES5 example +const { SchemasClient, CreateDiscovererCommand } = require("@aws-sdk/client-schemas"); +``` + +```ts +// ES6+ example +import { SchemasClient, CreateDiscovererCommand } from "@aws-sdk/client-schemas"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SchemasClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDiscovererCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-schemas"; +const client = new AWS.Schemas({ region: "REGION" }); + +// async/await. +try { + const data = client.createDiscoverer(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDiscoverer(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDiscoverer(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-schemas` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-secrets-manager/README.md b/clients/client-secrets-manager/README.md index 2b56a149fe5b..7f5aa63dee49 100644 --- a/clients/client-secrets-manager/README.md +++ b/clients/client-secrets-manager/README.md @@ -3,4 +3,257 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-secrets-manager/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-secrets-manager) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-secrets-manager.svg)](https://www.npmjs.com/package/@aws-sdk/client-secrets-manager) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SecretsManager Client for Node.js, Browser and React Native. + +AWS Secrets Manager API Reference + +

AWS Secrets Manager provides a service to enable you to store, manage, and retrieve, secrets.

+ +

This guide provides descriptions of the Secrets Manager API. For more information about using this +service, see the AWS Secrets Manager User Guide.

+ +

+API Version +

+ +

This version of the Secrets Manager API Reference documents the Secrets Manager API version 2017-10-17.

+ +

As an alternative to using the API, you can use one of the AWS SDKs, which consist of +libraries and sample code for various programming languages and platforms such as Java, +Ruby, .NET, iOS, and Android. The SDKs provide a convenient way to create programmatic +access to AWS Secrets Manager. For example, the SDKs provide cryptographically signing requests, +managing errors, and retrying requests automatically. For more information about the AWS +SDKs, including downloading and installing them, see Tools for Amazon Web Services.

+
+

We recommend you use the AWS SDKs to make programmatic API calls to Secrets Manager. However, you +also can use the Secrets Manager HTTP Query API to make direct calls to the Secrets Manager web service. To learn +more about the Secrets Manager HTTP Query API, see Making Query Requests in the +AWS Secrets Manager User Guide.

+

Secrets Manager API supports GET and POST requests for all actions, and doesn't require you to use +GET for some actions and POST for others. However, GET requests are subject to the limitation +size of a URL. Therefore, for operations that require larger sizes, use a POST request.

+ +

+Support and Feedback for AWS Secrets Manager +

+ +

We welcome your feedback. Send your comments to awssecretsmanager-feedback@amazon.com, or post your feedback and questions in the AWS Secrets Manager Discussion Forum. For more +information about the AWS Discussion Forums, see Forums +Help.

+ +

+How examples are presented +

+ +

The JSON that AWS Secrets Manager expects as your request parameters and the service returns as a +response to HTTP query requests contain single, long strings without line breaks or white +space formatting. The JSON shown in the examples displays the code formatted with both line +breaks and white space to improve readability. When example input parameters can also cause +long strings extending beyond the screen, you can insert line breaks to enhance readability. +You should always submit the input as a single JSON text string.

+ +

+Logging API Requests +

+

AWS Secrets Manager supports AWS CloudTrail, a service that records AWS API calls for your AWS +account and delivers log files to an Amazon S3 bucket. By using information that's collected +by AWS CloudTrail, you can determine the requests successfully made to Secrets Manager, who made the +request, when it was made, and so on. For more about AWS Secrets Manager and support for AWS +CloudTrail, see Logging +AWS Secrets Manager Events with AWS CloudTrail in the AWS Secrets Manager User Guide. +To learn more about CloudTrail, including enabling it and find your log files, see the AWS CloudTrail User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-secrets-manager +using your favorite package manager: + +- `npm install @aws-sdk/client-secrets-manager` +- `yarn add @aws-sdk/client-secrets-manager` +- `pnpm add @aws-sdk/client-secrets-manager` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SecretsManagerClient` and +the commands you need, for example `CancelRotateSecretCommand`: + +```js +// ES5 example +const { SecretsManagerClient, CancelRotateSecretCommand } = require("@aws-sdk/client-secrets-manager"); +``` + +```ts +// ES6+ example +import { SecretsManagerClient, CancelRotateSecretCommand } from "@aws-sdk/client-secrets-manager"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SecretsManagerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelRotateSecretCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-secrets-manager"; +const client = new AWS.SecretsManager({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelRotateSecret(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelRotateSecret(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelRotateSecret(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-secrets-manager` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-securityhub/README.md b/clients/client-securityhub/README.md index 9b4e826c7dbf..a6de76e1eba4 100644 --- a/clients/client-securityhub/README.md +++ b/clients/client-securityhub/README.md @@ -3,4 +3,255 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-securityhub/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-securityhub) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-securityhub.svg)](https://www.npmjs.com/package/@aws-sdk/client-securityhub) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SecurityHub Client for Node.js, Browser and React Native. + +

Security Hub provides you with a comprehensive view of the security state of your AWS +environment and resources. It also provides you with the readiness status of your +environment based on controls from supported security standards. Security Hub collects security +data from AWS accounts, services, and integrated third-party products and helps you analyze +security trends in your environment to identify the highest priority security issues. For +more information about Security Hub, see the +AWS Security Hub User +Guide +.

+

When you use operations in the Security Hub API, the requests are executed only in the AWS +Region that is currently active or in the specific AWS Region that you specify in your +request. Any configuration or settings change that results from the operation is applied +only to that Region. To make the same change in other Regions, execute the same command for +each Region to apply the change to.

+

For example, if your Region is set to us-west-2, when you use +CreateMembers + to add a member account to Security Hub, the association of +the member account with the master account is created only in the us-west-2 +Region. Security Hub must be enabled for the member account in the same Region that the invitation +was sent from.

+

The following throttling limits apply to using Security Hub API operations.

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-securityhub +using your favorite package manager: + +- `npm install @aws-sdk/client-securityhub` +- `yarn add @aws-sdk/client-securityhub` +- `pnpm add @aws-sdk/client-securityhub` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SecurityHubClient` and +the commands you need, for example `AcceptInvitationCommand`: + +```js +// ES5 example +const { SecurityHubClient, AcceptInvitationCommand } = require("@aws-sdk/client-securityhub"); +``` + +```ts +// ES6+ example +import { SecurityHubClient, AcceptInvitationCommand } from "@aws-sdk/client-securityhub"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SecurityHubClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptInvitationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-securityhub"; +const client = new AWS.SecurityHub({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptInvitation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptInvitation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptInvitation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-securityhub` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-serverlessapplicationrepository/README.md b/clients/client-serverlessapplicationrepository/README.md index 8e5f9a277aa3..bea7fd1d130b 100644 --- a/clients/client-serverlessapplicationrepository/README.md +++ b/clients/client-serverlessapplicationrepository/README.md @@ -3,4 +3,226 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-serverlessapplicationrepository/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-serverlessapplicationrepository) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-serverlessapplicationrepository.svg)](https://www.npmjs.com/package/@aws-sdk/client-serverlessapplicationrepository) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ServerlessApplicationRepository Client for Node.js, Browser and React Native. + +

The AWS Serverless Application Repository makes it easy for developers and enterprises to quickly find +and deploy serverless applications in the AWS Cloud. For more information about serverless applications, +see Serverless Computing and Applications on the AWS website.

The AWS Serverless Application Repository is deeply integrated with the AWS Lambda console, so that developers of +all levels can get started with serverless computing without needing to learn anything new. You can use category +keywords to browse for applications such as web and mobile backends, data processing applications, or chatbots. +You can also search for applications by name, publisher, or event source. To use an application, you simply choose it, +configure any required fields, and deploy it with a few clicks.

You can also easily publish applications, sharing them publicly with the community at large, or privately +within your team or across your organization. To publish a serverless application (or app), you can use the +AWS Management Console, AWS Command Line Interface (AWS CLI), or AWS SDKs to upload the code. Along with the +code, you upload a simple manifest file, also known as the AWS Serverless Application Model (AWS SAM) template. +For more information about AWS SAM, see AWS Serverless Application Model (AWS SAM) on the AWS Labs +GitHub repository.

The AWS Serverless Application Repository Developer Guide contains more information about the two developer +experiences available:

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-serverlessapplicationrepository +using your favorite package manager: + +- `npm install @aws-sdk/client-serverlessapplicationrepository` +- `yarn add @aws-sdk/client-serverlessapplicationrepository` +- `pnpm add @aws-sdk/client-serverlessapplicationrepository` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ServerlessApplicationRepositoryClient` and +the commands you need, for example `CreateApplicationCommand`: + +```js +// ES5 example +const { + ServerlessApplicationRepositoryClient, + CreateApplicationCommand, +} = require("@aws-sdk/client-serverlessapplicationrepository"); +``` + +```ts +// ES6+ example +import { + ServerlessApplicationRepositoryClient, + CreateApplicationCommand, +} from "@aws-sdk/client-serverlessapplicationrepository"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ServerlessApplicationRepositoryClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateApplicationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-serverlessapplicationrepository"; +const client = new AWS.ServerlessApplicationRepository({ region: "REGION" }); + +// async/await. +try { + const data = client.createApplication(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApplication(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApplication(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-serverlessapplicationrepository` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-service-catalog-appregistry/README.md b/clients/client-service-catalog-appregistry/README.md index d58894a74027..5fbdf90cf9ef 100644 --- a/clients/client-service-catalog-appregistry/README.md +++ b/clients/client-service-catalog-appregistry/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-service-catalog-appregistry/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-service-catalog-appregistry) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-service-catalog-appregistry.svg)](https://www.npmjs.com/package/@aws-sdk/client-service-catalog-appregistry) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ServiceCatalogAppRegistry Client for Node.js, Browser and React Native. + +

AWS Service Catalog AppRegistry enables organizations to understand the application context of their AWS resources. AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-service-catalog-appregistry +using your favorite package manager: + +- `npm install @aws-sdk/client-service-catalog-appregistry` +- `yarn add @aws-sdk/client-service-catalog-appregistry` +- `pnpm add @aws-sdk/client-service-catalog-appregistry` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ServiceCatalogAppRegistryClient` and +the commands you need, for example `AssociateAttributeGroupCommand`: + +```js +// ES5 example +const { + ServiceCatalogAppRegistryClient, + AssociateAttributeGroupCommand, +} = require("@aws-sdk/client-service-catalog-appregistry"); +``` + +```ts +// ES6+ example +import { + ServiceCatalogAppRegistryClient, + AssociateAttributeGroupCommand, +} from "@aws-sdk/client-service-catalog-appregistry"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ServiceCatalogAppRegistryClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateAttributeGroupCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-service-catalog-appregistry"; +const client = new AWS.ServiceCatalogAppRegistry({ region: "REGION" }); + +// async/await. +try { + const data = client.associateAttributeGroup(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateAttributeGroup(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateAttributeGroup(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-service-catalog-appregistry` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-service-catalog/README.md b/clients/client-service-catalog/README.md index 4e03b9d59410..799dd3632cdd 100644 --- a/clients/client-service-catalog/README.md +++ b/clients/client-service-catalog/README.md @@ -3,4 +3,208 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-service-catalog/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-service-catalog) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-service-catalog.svg)](https://www.npmjs.com/package/@aws-sdk/client-service-catalog) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ServiceCatalog Client for Node.js, Browser and React Native. + +AWS Service Catalog + +

+AWS Service Catalog enables +organizations to create and manage catalogs of IT services that are approved for AWS. To +get the most out of this documentation, you should be familiar with the terminology +discussed in AWS Service Catalog +Concepts.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-service-catalog +using your favorite package manager: + +- `npm install @aws-sdk/client-service-catalog` +- `yarn add @aws-sdk/client-service-catalog` +- `pnpm add @aws-sdk/client-service-catalog` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ServiceCatalogClient` and +the commands you need, for example `AcceptPortfolioShareCommand`: + +```js +// ES5 example +const { ServiceCatalogClient, AcceptPortfolioShareCommand } = require("@aws-sdk/client-service-catalog"); +``` + +```ts +// ES6+ example +import { ServiceCatalogClient, AcceptPortfolioShareCommand } from "@aws-sdk/client-service-catalog"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ServiceCatalogClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AcceptPortfolioShareCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-service-catalog"; +const client = new AWS.ServiceCatalog({ region: "REGION" }); + +// async/await. +try { + const data = client.acceptPortfolioShare(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .acceptPortfolioShare(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.acceptPortfolioShare(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-service-catalog` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-service-quotas/README.md b/clients/client-service-quotas/README.md index 5af47e7fdbbd..e4e7037fe7b3 100644 --- a/clients/client-service-quotas/README.md +++ b/clients/client-service-quotas/README.md @@ -3,4 +3,212 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-service-quotas/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-service-quotas) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-service-quotas.svg)](https://www.npmjs.com/package/@aws-sdk/client-service-quotas) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ServiceQuotas Client for Node.js, Browser and React Native. + +

Service Quotas is a web service that you can use to manage many of your AWS service +quotas. Quotas, also referred to as limits, are the maximum values for a resource, item, or +operation. This guide provide descriptions of the Service Quotas actions that you can call +from an API. For the Service Quotas user guide, which explains how to use Service Quotas from +the console, see What is Service Quotas.

+ + +

AWS provides SDKs that consist of libraries and sample code for programming languages +and platforms (Java, Ruby, .NET, iOS, Android, etc...,). The SDKs provide a convenient way +to create programmatic access to Service Quotas and AWS. For information about the AWS SDKs, +including how to download and install them, see the Tools for Amazon Web Services page.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-service-quotas +using your favorite package manager: + +- `npm install @aws-sdk/client-service-quotas` +- `yarn add @aws-sdk/client-service-quotas` +- `pnpm add @aws-sdk/client-service-quotas` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ServiceQuotasClient` and +the commands you need, for example `AssociateServiceQuotaTemplateCommand`: + +```js +// ES5 example +const { ServiceQuotasClient, AssociateServiceQuotaTemplateCommand } = require("@aws-sdk/client-service-quotas"); +``` + +```ts +// ES6+ example +import { ServiceQuotasClient, AssociateServiceQuotaTemplateCommand } from "@aws-sdk/client-service-quotas"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ServiceQuotasClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateServiceQuotaTemplateCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-service-quotas"; +const client = new AWS.ServiceQuotas({ region: "REGION" }); + +// async/await. +try { + const data = client.associateServiceQuotaTemplate(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateServiceQuotaTemplate(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateServiceQuotaTemplate(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-service-quotas` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-servicediscovery/README.md b/clients/client-servicediscovery/README.md index a046a62c15bf..6e8bc50d18fb 100644 --- a/clients/client-servicediscovery/README.md +++ b/clients/client-servicediscovery/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-servicediscovery/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-servicediscovery) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-servicediscovery.svg)](https://www.npmjs.com/package/@aws-sdk/client-servicediscovery) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ServiceDiscovery Client for Node.js, Browser and React Native. + +

AWS Cloud Map lets you configure public DNS, private DNS, or HTTP namespaces that your microservice applications +run in. When an instance of the service becomes available, you can call the AWS Cloud Map API to register the instance +with AWS Cloud Map. For public or private DNS namespaces, AWS Cloud Map automatically creates DNS records and an optional +health check. Clients that submit public or private DNS queries, or HTTP requests, for the service receive an answer +that contains up to eight healthy records.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-servicediscovery +using your favorite package manager: + +- `npm install @aws-sdk/client-servicediscovery` +- `yarn add @aws-sdk/client-servicediscovery` +- `pnpm add @aws-sdk/client-servicediscovery` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ServiceDiscoveryClient` and +the commands you need, for example `CreateHttpNamespaceCommand`: + +```js +// ES5 example +const { ServiceDiscoveryClient, CreateHttpNamespaceCommand } = require("@aws-sdk/client-servicediscovery"); +``` + +```ts +// ES6+ example +import { ServiceDiscoveryClient, CreateHttpNamespaceCommand } from "@aws-sdk/client-servicediscovery"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ServiceDiscoveryClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateHttpNamespaceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-servicediscovery"; +const client = new AWS.ServiceDiscovery({ region: "REGION" }); + +// async/await. +try { + const data = client.createHttpNamespace(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createHttpNamespace(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createHttpNamespace(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-servicediscovery` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ses/README.md b/clients/client-ses/README.md index 2508d46bca23..9dd365dc2a4c 100644 --- a/clients/client-ses/README.md +++ b/clients/client-ses/README.md @@ -3,4 +3,210 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ses/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ses) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ses.svg)](https://www.npmjs.com/package/@aws-sdk/client-ses) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SES Client for Node.js, Browser and React Native. + +Amazon Simple Email Service + +

This document contains reference information for the Amazon Simple Email Service (Amazon SES) API, version +2010-12-01. This document is best used in conjunction with the Amazon SES Developer +Guide.

+ +

For a list of Amazon SES endpoints to use in service requests, see Regions and +Amazon SES in the Amazon SES Developer +Guide.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ses +using your favorite package manager: + +- `npm install @aws-sdk/client-ses` +- `yarn add @aws-sdk/client-ses` +- `pnpm add @aws-sdk/client-ses` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SESClient` and +the commands you need, for example `CloneReceiptRuleSetCommand`: + +```js +// ES5 example +const { SESClient, CloneReceiptRuleSetCommand } = require("@aws-sdk/client-ses"); +``` + +```ts +// ES6+ example +import { SESClient, CloneReceiptRuleSetCommand } from "@aws-sdk/client-ses"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SESClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CloneReceiptRuleSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ses"; +const client = new AWS.SES({ region: "REGION" }); + +// async/await. +try { + const data = client.cloneReceiptRuleSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cloneReceiptRuleSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cloneReceiptRuleSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ses` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sesv2/README.md b/clients/client-sesv2/README.md index 0b57a6bc6a25..bf6ca0c22cd7 100644 --- a/clients/client-sesv2/README.md +++ b/clients/client-sesv2/README.md @@ -3,4 +3,221 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sesv2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sesv2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sesv2.svg)](https://www.npmjs.com/package/@aws-sdk/client-sesv2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SESv2 Client for Node.js, Browser and React Native. + +Amazon SES API v2 + +

Welcome to the Amazon SES API v2 Reference. This guide provides information about the Amazon SES API v2, +including supported operations, data types, parameters, and schemas.

+

+Amazon SES is an AWS service that +you can use to send email messages to your customers.

+

If you're new to Amazon SES API v2, you might find it helpful to also review the Amazon Simple Email Service Developer +Guide. The Amazon SES Developer Guide provides information +and code samples that demonstrate how to use Amazon SES API v2 features programmatically.

+

The Amazon SES API v2 is available in several AWS Regions and it provides an endpoint for each +of these Regions. For a list of all the Regions and endpoints where the API is currently +available, see AWS Service Endpoints in the Amazon Web Services General Reference. To +learn more about AWS Regions, see Managing AWS Regions in the +Amazon Web Services General Reference.

+

In each Region, AWS maintains multiple Availability Zones. These Availability Zones +are physically isolated from each other, but are united by private, low-latency, +high-throughput, and highly redundant network connections. These Availability Zones +enable us to provide very high levels of availability and redundancy, while also +minimizing latency. To learn more about the number of Availability Zones that are +available in each Region, see AWS Global Infrastructure.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sesv2 +using your favorite package manager: + +- `npm install @aws-sdk/client-sesv2` +- `yarn add @aws-sdk/client-sesv2` +- `pnpm add @aws-sdk/client-sesv2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SESv2Client` and +the commands you need, for example `CreateConfigurationSetCommand`: + +```js +// ES5 example +const { SESv2Client, CreateConfigurationSetCommand } = require("@aws-sdk/client-sesv2"); +``` + +```ts +// ES6+ example +import { SESv2Client, CreateConfigurationSetCommand } from "@aws-sdk/client-sesv2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SESv2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateConfigurationSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sesv2"; +const client = new AWS.SESv2({ region: "REGION" }); + +// async/await. +try { + const data = client.createConfigurationSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createConfigurationSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createConfigurationSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sesv2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sfn/README.md b/clients/client-sfn/README.md index 98810b2a2ba1..ca38c20c3b3f 100644 --- a/clients/client-sfn/README.md +++ b/clients/client-sfn/README.md @@ -3,4 +3,217 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sfn/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sfn) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sfn.svg)](https://www.npmjs.com/package/@aws-sdk/client-sfn) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SFN Client for Node.js, Browser and React Native. + +AWS Step Functions + +

AWS Step Functions is a service that lets you coordinate the components of distributed applications +and microservices using visual workflows.

+

You can use Step Functions to build applications from individual components, each of which performs +a discrete function, or task, allowing you to scale and change +applications quickly. Step Functions provides a console that helps visualize the components of your +application as a series of steps. Step Functions automatically triggers and tracks each step, and +retries steps when there are errors, so your application executes predictably and in the right +order every time. Step Functions logs the state of each step, so you can quickly diagnose and debug any +issues.

+

Step Functions manages operations and underlying infrastructure to ensure your application is +available at any scale. You can run tasks on AWS, your own servers, or any system that has +access to AWS. You can access and use Step Functions using the console, the AWS SDKs, or an HTTP API. +For more information about Step Functions, see the +AWS Step Functions Developer Guide +.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sfn +using your favorite package manager: + +- `npm install @aws-sdk/client-sfn` +- `yarn add @aws-sdk/client-sfn` +- `pnpm add @aws-sdk/client-sfn` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SFNClient` and +the commands you need, for example `CreateActivityCommand`: + +```js +// ES5 example +const { SFNClient, CreateActivityCommand } = require("@aws-sdk/client-sfn"); +``` + +```ts +// ES6+ example +import { SFNClient, CreateActivityCommand } from "@aws-sdk/client-sfn"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SFNClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateActivityCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sfn"; +const client = new AWS.SFN({ region: "REGION" }); + +// async/await. +try { + const data = client.createActivity(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createActivity(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createActivity(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sfn` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-shield/README.md b/clients/client-shield/README.md index 7ccd77432fcc..16c8351dfce6 100644 --- a/clients/client-shield/README.md +++ b/clients/client-shield/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-shield/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-shield) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-shield.svg)](https://www.npmjs.com/package/@aws-sdk/client-shield) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Shield Client for Node.js, Browser and React Native. + +AWS Shield Advanced + +

This is the AWS Shield Advanced API Reference. This guide is for developers who need detailed information about the AWS Shield Advanced API actions, +data types, and errors. For detailed information about AWS WAF and AWS Shield Advanced features and an overview of how to use the AWS WAF and AWS Shield Advanced APIs, see the +AWS WAF and AWS Shield Developer Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-shield +using your favorite package manager: + +- `npm install @aws-sdk/client-shield` +- `yarn add @aws-sdk/client-shield` +- `pnpm add @aws-sdk/client-shield` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `ShieldClient` and +the commands you need, for example `AssociateDRTLogBucketCommand`: + +```js +// ES5 example +const { ShieldClient, AssociateDRTLogBucketCommand } = require("@aws-sdk/client-shield"); +``` + +```ts +// ES6+ example +import { ShieldClient, AssociateDRTLogBucketCommand } from "@aws-sdk/client-shield"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ShieldClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateDRTLogBucketCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-shield"; +const client = new AWS.Shield({ region: "REGION" }); + +// async/await. +try { + const data = client.associateDRTLogBucket(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateDRTLogBucket(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateDRTLogBucket(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-shield` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-signer/README.md b/clients/client-signer/README.md index 279a783ba565..87d8a541759a 100644 --- a/clients/client-signer/README.md +++ b/clients/client-signer/README.md @@ -3,4 +3,217 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-signer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-signer) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-signer.svg)](https://www.npmjs.com/package/@aws-sdk/client-signer) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Signer Client for Node.js, Browser and React Native. + +

AWS Signer is a fully managed code signing service to help you ensure the trust and +integrity of your code.

+

AWS Signer supports the following applications:

+ +

With code signing for AWS Lambda, you can sign AWS Lambda +deployment packages. Integrated support is provided for Amazon S3, Amazon CloudWatch, +and AWS CloudTrail. In order to sign code, you create a signing profile and then use +Signer to sign Lambda zip files in S3.

+ +

With code signing for IoT, you can sign code for any IoT device that is +supported by AWS. IoT code signing is available for Amazon FreeRTOS and AWS IoT Device Management, and is +integrated with AWS Certificate Manager (ACM). In order to sign +code, you import a third-party code signing certificate using ACM, and use that to +sign updates in Amazon FreeRTOS and AWS IoT Device Management.

+

For more information about AWS Signer, see the AWS Signer Developer Guide.

+ +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-signer +using your favorite package manager: + +- `npm install @aws-sdk/client-signer` +- `yarn add @aws-sdk/client-signer` +- `pnpm add @aws-sdk/client-signer` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SignerClient` and +the commands you need, for example `AddProfilePermissionCommand`: + +```js +// ES5 example +const { SignerClient, AddProfilePermissionCommand } = require("@aws-sdk/client-signer"); +``` + +```ts +// ES6+ example +import { SignerClient, AddProfilePermissionCommand } from "@aws-sdk/client-signer"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SignerClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddProfilePermissionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-signer"; +const client = new AWS.Signer({ region: "REGION" }); + +// async/await. +try { + const data = client.addProfilePermission(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addProfilePermission(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addProfilePermission(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-signer` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sms/README.md b/clients/client-sms/README.md index 906d42cac85b..e1c5bb4cfe7b 100644 --- a/clients/client-sms/README.md +++ b/clients/client-sms/README.md @@ -3,4 +3,218 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sms/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sms) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sms.svg)](https://www.npmjs.com/package/@aws-sdk/client-sms) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SMS Client for Node.js, Browser and React Native. + +AWS Server Migration Service + +

AWS Server Migration Service (AWS SMS) makes it easier and faster for you to migrate your +on-premises workloads to AWS. To learn more about AWS SMS, see the following +resources:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sms +using your favorite package manager: + +- `npm install @aws-sdk/client-sms` +- `yarn add @aws-sdk/client-sms` +- `pnpm add @aws-sdk/client-sms` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SMSClient` and +the commands you need, for example `CreateAppCommand`: + +```js +// ES5 example +const { SMSClient, CreateAppCommand } = require("@aws-sdk/client-sms"); +``` + +```ts +// ES6+ example +import { SMSClient, CreateAppCommand } from "@aws-sdk/client-sms"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SMSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateAppCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sms"; +const client = new AWS.SMS({ region: "REGION" }); + +// async/await. +try { + const data = client.createApp(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createApp(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createApp(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sms` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-snowball/README.md b/clients/client-snowball/README.md index e30fea359aad..cd857ba060bc 100644 --- a/clients/client-snowball/README.md +++ b/clients/client-snowball/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-snowball/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-snowball) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-snowball.svg)](https://www.npmjs.com/package/@aws-sdk/client-snowball) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Snowball Client for Node.js, Browser and React Native. + +

AWS Snow Family is a petabyte-scale data transport solution that uses secure devices to +transfer large amounts of data between your on-premises data centers and Amazon Simple Storage +Service (Amazon S3). The Snow commands described here provide access to the same +functionality that is available in the AWS Snow Family Management Console, which enables you to +create and manage jobs for a Snow device. To transfer data locally with a Snow device, you'll +need to use the Snowball Edge client or the Amazon S3 API Interface for Snowball or AWS OpsHub for Snow Family. For more +information, see the User Guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-snowball +using your favorite package manager: + +- `npm install @aws-sdk/client-snowball` +- `yarn add @aws-sdk/client-snowball` +- `pnpm add @aws-sdk/client-snowball` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SnowballClient` and +the commands you need, for example `CancelClusterCommand`: + +```js +// ES5 example +const { SnowballClient, CancelClusterCommand } = require("@aws-sdk/client-snowball"); +``` + +```ts +// ES6+ example +import { SnowballClient, CancelClusterCommand } from "@aws-sdk/client-snowball"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SnowballClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelClusterCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-snowball"; +const client = new AWS.Snowball({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelCluster(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelCluster(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelCluster(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-snowball` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sns/README.md b/clients/client-sns/README.md index e09482760c98..cdf2d3292428 100644 --- a/clients/client-sns/README.md +++ b/clients/client-sns/README.md @@ -3,4 +3,215 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sns/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sns) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sns.svg)](https://www.npmjs.com/package/@aws-sdk/client-sns) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SNS Client for Node.js, Browser and React Native. + +Amazon Simple Notification Service + +

Amazon Simple Notification Service (Amazon SNS) is a web service that enables you to build +distributed web-enabled applications. Applications can use Amazon SNS to easily push +real-time notification messages to interested subscribers over multiple delivery +protocols. For more information about this product see https://aws.amazon.com/sns. For detailed information about Amazon SNS +features and their associated API calls, see the Amazon SNS Developer Guide.

+

For information on the permissions you need to use this API, see +Identity and +access management in Amazon SNS in the Amazon SNS Developer Guide. +

+

We also provide SDKs that enable you to access Amazon SNS from your preferred programming +language. The SDKs contain functionality that automatically takes care of tasks such as: +cryptographically signing your service requests, retrying requests, and handling error +responses. For a list of available SDKs, go to Tools for Amazon Web Services.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sns +using your favorite package manager: + +- `npm install @aws-sdk/client-sns` +- `yarn add @aws-sdk/client-sns` +- `pnpm add @aws-sdk/client-sns` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SNSClient` and +the commands you need, for example `AddPermissionCommand`: + +```js +// ES5 example +const { SNSClient, AddPermissionCommand } = require("@aws-sdk/client-sns"); +``` + +```ts +// ES6+ example +import { SNSClient, AddPermissionCommand } from "@aws-sdk/client-sns"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SNSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddPermissionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sns"; +const client = new AWS.SNS({ region: "REGION" }); + +// async/await. +try { + const data = client.addPermission(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addPermission(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addPermission(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sns` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sqs/README.md b/clients/client-sqs/README.md index 005d4464c4a5..5dedb1abbbfa 100644 --- a/clients/client-sqs/README.md +++ b/clients/client-sqs/README.md @@ -3,4 +3,269 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sqs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sqs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sqs.svg)](https://www.npmjs.com/package/@aws-sdk/client-sqs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SQS Client for Node.js, Browser and React Native. + +

Welcome to the Amazon Simple Queue Service API Reference.

+

Amazon Simple Queue Service (Amazon SQS) is a reliable, highly-scalable hosted queue for storing messages as they travel between applications or microservices. Amazon SQS moves data between distributed application components and helps you decouple these components.

+

For information on the permissions you need to use this API, see +Identity and +access management in the Amazon Simple Queue Service Developer Guide. +

+

You can use AWS SDKs to access Amazon SQS using your favorite programming language. The SDKs perform tasks such as the following automatically:

+ + +

+Additional Information +

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sqs +using your favorite package manager: + +- `npm install @aws-sdk/client-sqs` +- `yarn add @aws-sdk/client-sqs` +- `pnpm add @aws-sdk/client-sqs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SQSClient` and +the commands you need, for example `AddPermissionCommand`: + +```js +// ES5 example +const { SQSClient, AddPermissionCommand } = require("@aws-sdk/client-sqs"); +``` + +```ts +// ES6+ example +import { SQSClient, AddPermissionCommand } from "@aws-sdk/client-sqs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SQSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddPermissionCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sqs"; +const client = new AWS.SQS({ region: "REGION" }); + +// async/await. +try { + const data = client.addPermission(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addPermission(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addPermission(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sqs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-ssm/README.md b/clients/client-ssm/README.md index 47c29b369fcf..84d8a93634bf 100644 --- a/clients/client-ssm/README.md +++ b/clients/client-ssm/README.md @@ -3,4 +3,215 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-ssm/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-ssm) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-ssm.svg)](https://www.npmjs.com/package/@aws-sdk/client-ssm) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SSM Client for Node.js, Browser and React Native. + +AWS Systems Manager + +

AWS Systems Manager is a collection of capabilities that helps you automate management tasks such as +collecting system inventory, applying operating system (OS) patches, automating the creation of +Amazon Machine Images (AMIs), and configuring operating systems (OSs) and applications at scale. +Systems Manager lets you remotely and securely manage the configuration of your managed instances. A +managed instance is any Amazon Elastic Compute Cloud instance (EC2 instance), or any +on-premises server or virtual machine (VM) in your hybrid environment that has been configured +for Systems Manager.

+

This reference is intended to be used with the AWS Systems Manager User Guide.

+

To get started, verify prerequisites and configure managed instances. For more information, +see Setting up +AWS Systems Manager in the AWS Systems Manager User Guide.

+

For information about other API actions you can perform on EC2 instances, see the Amazon EC2 API Reference. For information +about how to use a Query API, see Making API requests.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-ssm +using your favorite package manager: + +- `npm install @aws-sdk/client-ssm` +- `yarn add @aws-sdk/client-ssm` +- `pnpm add @aws-sdk/client-ssm` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SSMClient` and +the commands you need, for example `AddTagsToResourceCommand`: + +```js +// ES5 example +const { SSMClient, AddTagsToResourceCommand } = require("@aws-sdk/client-ssm"); +``` + +```ts +// ES6+ example +import { SSMClient, AddTagsToResourceCommand } from "@aws-sdk/client-ssm"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SSMClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddTagsToResourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-ssm"; +const client = new AWS.SSM({ region: "REGION" }); + +// async/await. +try { + const data = client.addTagsToResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addTagsToResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addTagsToResource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-ssm` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sso-admin/README.md b/clients/client-sso-admin/README.md index 474d307ad9de..1f31453960f2 100644 --- a/clients/client-sso-admin/README.md +++ b/clients/client-sso-admin/README.md @@ -3,4 +3,199 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sso-admin/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso-admin) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sso-admin.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso-admin) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SSOAdmin Client for Node.js, Browser and React Native. + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sso-admin +using your favorite package manager: + +- `npm install @aws-sdk/client-sso-admin` +- `yarn add @aws-sdk/client-sso-admin` +- `pnpm add @aws-sdk/client-sso-admin` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SSOAdminClient` and +the commands you need, for example `AttachManagedPolicyToPermissionSetCommand`: + +```js +// ES5 example +const { SSOAdminClient, AttachManagedPolicyToPermissionSetCommand } = require("@aws-sdk/client-sso-admin"); +``` + +```ts +// ES6+ example +import { SSOAdminClient, AttachManagedPolicyToPermissionSetCommand } from "@aws-sdk/client-sso-admin"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SSOAdminClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AttachManagedPolicyToPermissionSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sso-admin"; +const client = new AWS.SSOAdmin({ region: "REGION" }); + +// async/await. +try { + const data = client.attachManagedPolicyToPermissionSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .attachManagedPolicyToPermissionSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.attachManagedPolicyToPermissionSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sso-admin` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sso-oidc/README.md b/clients/client-sso-oidc/README.md index ae2094e9e632..d50b2fe93c8e 100644 --- a/clients/client-sso-oidc/README.md +++ b/clients/client-sso-oidc/README.md @@ -3,4 +3,218 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sso-oidc/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso-oidc) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sso-oidc.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso-oidc) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SSOOIDC Client for Node.js, Browser and React Native. + +

AWS Single Sign-On (SSO) OpenID Connect (OIDC) is a web service that enables a client +(such as AWS CLI or a native application) to register with AWS SSO. The service also +enables the client to fetch the user’s access token upon successful authentication and +authorization with AWS SSO. This service conforms with the OAuth 2.0 based implementation of +the device authorization grant standard (https://tools.ietf.org/html/rfc8628).

+ +

For general information about AWS SSO, see What is AWS +Single Sign-On? in the AWS SSO User Guide.

+ +

This API reference guide describes the AWS SSO OIDC operations that you can call +programatically and includes detailed information on data types and errors.

+ + +

AWS provides SDKs that consist of libraries and sample code for various programming +languages and platforms such as Java, Ruby, .Net, iOS, and Android. The SDKs provide a +convenient way to create programmatic access to AWS SSO and other AWS services. For more +information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sso-oidc +using your favorite package manager: + +- `npm install @aws-sdk/client-sso-oidc` +- `yarn add @aws-sdk/client-sso-oidc` +- `pnpm add @aws-sdk/client-sso-oidc` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SSOOIDCClient` and +the commands you need, for example `CreateTokenCommand`: + +```js +// ES5 example +const { SSOOIDCClient, CreateTokenCommand } = require("@aws-sdk/client-sso-oidc"); +``` + +```ts +// ES6+ example +import { SSOOIDCClient, CreateTokenCommand } from "@aws-sdk/client-sso-oidc"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SSOOIDCClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateTokenCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sso-oidc"; +const client = new AWS.SSOOIDC({ region: "REGION" }); + +// async/await. +try { + const data = client.createToken(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createToken(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createToken(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sso-oidc` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sso/README.md b/clients/client-sso/README.md index 066e9990e33d..88a030b7c558 100644 --- a/clients/client-sso/README.md +++ b/clients/client-sso/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sso/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sso.svg)](https://www.npmjs.com/package/@aws-sdk/client-sso) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SSO Client for Node.js, Browser and React Native. + +

AWS Single Sign-On Portal is a web service that makes it easy for you to assign user +access to AWS SSO resources such as the user portal. Users can get AWS account applications +and roles assigned to them and get federated into the application.

+ +

For general information about AWS SSO, see What is AWS +Single Sign-On? in the AWS SSO User Guide.

+ +

This API reference guide describes the AWS SSO Portal operations that you can call +programatically and includes detailed information on data types and errors.

+ + +

AWS provides SDKs that consist of libraries and sample code for various programming +languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs provide a +convenient way to create programmatic access to AWS SSO and other AWS services. For more +information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sso +using your favorite package manager: + +- `npm install @aws-sdk/client-sso` +- `yarn add @aws-sdk/client-sso` +- `pnpm add @aws-sdk/client-sso` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SSOClient` and +the commands you need, for example `GetRoleCredentialsCommand`: + +```js +// ES5 example +const { SSOClient, GetRoleCredentialsCommand } = require("@aws-sdk/client-sso"); +``` + +```ts +// ES6+ example +import { SSOClient, GetRoleCredentialsCommand } from "@aws-sdk/client-sso"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SSOClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetRoleCredentialsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sso"; +const client = new AWS.SSO({ region: "REGION" }); + +// async/await. +try { + const data = client.getRoleCredentials(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getRoleCredentials(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getRoleCredentials(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sso` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-storage-gateway/README.md b/clients/client-storage-gateway/README.md index 62db3190c9d5..32e5fefb6038 100644 --- a/clients/client-storage-gateway/README.md +++ b/clients/client-storage-gateway/README.md @@ -3,4 +3,272 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-storage-gateway/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-storage-gateway) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-storage-gateway.svg)](https://www.npmjs.com/package/@aws-sdk/client-storage-gateway) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript StorageGateway Client for Node.js, Browser and React Native. + +AWS Storage Gateway Service + +

AWS Storage Gateway is the service that connects an on-premises software appliance with +cloud-based storage to provide seamless and secure integration between an +organization's on-premises IT environment and the AWS storage infrastructure. The +service enables you to securely upload data to the AWS Cloud for cost effective backup and +rapid disaster recovery.

+ +

Use the following links to get started using the AWS Storage Gateway Service +API Reference:

+ + + + +

AWS Storage Gateway resource IDs are in uppercase. When you use these resource IDs +with the Amazon EC2 API, EC2 expects resource IDs in lowercase. You must change your +resource ID to lowercase to use it with the EC2 API. For example, in Storage Gateway the +ID for a volume might be vol-AA22BB012345DAF670. When you use this ID with +the EC2 API, you must change it to vol-aa22bb012345daf670. Otherwise, the +EC2 API might not behave as expected.

+
+ + +

IDs for Storage Gateway volumes and Amazon EBS snapshots created from gateway volumes +are changing to a longer format. Starting in December 2016, all new volumes and +snapshots will be created with a 17-character string. Starting in April 2016, you will +be able to use these longer IDs so you can test your systems with the new format. For +more information, see Longer EC2 and +EBS resource IDs.

+ +

For example, a volume Amazon Resource Name (ARN) with the longer volume ID format +looks like the following:

+ +

+arn:aws:storagegateway:us-west-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABBCCDDEEFFG.

+ +

A snapshot ID with the longer ID format looks like the following: +snap-78e226633445566ee.

+ +

For more information, see Announcement: +Heads-up – Longer AWS Storage Gateway volume and snapshot IDs coming in +2016.

+
+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-storage-gateway +using your favorite package manager: + +- `npm install @aws-sdk/client-storage-gateway` +- `yarn add @aws-sdk/client-storage-gateway` +- `pnpm add @aws-sdk/client-storage-gateway` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `StorageGatewayClient` and +the commands you need, for example `ActivateGatewayCommand`: + +```js +// ES5 example +const { StorageGatewayClient, ActivateGatewayCommand } = require("@aws-sdk/client-storage-gateway"); +``` + +```ts +// ES6+ example +import { StorageGatewayClient, ActivateGatewayCommand } from "@aws-sdk/client-storage-gateway"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new StorageGatewayClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new ActivateGatewayCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-storage-gateway"; +const client = new AWS.StorageGateway({ region: "REGION" }); + +// async/await. +try { + const data = client.activateGateway(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .activateGateway(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.activateGateway(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-storage-gateway` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-sts/README.md b/clients/client-sts/README.md index e931d80a26cc..d8b46410abfe 100644 --- a/clients/client-sts/README.md +++ b/clients/client-sts/README.md @@ -3,4 +3,206 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-sts/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-sts) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-sts.svg)](https://www.npmjs.com/package/@aws-sdk/client-sts) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript STS Client for Node.js, Browser and React Native. + +AWS Security Token Service + +

AWS Security Token Service (STS) enables you to request temporary, limited-privilege +credentials for AWS Identity and Access Management (IAM) users or for users that you +authenticate (federated users). This guide provides descriptions of the STS API. For +more information about using this service, see Temporary Security Credentials.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-sts +using your favorite package manager: + +- `npm install @aws-sdk/client-sts` +- `yarn add @aws-sdk/client-sts` +- `pnpm add @aws-sdk/client-sts` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `STSClient` and +the commands you need, for example `AssumeRoleCommand`: + +```js +// ES5 example +const { STSClient, AssumeRoleCommand } = require("@aws-sdk/client-sts"); +``` + +```ts +// ES6+ example +import { STSClient, AssumeRoleCommand } from "@aws-sdk/client-sts"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new STSClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssumeRoleCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-sts"; +const client = new AWS.STS({ region: "REGION" }); + +// async/await. +try { + const data = client.assumeRole(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .assumeRole(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.assumeRole(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-sts` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-support/README.md b/clients/client-support/README.md index d8f59cd9dfcb..8e2f176263f9 100644 --- a/clients/client-support/README.md +++ b/clients/client-support/README.md @@ -3,4 +3,278 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-support/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-support) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-support.svg)](https://www.npmjs.com/package/@aws-sdk/client-support) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Support Client for Node.js, Browser and React Native. + +AWS Support + +

The AWS Support API reference is intended for programmers who need detailed information +about the AWS Support operations and data types. This service enables you to manage your AWS +Support cases programmatically. It uses HTTP methods that return results in JSON +format.

+ + + +

The AWS Support service also exposes a set of AWS Trusted Advisor features. You can +retrieve a list of checks and their descriptions, get check results, specify checks to +refresh, and get the refresh status of checks.

+

The following list describes the AWS Support case management operations:

+ +

The following list describes the operations available from the AWS Support service for +Trusted Advisor:

+ +

For authentication of requests, AWS Support uses Signature Version 4 Signing +Process.

+

See About the +AWS Support API in the AWS Support User Guide for +information about how to use this service to create and manage your support cases, and +how to call Trusted Advisor for results of checks on your resources.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-support +using your favorite package manager: + +- `npm install @aws-sdk/client-support` +- `yarn add @aws-sdk/client-support` +- `pnpm add @aws-sdk/client-support` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SupportClient` and +the commands you need, for example `AddAttachmentsToSetCommand`: + +```js +// ES5 example +const { SupportClient, AddAttachmentsToSetCommand } = require("@aws-sdk/client-support"); +``` + +```ts +// ES6+ example +import { SupportClient, AddAttachmentsToSetCommand } from "@aws-sdk/client-support"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SupportClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AddAttachmentsToSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-support"; +const client = new AWS.Support({ region: "REGION" }); + +// async/await. +try { + const data = client.addAttachmentsToSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .addAttachmentsToSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.addAttachmentsToSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-support` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-swf/README.md b/clients/client-swf/README.md index 639abb441af0..ef75ab8f4c39 100644 --- a/clients/client-swf/README.md +++ b/clients/client-swf/README.md @@ -3,4 +3,216 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-swf/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-swf) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-swf.svg)](https://www.npmjs.com/package/@aws-sdk/client-swf) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript SWF Client for Node.js, Browser and React Native. + +Amazon Simple Workflow Service + +

The Amazon Simple Workflow Service (Amazon SWF) makes it easy to build applications that use Amazon's cloud to +coordinate work across distributed components. In Amazon SWF, a task +represents a logical unit of work that is performed by a component of your workflow. +Coordinating tasks in a workflow involves managing intertask dependencies, scheduling, and +concurrency in accordance with the logical flow of the application.

+ +

Amazon SWF gives you full control over implementing tasks and coordinating them without +worrying about underlying complexities such as tracking their progress and maintaining their +state.

+ +

This documentation serves as reference only. For a broader overview of the Amazon SWF +programming model, see the +Amazon SWF Developer Guide +.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-swf +using your favorite package manager: + +- `npm install @aws-sdk/client-swf` +- `yarn add @aws-sdk/client-swf` +- `pnpm add @aws-sdk/client-swf` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SWFClient` and +the commands you need, for example `CountClosedWorkflowExecutionsCommand`: + +```js +// ES5 example +const { SWFClient, CountClosedWorkflowExecutionsCommand } = require("@aws-sdk/client-swf"); +``` + +```ts +// ES6+ example +import { SWFClient, CountClosedWorkflowExecutionsCommand } from "@aws-sdk/client-swf"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SWFClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CountClosedWorkflowExecutionsCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-swf"; +const client = new AWS.SWF({ region: "REGION" }); + +// async/await. +try { + const data = client.countClosedWorkflowExecutions(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .countClosedWorkflowExecutions(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.countClosedWorkflowExecutions(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-swf` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-synthetics/README.md b/clients/client-synthetics/README.md index 5f36d4198a69..07a275fabc8c 100644 --- a/clients/client-synthetics/README.md +++ b/clients/client-synthetics/README.md @@ -3,4 +3,217 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-synthetics/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-synthetics) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-synthetics.svg)](https://www.npmjs.com/package/@aws-sdk/client-synthetics) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Synthetics Client for Node.js, Browser and React Native. + +Amazon CloudWatch Synthetics + +

You can use Amazon CloudWatch Synthetics to continually monitor your services. You can +create and manage canaries, which are modular, lightweight scripts +that monitor your endpoints and APIs +from the outside-in. You can set up your canaries to run +24 hours a day, once per minute. The canaries help you check the availability and latency +of your web services and troubleshoot anomalies by investigating load time data, +screenshots of the UI, logs, and metrics. The canaries seamlessly integrate with CloudWatch +ServiceLens to help you trace the causes of impacted nodes in your applications. For more +information, see Using ServiceLens to Monitor +the Health of Your Applications in the Amazon CloudWatch User +Guide.

+ +

Before you create and manage canaries, be aware of the security considerations. For more +information, see Security +Considerations for Synthetics Canaries.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-synthetics +using your favorite package manager: + +- `npm install @aws-sdk/client-synthetics` +- `yarn add @aws-sdk/client-synthetics` +- `pnpm add @aws-sdk/client-synthetics` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `SyntheticsClient` and +the commands you need, for example `CreateCanaryCommand`: + +```js +// ES5 example +const { SyntheticsClient, CreateCanaryCommand } = require("@aws-sdk/client-synthetics"); +``` + +```ts +// ES6+ example +import { SyntheticsClient, CreateCanaryCommand } from "@aws-sdk/client-synthetics"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new SyntheticsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateCanaryCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-synthetics"; +const client = new AWS.Synthetics({ region: "REGION" }); + +// async/await. +try { + const data = client.createCanary(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createCanary(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createCanary(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-synthetics` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-textract/README.md b/clients/client-textract/README.md index bf4e45203c3c..f99ed4f9d642 100644 --- a/clients/client-textract/README.md +++ b/clients/client-textract/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-textract/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-textract) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-textract.svg)](https://www.npmjs.com/package/@aws-sdk/client-textract) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Textract Client for Node.js, Browser and React Native. + +

Amazon Textract detects and analyzes text in documents and converts it +into machine-readable text. This is the API reference documentation for +Amazon Textract.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-textract +using your favorite package manager: + +- `npm install @aws-sdk/client-textract` +- `yarn add @aws-sdk/client-textract` +- `pnpm add @aws-sdk/client-textract` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TextractClient` and +the commands you need, for example `AnalyzeDocumentCommand`: + +```js +// ES5 example +const { TextractClient, AnalyzeDocumentCommand } = require("@aws-sdk/client-textract"); +``` + +```ts +// ES6+ example +import { TextractClient, AnalyzeDocumentCommand } from "@aws-sdk/client-textract"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new TextractClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AnalyzeDocumentCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-textract"; +const client = new AWS.Textract({ region: "REGION" }); + +// async/await. +try { + const data = client.analyzeDocument(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .analyzeDocument(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.analyzeDocument(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-textract` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-timestream-query/README.md b/clients/client-timestream-query/README.md index 51614bf440d5..6a08b83cf4ca 100644 --- a/clients/client-timestream-query/README.md +++ b/clients/client-timestream-query/README.md @@ -3,4 +3,203 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-timestream-query/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-timestream-query) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-timestream-query.svg)](https://www.npmjs.com/package/@aws-sdk/client-timestream-query) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript TimestreamQuery Client for Node.js, Browser and React Native. + +

+ +

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-timestream-query +using your favorite package manager: + +- `npm install @aws-sdk/client-timestream-query` +- `yarn add @aws-sdk/client-timestream-query` +- `pnpm add @aws-sdk/client-timestream-query` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TimestreamQueryClient` and +the commands you need, for example `CancelQueryCommand`: + +```js +// ES5 example +const { TimestreamQueryClient, CancelQueryCommand } = require("@aws-sdk/client-timestream-query"); +``` + +```ts +// ES6+ example +import { TimestreamQueryClient, CancelQueryCommand } from "@aws-sdk/client-timestream-query"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new TimestreamQueryClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CancelQueryCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-timestream-query"; +const client = new AWS.TimestreamQuery({ region: "REGION" }); + +// async/await. +try { + const data = client.cancelQuery(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .cancelQuery(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.cancelQuery(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-timestream-query` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-timestream-write/README.md b/clients/client-timestream-write/README.md index 35ed07ff3ca5..b8306c6eeda7 100644 --- a/clients/client-timestream-write/README.md +++ b/clients/client-timestream-write/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-timestream-write/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-timestream-write) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-timestream-write.svg)](https://www.npmjs.com/package/@aws-sdk/client-timestream-write) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript TimestreamWrite Client for Node.js, Browser and React Native. + +

Amazon Timestream is a fast, scalable, fully managed time series database service that makes it easy to store and analyze trillions of time series data points per day. With Timestream, you can easily store and analyze IoT sensor data to derive insights from your IoT applications. You can analyze industrial telemetry to streamline equipment management and maintenance. You can also store and analyze log data and metrics to improve the performance and availability of your applications. Timestream is built from the ground up to effectively ingest, process, and store time series data. It organizes data to optimize query processing. It automatically scales based on the volume of data ingested and on the query volume to ensure you receive optimal performance while inserting and querying data. As your data grows over time, Timestream’s adaptive query processing engine spans across storage tiers to provide fast analysis while reducing costs.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-timestream-write +using your favorite package manager: + +- `npm install @aws-sdk/client-timestream-write` +- `yarn add @aws-sdk/client-timestream-write` +- `pnpm add @aws-sdk/client-timestream-write` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TimestreamWriteClient` and +the commands you need, for example `CreateDatabaseCommand`: + +```js +// ES5 example +const { TimestreamWriteClient, CreateDatabaseCommand } = require("@aws-sdk/client-timestream-write"); +``` + +```ts +// ES6+ example +import { TimestreamWriteClient, CreateDatabaseCommand } from "@aws-sdk/client-timestream-write"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new TimestreamWriteClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateDatabaseCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-timestream-write"; +const client = new AWS.TimestreamWrite({ region: "REGION" }); + +// async/await. +try { + const data = client.createDatabase(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createDatabase(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createDatabase(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-timestream-write` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-transcribe-streaming/README.md b/clients/client-transcribe-streaming/README.md index 7bfc8ab190ca..f060028b1fe2 100644 --- a/clients/client-transcribe-streaming/README.md +++ b/clients/client-transcribe-streaming/README.md @@ -1,256 +1,209 @@ # @aws-sdk/client-transcribe-streaming -[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-transcribe-streaming/gamma.svg)](https://www.npmjs.com/package/@aws-sdk/client-transcribe-streaming) +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-transcribe-streaming/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-transcribe-streaming) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-transcribe-streaming.svg)](https://www.npmjs.com/package/@aws-sdk/client-transcribe-streaming) -## Introduction +## Description -Amazon Transcribe streaming enables you to send an audio stream and receive back a stream of text in real time. -The API makes it easy for developers to add real-time speech-to-text capability to their applications. It can be used -for a variety of purposes. For example: +AWS SDK for JavaScript TranscribeStreaming Client for Node.js, Browser and React Native. -- Streaming transcriptions can generate real-time subtitles for live broadcast media. -- Lawyers can make real-time annotations on top of streaming transcriptions during courtroom depositions. -- Video game chat can be transcribed in real time so that hosts can moderate content or run real-time analysis. -- Streaming transcriptions can provide assistance to the hearing impaired. +

Operations and objects for transcribing streaming speech to text.

-The JavaScript SDK Transcribe Streaming client encapsulates the API into a JavaScript library that can be run on -browsers, Node.js and _potentially_ React Native. By default, the client uses HTTP/2 connection on Node.js, and uses -`WebSocket` connection on browsers and React Native. +## Installing -## Getting Started +To install the this package, simply type add or install @aws-sdk/client-transcribe-streaming +using your favorite package manager: -In the sections bellow, we will explain the library by an example of using `startStreamTranscription` method to -transcribe English speech to text. +- `npm install @aws-sdk/client-transcribe-streaming` +- `yarn add @aws-sdk/client-transcribe-streaming` +- `pnpm add @aws-sdk/client-transcribe-streaming` -If you haven't, please read [the root README](../../README.md) for guidance for creating a sample application and -installation. After installation, in the `index.js`, you can import the Transcribe Streaming client like: +## Getting Started -```javascript -const { TranscribeStreamingClient, StartStreamTranscriptionCommand } = require("@aws-sdk/client-transcribe-streaming"); -``` +### Import -If `require` is not available on the platform you are working on(browsers). You can import the client like: +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TranscribeStreamingClient` and +the commands you need, for example `StartMedicalStreamTranscriptionCommand`: -```javascript -import { TranscribeStreamingClient, StartStreamTranscriptionCommand } from "@aws-sdk/client-transcribe-streaming"; +```js +// ES5 example +const { + TranscribeStreamingClient, + StartMedicalStreamTranscriptionCommand, +} = require("@aws-sdk/client-transcribe-streaming"); ``` -## Constructing the Service Client - -You can create a service client like bellow: - -```javascript -const client = new TranscribeStreamingClient({ - region, - credentials, -}); -// region and credentials are optional in Node.js +```ts +// ES6+ example +import { + TranscribeStreamingClient, + StartMedicalStreamTranscriptionCommand, +} from "@aws-sdk/client-transcribe-streaming"; ``` -## Acquire Speech Stream +### Usage -The Transcribe Streaming client accepts streaming speech input as an [async iterable]. You can construct them from either an async generator or using `Symbol.asyncIterable` to emit binary chunks. +To send a request, you: -Here's an example of using async generator: +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. -```javascript -const audioStream = async function* () { - await device.start(); - while (device.ends !== true) { - const chunk = await device.read(); - yield chunk; /* yield binary chunk */ - } -}; -``` +```js +// a client can be shared by difference commands. +const client = new TranscribeStreamingClient({ region: "REGION" }); -Then you need to construct the binary chunk into an audio chunk shape that can be recognized by the SDK: - -```javascript -const audioStream = async function* () { - for await (const chunk of audioSource()) { - yield { AudioEvent: { AudioChunk: chunk } }; - } +const params = { + /** input parameters */ }; +const command = new StartMedicalStreamTranscriptionCommand(params); ``` -### Acquire from Node.js Stream API +#### Async/await -In Node.js you will mostly acquire the speech in [Stream API], from HTTP request or devices. Stream API in Node.js (>= -10.0.0) itself is an async iterable. You can supply the streaming into the SDK input without explicit convert. You -only need to construct the audio chunk shape that can be recognized by the SDK: +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: -```javascript -const audioSource = req; //Incoming message -const audioStream = async function* () { - for await (const payloadChunk of audioSource) { - yield { AudioEvent: { AudioChunk: payloadChunk } }; - } -}; -``` - -If you see don't limit the chunk size on the client side, for example, streams from `fs`, you might see -`The chunk is too big` error from the Transcribe Streaming. You can solve it by setting the [`HighWaterMark`][readable hightwatermark]: - -```javascript -const { PassThrough } = require("stream"); -const { createReadStream } = require("fs"); -const audioSource = createReadStream("path/to/speech.wav"); -const audioPayloadStream = new PassThrough({ highWaterMark: 1 * 1024 }); // Stream chunk less than 1 KB -audioSource.pipe(audioPayloadStream); -const audioStream = async function* () { - for await (const payloadChunk of audioPayloadStream) { - yield { AudioEvent: { AudioChunk: payloadChunk } }; - } -}; +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} ``` -Depending on the audio source, you may need to [PCM encode](#PCM-encoding) you audio chunk. +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. -### Acquire from Browsers +#### Promises -The Transcribe Streaming SDK client also supports streaming from browsers. You can acquire the microphone data through -[`getUserMedia` API][getusermedia api]. Note that this API is supported by [a subset of browsers][getusermedia support]. -Here's a code snippet of acquiring microphone audio stream using [`microphone-stream`][microphone-stream] +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. -```javascript -const mic = require("microphone-stream"); -// this part should be put into an async function -micStream.setStream( - await window.navigator.mediaDevices.getUserMedia({ - video: false, - audio: true, - }) -); -const audioStream = async function* () { - for await (const chunk of micStream) { - yield { AudioEvent: { AudioChunk: pcmEncodeChunk(chunk) /* pcm Encoding is optional depending on the source */ } }; +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. } -}; +); ``` -You can find the a full front-end example [here][front-end example repo] +Promises can also be called using `.catch()` and `.finally()` as follows: -#### PCM encoding +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` -Currently Transcribe Streaming service only accepts [PCM][pcm] encoding. If your audio source is not already encoded, -you need to PCM encoding the chunks. Here's an example: +#### Callbacks -```javascript -const pcmEncodeChunk = (chunk) => { - const input = mic.toRaw(chunk); - var offset = 0; - var buffer = new ArrayBuffer(input.length * 2); - var view = new DataView(buffer); - for (var i = 0; i < input.length; i++, offset += 2) { - var s = Math.max(-1, Math.min(1, input[i])); - view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true); - } - return Buffer.from(buffer); -}; -``` +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. -## Send the Speech Stream - -```javascript -const command = new StartStreamTranscriptionCommand({ - // The language code for the input audio. Valid values are en-GB, en-US, es-US, fr-CA, and fr-FR - LanguageCode: "en-US", - // The encoding used for the input audio. The only valid value is pcm. - MediaEncoding: "pcm", - // The sample rate of the input audio in Hertz. We suggest that you use 8000 Hz for low-quality audio and 16000 Hz for - // high-quality audio. The sample rate must match the sample rate in the audio file. - MediaSampleRateHertz: 44100, - AudioStream: audioStream(), +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. }); -const response = await client.send(command); ``` -## Handling Text Stream - -If the request succeeds, you will get a response containing the streaming transcript like [this][response data example]. -Just like the input speech stream, the transcript stream is an [async iterable][async iterable] emitting the partial -transcripts. Here is a code snippet of accessing the transcripts - -```javascript -// This snippet should be put into an async function -for await (const event of response.TranscriptResultStream) { - if (event.TranscriptEvent) { - const message = event.TranscriptEvent; - // Get multiple possible results - const results = event.TranscriptEvent.Transcript.Results; - // Print all the possible transcripts - results.map((result) => { - (result.Alternatives || []).map((alternative) => { - const transcript = alternative.Items.map((item) => item.Content).join(" "); - console.log(transcript); - }); - }); - } +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-transcribe-streaming"; +const client = new AWS.TranscribeStreaming({ region: "REGION" }); + +// async/await. +try { + const data = client.startMedicalStreamTranscription(params); + // process data. +} catch (error) { + // error handling. } + +// Promises. +client + .startMedicalStreamTranscription(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.startMedicalStreamTranscription(params, (err, data) => { + // proccess err and data. +}); ``` -### Pipe Transcripts Stream +### Troubleshooting -In Node.js, you can pipe this `TranscriptResultStream` to other destinations easily with the [`from` API][readable.from]: +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). -```javascript -const { Readable } = require("stream"); -const transcriptsStream = Readable.from(response.TranscriptResultStream); -transcriptsStream.pipe(/* some destinations */); +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} ``` -## Error Handling +## Getting Help -If you are using `async...await` style code, you are able to catch the errors with `try...catch` block. There are 2 -categories of exceptions can be thrown: +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. -- Immediate exceptions thrown before transcription is started, like signature - exceptions, invalid parameters exceptions, and network errors; -- Streaming exceptions that happens after transcription is - started, like `InternalFailureException` or `ConflictException`. +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). -For immediate exceptions, the SDK client will retry the request if the error is retryable, like network errors. You can -config the client to behave as you intend to. +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). -For streaming exceptions, because the streaming transcription is already -started, client cannot retry the request automatically. The client will throw these exceptions and users can handle the -stream behavior accordingly. +## Contributing -Here's an example of error handling flow: +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-transcribe-streaming` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). -```javascript -try { - const response = await client.send(command); - await handleResponse(response); -} catch (e) { - if (e.name === "InternalFailureException") { - /* handle InternalFailureException */ - } else if (e.name === "ConflictException") { - /* handle ConflictException */ - } -} finally { - /* clean resources like input stream */ -} -``` +## License -## Notes for React Native - -This package is compatible with React Native (>= 0.60). However, it is not tested with any React Native libraries that -converts microphone record into streaming data. Community input for integrating streaming microphone record data is -welcome. - -Thank you for reading this guide. If you want to know more about how streams are encoded, how connection is established, -please refer to the [Service API guide][service api guide]. - -[async iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of -[stream api]: https://nodejs.org/docs/latest-v12.x/api/stream.html -[readable hightwatermark]: https://nodejs.org/docs/latest-v12.x/api/stream.html#stream_readable_readablehighwatermark -[getusermedia api]: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia -[getusermedia support]: https://caniuse.com/#search=getusermedia -[microphone-stream]: https://www.npmjs.com/package/microphone-stream -[front-end example repo]: https://github.com/aws-samples/amazon-transcribe-websocket-static -[pcm]: https://en.wikipedia.org/wiki/Pulse-code_modulation -[response data example]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html -[readable.from]: https://nodejs.org/docs/latest-v12.x/api/stream.html#stream_stream_readable_from_iterable_options -[service api guide]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-transcribe/README.md b/clients/client-transcribe/README.md index 55977e5b5018..ee8650a54ca6 100644 --- a/clients/client-transcribe/README.md +++ b/clients/client-transcribe/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-transcribe/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-transcribe) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-transcribe.svg)](https://www.npmjs.com/package/@aws-sdk/client-transcribe) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Transcribe Client for Node.js, Browser and React Native. + +

Operations and objects for transcribing speech to text.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-transcribe +using your favorite package manager: + +- `npm install @aws-sdk/client-transcribe` +- `yarn add @aws-sdk/client-transcribe` +- `pnpm add @aws-sdk/client-transcribe` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TranscribeClient` and +the commands you need, for example `CreateLanguageModelCommand`: + +```js +// ES5 example +const { TranscribeClient, CreateLanguageModelCommand } = require("@aws-sdk/client-transcribe"); +``` + +```ts +// ES6+ example +import { TranscribeClient, CreateLanguageModelCommand } from "@aws-sdk/client-transcribe"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new TranscribeClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateLanguageModelCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-transcribe"; +const client = new AWS.Transcribe({ region: "REGION" }); + +// async/await. +try { + const data = client.createLanguageModel(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createLanguageModel(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createLanguageModel(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-transcribe` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-transfer/README.md b/clients/client-transfer/README.md index 82c566bd3859..7b8be2b44aef 100644 --- a/clients/client-transfer/README.md +++ b/clients/client-transfer/README.md @@ -3,4 +3,209 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-transfer/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-transfer) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-transfer.svg)](https://www.npmjs.com/package/@aws-sdk/client-transfer) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Transfer Client for Node.js, Browser and React Native. + +

AWS Transfer Family is a fully managed service that enables the transfer of files over the +File Transfer Protocol (FTP), File Transfer Protocol over SSL (FTPS), or Secure Shell (SSH) +File Transfer Protocol (SFTP) directly into and out of Amazon Simple Storage Service (Amazon +S3). AWS helps you seamlessly migrate your file transfer workflows to AWS Transfer Family by +integrating with existing authentication systems, and providing DNS routing with Amazon Route +53 so nothing changes for your customers and partners, or their applications. With your data +in Amazon S3, you can use it with AWS services for processing, analytics, machine learning, +and archiving. Getting started with AWS Transfer Family is easy since there is no +infrastructure to buy and set up.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-transfer +using your favorite package manager: + +- `npm install @aws-sdk/client-transfer` +- `yarn add @aws-sdk/client-transfer` +- `pnpm add @aws-sdk/client-transfer` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TransferClient` and +the commands you need, for example `CreateServerCommand`: + +```js +// ES5 example +const { TransferClient, CreateServerCommand } = require("@aws-sdk/client-transfer"); +``` + +```ts +// ES6+ example +import { TransferClient, CreateServerCommand } from "@aws-sdk/client-transfer"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new TransferClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateServerCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-transfer"; +const client = new AWS.Transfer({ region: "REGION" }); + +// async/await. +try { + const data = client.createServer(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createServer(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createServer(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-transfer` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-translate/README.md b/clients/client-translate/README.md index e2d78ae5618d..9b4c11034294 100644 --- a/clients/client-translate/README.md +++ b/clients/client-translate/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-translate/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-translate) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-translate.svg)](https://www.npmjs.com/package/@aws-sdk/client-translate) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript Translate Client for Node.js, Browser and React Native. + +

Provides translation between one source language and another of the same set of +languages.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-translate +using your favorite package manager: + +- `npm install @aws-sdk/client-translate` +- `yarn add @aws-sdk/client-translate` +- `pnpm add @aws-sdk/client-translate` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `TranslateClient` and +the commands you need, for example `CreateParallelDataCommand`: + +```js +// ES5 example +const { TranslateClient, CreateParallelDataCommand } = require("@aws-sdk/client-translate"); +``` + +```ts +// ES6+ example +import { TranslateClient, CreateParallelDataCommand } from "@aws-sdk/client-translate"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new TranslateClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateParallelDataCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-translate"; +const client = new AWS.Translate({ region: "REGION" }); + +// async/await. +try { + const data = client.createParallelData(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createParallelData(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createParallelData(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-translate` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-waf-regional/README.md b/clients/client-waf-regional/README.md index cc3a5dd86eca..46ed3c31b19a 100644 --- a/clients/client-waf-regional/README.md +++ b/clients/client-waf-regional/README.md @@ -3,4 +3,211 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-waf-regional/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-waf-regional) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-waf-regional.svg)](https://www.npmjs.com/package/@aws-sdk/client-waf-regional) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WAFRegional Client for Node.js, Browser and React Native. + + +

This is AWS WAF Classic Regional documentation. For +more information, see AWS +WAF Classic in the developer guide.

+

+For the latest version of AWS +WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

+
+

This is the AWS WAF Regional Classic API Reference for using AWS WAF Classic with the AWS resources, Elastic Load Balancing (ELB) Application Load Balancers and API Gateway APIs. The AWS WAF Classic actions and data types listed in the reference are available for protecting Elastic Load Balancing (ELB) Application Load Balancers and API Gateway APIs. You can use these actions and data types by means of the endpoints listed in AWS Regions and Endpoints. This guide is for developers who need detailed information about the AWS WAF Classic API actions, data types, and errors. For detailed information about AWS WAF Classic features and an overview of how to use the AWS WAF Classic API, see the +AWS +WAF Classic in the developer guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-waf-regional +using your favorite package manager: + +- `npm install @aws-sdk/client-waf-regional` +- `yarn add @aws-sdk/client-waf-regional` +- `pnpm add @aws-sdk/client-waf-regional` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WAFRegionalClient` and +the commands you need, for example `AssociateWebACLCommand`: + +```js +// ES5 example +const { WAFRegionalClient, AssociateWebACLCommand } = require("@aws-sdk/client-waf-regional"); +``` + +```ts +// ES6+ example +import { WAFRegionalClient, AssociateWebACLCommand } from "@aws-sdk/client-waf-regional"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WAFRegionalClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateWebACLCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-waf-regional"; +const client = new AWS.WAFRegional({ region: "REGION" }); + +// async/await. +try { + const data = client.associateWebACL(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateWebACL(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateWebACL(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-waf-regional` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-waf/README.md b/clients/client-waf/README.md index 4f1d17599bc3..9a9c075d7c4e 100644 --- a/clients/client-waf/README.md +++ b/clients/client-waf/README.md @@ -3,4 +3,211 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-waf/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-waf) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-waf.svg)](https://www.npmjs.com/package/@aws-sdk/client-waf) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WAF Client for Node.js, Browser and React Native. + + +

This is AWS WAF Classic documentation. For +more information, see AWS +WAF Classic in the developer guide.

+

+For the latest version of AWS +WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.

+
+

This is the AWS WAF Classic API Reference for using AWS WAF Classic with Amazon CloudFront. The AWS WAF Classic actions and data types listed in the reference are available for protecting Amazon CloudFront distributions. You can use these actions and data types via the endpoint waf.amazonaws.com. This guide is for developers who need detailed information about the AWS WAF Classic API actions, +data types, and errors. For detailed information about AWS WAF Classic features and an overview of how to use the AWS WAF Classic API, see the +AWS WAF Classic in the developer guide.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-waf +using your favorite package manager: + +- `npm install @aws-sdk/client-waf` +- `yarn add @aws-sdk/client-waf` +- `pnpm add @aws-sdk/client-waf` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WAFClient` and +the commands you need, for example `CreateByteMatchSetCommand`: + +```js +// ES5 example +const { WAFClient, CreateByteMatchSetCommand } = require("@aws-sdk/client-waf"); +``` + +```ts +// ES6+ example +import { WAFClient, CreateByteMatchSetCommand } from "@aws-sdk/client-waf"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WAFClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new CreateByteMatchSetCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-waf"; +const client = new AWS.WAF({ region: "REGION" }); + +// async/await. +try { + const data = client.createByteMatchSet(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .createByteMatchSet(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.createByteMatchSet(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-waf` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-wafv2/README.md b/clients/client-wafv2/README.md index 668842c7c151..19913dc51776 100644 --- a/clients/client-wafv2/README.md +++ b/clients/client-wafv2/README.md @@ -3,4 +3,257 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-wafv2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-wafv2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-wafv2.svg)](https://www.npmjs.com/package/@aws-sdk/client-wafv2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WAFV2 Client for Node.js, Browser and React Native. + + +

This is the latest version of the AWS WAF API, released in +November, 2019. The names of the entities that you use to access this API, like +endpoints and namespaces, all have the versioning information added, like "V2" or "v2", +to distinguish from the prior version. We recommend migrating your resources to this +version, because it has a number of significant improvements.

+

If you used AWS WAF prior to this release, you can't use this AWS WAFV2 API to access +any AWS WAF resources that you created before. You can access your old rules, web ACLs, +and other AWS WAF resources only through the AWS WAF Classic APIs. The AWS WAF Classic +APIs have retained the prior names, endpoints, and namespaces.

+

For information, including how to migrate your AWS WAF resources to this version, see the AWS WAF +Developer Guide.

+
+

AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests +that are forwarded to Amazon CloudFront, an Amazon API Gateway REST API, an Application Load +Balancer, or an AWS AppSync GraphQL API. AWS WAF also lets you control access to your content. Based on conditions that +you specify, such as the IP addresses that requests originate from or the values of query +strings, the API Gateway REST API, CloudFront distribution, the Application Load Balancer, +or the AWS AppSync GraphQL API responds to requests +either with the requested content or with an HTTP 403 status code (Forbidden). You also can +configure CloudFront to return a custom error page when a request is blocked.

+

This API guide is for developers who need detailed information about AWS WAF API +actions, data types, and errors. For detailed information about AWS WAF features and an +overview of how to use AWS WAF, see the AWS WAF Developer Guide.

+

You can make calls using the endpoints listed in AWS Service Endpoints for AWS WAF.

+ +

Alternatively, you can use one of the AWS SDKs to access an API that's tailored to the +programming language or platform that you're using. For more information, see AWS SDKs.

+

We currently provide two versions of the AWS WAF API: this API and the prior versions, +the classic AWS WAF APIs. This new API provides the same functionality as the older +versions, with the following major improvements:

+ + +## Installing + +To install the this package, simply type add or install @aws-sdk/client-wafv2 +using your favorite package manager: + +- `npm install @aws-sdk/client-wafv2` +- `yarn add @aws-sdk/client-wafv2` +- `pnpm add @aws-sdk/client-wafv2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WAFV2Client` and +the commands you need, for example `AssociateWebACLCommand`: + +```js +// ES5 example +const { WAFV2Client, AssociateWebACLCommand } = require("@aws-sdk/client-wafv2"); +``` + +```ts +// ES6+ example +import { WAFV2Client, AssociateWebACLCommand } from "@aws-sdk/client-wafv2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WAFV2Client({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateWebACLCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-wafv2"; +const client = new AWS.WAFV2({ region: "REGION" }); + +// async/await. +try { + const data = client.associateWebACL(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateWebACL(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateWebACL(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-wafv2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-workdocs/README.md b/clients/client-workdocs/README.md index 66f0ca8f1c83..9ec50c946a5d 100644 --- a/clients/client-workdocs/README.md +++ b/clients/client-workdocs/README.md @@ -3,4 +3,233 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-workdocs/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-workdocs) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-workdocs.svg)](https://www.npmjs.com/package/@aws-sdk/client-workdocs) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WorkDocs Client for Node.js, Browser and React Native. + +

The WorkDocs API is designed for the following use cases:

+ +

All Amazon WorkDocs API actions are Amazon authenticated and certificate-signed. +They not only require the use of the AWS SDK, but also allow for the exclusive use of +IAM users and roles to help facilitate access, trust, and permission policies. By +creating a role and allowing an IAM user to access the Amazon WorkDocs site, the IAM +user gains full administrative visibility into the entire Amazon WorkDocs site (or as +set in the IAM policy). This includes, but is not limited to, the ability to modify file +permissions and upload any file to any user. This allows developers to perform the three +use cases above, as well as give users the ability to grant access on a selective basis +using the IAM model.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-workdocs +using your favorite package manager: + +- `npm install @aws-sdk/client-workdocs` +- `yarn add @aws-sdk/client-workdocs` +- `pnpm add @aws-sdk/client-workdocs` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WorkDocsClient` and +the commands you need, for example `AbortDocumentVersionUploadCommand`: + +```js +// ES5 example +const { WorkDocsClient, AbortDocumentVersionUploadCommand } = require("@aws-sdk/client-workdocs"); +``` + +```ts +// ES6+ example +import { WorkDocsClient, AbortDocumentVersionUploadCommand } from "@aws-sdk/client-workdocs"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WorkDocsClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AbortDocumentVersionUploadCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-workdocs"; +const client = new AWS.WorkDocs({ region: "REGION" }); + +// async/await. +try { + const data = client.abortDocumentVersionUpload(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .abortDocumentVersionUpload(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.abortDocumentVersionUpload(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-workdocs` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-worklink/README.md b/clients/client-worklink/README.md index 0722ea64f1dc..38e94658abe3 100644 --- a/clients/client-worklink/README.md +++ b/clients/client-worklink/README.md @@ -3,4 +3,207 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-worklink/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-worklink) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-worklink.svg)](https://www.npmjs.com/package/@aws-sdk/client-worklink) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WorkLink Client for Node.js, Browser and React Native. + +

Amazon WorkLink is a cloud-based service that provides secure access +to internal websites and web apps from iOS and Android phones. In a single step, your users, such as +employees, can access internal websites as efficiently as they access any other public website. +They enter a URL in their web browser, or choose a link to an internal website in an email. Amazon WorkLink +authenticates the user's access and securely renders authorized internal web content in a secure +rendering service in the AWS cloud. Amazon WorkLink doesn't download or store any internal web content on +mobile devices.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-worklink +using your favorite package manager: + +- `npm install @aws-sdk/client-worklink` +- `yarn add @aws-sdk/client-worklink` +- `pnpm add @aws-sdk/client-worklink` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WorkLinkClient` and +the commands you need, for example `AssociateDomainCommand`: + +```js +// ES5 example +const { WorkLinkClient, AssociateDomainCommand } = require("@aws-sdk/client-worklink"); +``` + +```ts +// ES6+ example +import { WorkLinkClient, AssociateDomainCommand } from "@aws-sdk/client-worklink"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WorkLinkClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateDomainCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-worklink"; +const client = new AWS.WorkLink({ region: "REGION" }); + +// async/await. +try { + const data = client.associateDomain(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateDomain(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateDomain(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-worklink` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-workmail/README.md b/clients/client-workmail/README.md index f47f0a34db8c..d0de043fda83 100644 --- a/clients/client-workmail/README.md +++ b/clients/client-workmail/README.md @@ -3,4 +3,235 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-workmail/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-workmail) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-workmail.svg)](https://www.npmjs.com/package/@aws-sdk/client-workmail) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WorkMail Client for Node.js, Browser and React Native. + +

Amazon WorkMail is a secure, managed business email and calendaring service with support for +existing desktop and mobile email clients. You can access your email, contacts, and +calendars using Microsoft Outlook, your browser, or other native iOS and Android email +applications. You can integrate WorkMail with your existing corporate directory and control +both the keys that encrypt your data and the location in which your data is +stored.

+

The WorkMail API is designed for the following scenarios:

+ + + + +

All WorkMail API operations are Amazon-authenticated and certificate-signed. They not only +require the use of the AWS SDK, but also allow for the exclusive use of AWS Identity and Access Management users and roles +to help facilitate access, trust, and permission policies. By creating a role and allowing +an IAM user to access the WorkMail site, the IAM user gains full administrative visibility into +the entire WorkMail organization (or as set in the IAM policy). This includes, but is not +limited to, the ability to create, update, and delete users, groups, and resources. This +allows developers to perform the scenarios listed above, as well as give users the ability +to grant access on a selective basis using the IAM model.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-workmail +using your favorite package manager: + +- `npm install @aws-sdk/client-workmail` +- `yarn add @aws-sdk/client-workmail` +- `pnpm add @aws-sdk/client-workmail` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WorkMailClient` and +the commands you need, for example `AssociateDelegateToResourceCommand`: + +```js +// ES5 example +const { WorkMailClient, AssociateDelegateToResourceCommand } = require("@aws-sdk/client-workmail"); +``` + +```ts +// ES6+ example +import { WorkMailClient, AssociateDelegateToResourceCommand } from "@aws-sdk/client-workmail"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WorkMailClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateDelegateToResourceCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-workmail"; +const client = new AWS.WorkMail({ region: "REGION" }); + +// async/await. +try { + const data = client.associateDelegateToResource(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateDelegateToResource(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateDelegateToResource(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-workmail` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-workmailmessageflow/README.md b/clients/client-workmailmessageflow/README.md index 00fa6bf12a3f..4595388960ef 100644 --- a/clients/client-workmailmessageflow/README.md +++ b/clients/client-workmailmessageflow/README.md @@ -3,4 +3,205 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-workmailmessageflow/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-workmailmessageflow) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-workmailmessageflow.svg)](https://www.npmjs.com/package/@aws-sdk/client-workmailmessageflow) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WorkMailMessageFlow Client for Node.js, Browser and React Native. + +

The WorkMail Message Flow API provides access to email messages as they are +being +sent and received by +a +WorkMail organization.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-workmailmessageflow +using your favorite package manager: + +- `npm install @aws-sdk/client-workmailmessageflow` +- `yarn add @aws-sdk/client-workmailmessageflow` +- `pnpm add @aws-sdk/client-workmailmessageflow` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WorkMailMessageFlowClient` and +the commands you need, for example `GetRawMessageContentCommand`: + +```js +// ES5 example +const { WorkMailMessageFlowClient, GetRawMessageContentCommand } = require("@aws-sdk/client-workmailmessageflow"); +``` + +```ts +// ES6+ example +import { WorkMailMessageFlowClient, GetRawMessageContentCommand } from "@aws-sdk/client-workmailmessageflow"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WorkMailMessageFlowClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new GetRawMessageContentCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-workmailmessageflow"; +const client = new AWS.WorkMailMessageFlow({ region: "REGION" }); + +// async/await. +try { + const data = client.getRawMessageContent(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .getRawMessageContent(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.getRawMessageContent(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-workmailmessageflow` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-workspaces/README.md b/clients/client-workspaces/README.md index f7df7b9239a4..7fa309ddd0a1 100644 --- a/clients/client-workspaces/README.md +++ b/clients/client-workspaces/README.md @@ -3,4 +3,204 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-workspaces/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-workspaces) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-workspaces.svg)](https://www.npmjs.com/package/@aws-sdk/client-workspaces) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript WorkSpaces Client for Node.js, Browser and React Native. + +Amazon WorkSpaces Service + +

Amazon WorkSpaces enables you to provision virtual, cloud-based Microsoft Windows and +Amazon Linux desktops for your users.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-workspaces +using your favorite package manager: + +- `npm install @aws-sdk/client-workspaces` +- `yarn add @aws-sdk/client-workspaces` +- `pnpm add @aws-sdk/client-workspaces` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `WorkSpacesClient` and +the commands you need, for example `AssociateConnectionAliasCommand`: + +```js +// ES5 example +const { WorkSpacesClient, AssociateConnectionAliasCommand } = require("@aws-sdk/client-workspaces"); +``` + +```ts +// ES6+ example +import { WorkSpacesClient, AssociateConnectionAliasCommand } from "@aws-sdk/client-workspaces"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new WorkSpacesClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AssociateConnectionAliasCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-workspaces"; +const client = new AWS.WorkSpaces({ region: "REGION" }); + +// async/await. +try { + const data = client.associateConnectionAlias(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .associateConnectionAlias(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.associateConnectionAlias(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-workspaces` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/clients/client-xray/README.md b/clients/client-xray/README.md index 0972d1e1eb25..08ab77e53159 100644 --- a/clients/client-xray/README.md +++ b/clients/client-xray/README.md @@ -3,4 +3,202 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-xray/latest.svg)](https://www.npmjs.com/package/@aws-sdk/client-xray) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-xray.svg)](https://www.npmjs.com/package/@aws-sdk/client-xray) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript XRay Client for Node.js, Browser and React Native. + +

AWS X-Ray provides APIs for managing debug traces and retrieving service maps +and other data created by processing those traces.

+ +## Installing + +To install the this package, simply type add or install @aws-sdk/client-xray +using your favorite package manager: + +- `npm install @aws-sdk/client-xray` +- `yarn add @aws-sdk/client-xray` +- `pnpm add @aws-sdk/client-xray` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `XRayClient` and +the commands you need, for example `BatchGetTracesCommand`: + +```js +// ES5 example +const { XRayClient, BatchGetTracesCommand } = require("@aws-sdk/client-xray"); +``` + +```ts +// ES6+ example +import { XRayClient, BatchGetTracesCommand } from "@aws-sdk/client-xray"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new XRayClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new BatchGetTracesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/client-xray"; +const client = new AWS.XRay({ region: "REGION" }); + +// async/await. +try { + const data = client.batchGetTraces(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .batchGetTraces(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.batchGetTraces(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/client-xray` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java index 4dab62986d24..222eeef97e70 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegration.java @@ -15,17 +15,25 @@ package software.amazon.smithy.aws.typescript.codegen; +import java.util.Arrays; import java.util.Calendar; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import software.amazon.smithy.aws.traits.ServiceTrait; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.model.Model; +import software.amazon.smithy.model.knowledge.TopDownIndex; +import software.amazon.smithy.model.shapes.OperationShape; +import software.amazon.smithy.model.shapes.ServiceShape; +import software.amazon.smithy.model.traits.DocumentationTrait; import software.amazon.smithy.typescript.codegen.TypeScriptSettings; import software.amazon.smithy.typescript.codegen.TypeScriptWriter; import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration; import software.amazon.smithy.utils.IoUtils; +import software.amazon.smithy.utils.StringUtils; public final class AwsPackageFixturesGeneratorIntegration implements TypeScriptIntegration { @Override @@ -49,8 +57,31 @@ public void writeAdditionalFiles( writer.write(resource); }); writerFactory.accept("README.md", writer -> { + ServiceShape service = settings.getService(model); String resource = IoUtils.readUtf8Resource(getClass(), "README.md.template"); resource = resource.replaceAll(Pattern.quote("${packageName}"), settings.getPackageName()); + + String sdkId = service.getTrait(ServiceTrait.class).map(ServiceTrait::getSdkId).orElse(null); + String clientName = Arrays.asList(sdkId.split(" ")).stream() + .map(StringUtils::capitalize) + .collect(Collectors.joining("")); + resource = resource.replaceAll(Pattern.quote("${serviceId}"), clientName); + + String rawDocumentation = service.getTrait(DocumentationTrait.class) + .map(DocumentationTrait::getValue) + .orElse(""); + String documentation = Arrays.asList(rawDocumentation.split("\n")).stream() + .map(StringUtils::trim) + .collect(Collectors.joining("\n")); + resource = resource.replaceAll(Pattern.quote("${documentation}"), documentation); + + TopDownIndex topDownIndex = model.getKnowledge(TopDownIndex.class); + OperationShape firstOperation = topDownIndex.getContainedOperations(service).iterator().next(); + String operationName = firstOperation.getId().getName(); + resource = resource.replaceAll(Pattern.quote("${commandName}"), operationName); + resource = resource.replaceAll(Pattern.quote("${operationName}"), + operationName.substring(0, 1).toLowerCase() + operationName.substring(1)); + writer.write(resource); }); } diff --git a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/README.md.template b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/README.md.template index 34f7a5709e47..772f97ae436c 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/README.md.template +++ b/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/README.md.template @@ -3,4 +3,197 @@ [![NPM version](https://img.shields.io/npm/v/${packageName}/latest.svg)](https://www.npmjs.com/package/${packageName}) [![NPM downloads](https://img.shields.io/npm/dm/${packageName}.svg)](https://www.npmjs.com/package/${packageName}) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript ${serviceId} Client for Node.js, Browser and React Native. + +${documentation} + +## Installing +To install the this package, simply type add or install ${packageName} +using your favorite package manager: +- `npm install ${packageName}` +- `yarn add ${packageName}` +- `pnpm add ${packageName}` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `${serviceId}Client` and +the commands you need, for example `${commandName}Command`: + +```js +// ES5 example +const { ${serviceId}Client, ${commandName}Command } = require("${packageName}"); +``` + +```ts +// ES6+ example +import { ${serviceId}Client, ${commandName}Command } from "${packageName}"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new ${serviceId}Client({ region: "REGION" }); + +const params = { /** input parameters */ }; +const command = new ${commandName}Command(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "${packageName}"; +const client = new AWS.${serviceId}({ region: "REGION" }); + +// async/await. +try { + const data = client.${operationName}(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .${operationName}(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.${operationName}(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `${packageName}` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. \ No newline at end of file diff --git a/codegen/smithy-aws-typescript-codegen/src/test/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegrationTest.java b/codegen/smithy-aws-typescript-codegen/src/test/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegrationTest.java index 143ee0c42562..ffb4743fa6e0 100644 --- a/codegen/smithy-aws-typescript-codegen/src/test/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegrationTest.java +++ b/codegen/smithy-aws-typescript-codegen/src/test/java/software/amazon/smithy/aws/typescript/codegen/AwsPackageFixturesGeneratorIntegrationTest.java @@ -1,5 +1,8 @@ package software.amazon.smithy.aws.typescript.codegen; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import software.amazon.smithy.build.MockManifest; @@ -33,5 +36,12 @@ public void expandsPackageFixtureFiles() { Assertions.assertTrue(manifest.hasFile(".gitignore")); Assertions.assertTrue(manifest.hasFile(".npmignore")); Assertions.assertTrue(manifest.hasFile("README.md")); + + String readme = manifest.getFileString("README.md").get(); + assertThat(readme, containsString("AWS SDK for JavaScript NotSame Client")); // Description + assertThat(readme, containsString("`NotSameClient`")); // Modular Client name + assertThat(readme, containsString("`GetFooCommand`")); // Command name + assertThat(readme, containsString("AWS.NotSame")); // v2 compatible client name + assertThat(readme, containsString("client.getFoo")); // v2 compatible operation name } } diff --git a/codegen/smithy-aws-typescript-codegen/src/test/resources/software/amazon/smithy/aws/typescript/codegen/NotSame.smithy b/codegen/smithy-aws-typescript-codegen/src/test/resources/software/amazon/smithy/aws/typescript/codegen/NotSame.smithy index 5f31dc10d58b..24c748af32e3 100644 --- a/codegen/smithy-aws-typescript-codegen/src/test/resources/software/amazon/smithy/aws/typescript/codegen/NotSame.smithy +++ b/codegen/smithy-aws-typescript-codegen/src/test/resources/software/amazon/smithy/aws/typescript/codegen/NotSame.smithy @@ -6,4 +6,17 @@ use aws.protocols#restJson1 @restJson1 service OriginalName { version: "2019-10-15", + operations: [GetFoo] } + +operation GetFoo { + input: GetFooInput, + output: GetFooOutput, + errors: [GetFooError] +} + +structure GetFooInput {} +structure GetFooOutput {} + +@error("client") +structure GetFooError {} \ No newline at end of file diff --git a/protocol_tests/aws-ec2/README.md b/protocol_tests/aws-ec2/README.md index 56816be204e3..6ac250368651 100644 --- a/protocol_tests/aws-ec2/README.md +++ b/protocol_tests/aws-ec2/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/aws-ec2/latest.svg)](https://www.npmjs.com/package/@aws-sdk/aws-ec2) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/aws-ec2.svg)](https://www.npmjs.com/package/@aws-sdk/aws-ec2) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript EC2Protocol Client for Node.js, Browser and React Native. + +An EC2 query service that sends query requests and XML responses. + +## Installing + +To install the this package, simply type add or install @aws-sdk/aws-ec2 +using your favorite package manager: + +- `npm install @aws-sdk/aws-ec2` +- `yarn add @aws-sdk/aws-ec2` +- `pnpm add @aws-sdk/aws-ec2` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `EC2ProtocolClient` and +the commands you need, for example `EmptyInputAndEmptyOutputCommand`: + +```js +// ES5 example +const { EC2ProtocolClient, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-ec2"); +``` + +```ts +// ES6+ example +import { EC2ProtocolClient, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-ec2"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new EC2ProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new EmptyInputAndEmptyOutputCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-ec2"; +const client = new AWS.EC2Protocol({ region: "REGION" }); + +// async/await. +try { + const data = client.emptyInputAndEmptyOutput(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .emptyInputAndEmptyOutput(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.emptyInputAndEmptyOutput(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-ec2` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/protocol_tests/aws-json/README.md b/protocol_tests/aws-json/README.md index f4650b0566d7..9104aee4f67b 100644 --- a/protocol_tests/aws-json/README.md +++ b/protocol_tests/aws-json/README.md @@ -3,4 +3,199 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/aws-json/latest.svg)](https://www.npmjs.com/package/@aws-sdk/aws-json) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/aws-json.svg)](https://www.npmjs.com/package/@aws-sdk/aws-json) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript JsonProtocol Client for Node.js, Browser and React Native. + +## Installing + +To install the this package, simply type add or install @aws-sdk/aws-json +using your favorite package manager: + +- `npm install @aws-sdk/aws-json` +- `yarn add @aws-sdk/aws-json` +- `pnpm add @aws-sdk/aws-json` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `JsonProtocolClient` and +the commands you need, for example `EmptyOperationCommand`: + +```js +// ES5 example +const { JsonProtocolClient, EmptyOperationCommand } = require("@aws-sdk/aws-json"); +``` + +```ts +// ES6+ example +import { JsonProtocolClient, EmptyOperationCommand } from "@aws-sdk/aws-json"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new JsonProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new EmptyOperationCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-json"; +const client = new AWS.JsonProtocol({ region: "REGION" }); + +// async/await. +try { + const data = client.emptyOperation(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .emptyOperation(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.emptyOperation(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-json` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/protocol_tests/aws-query/README.md b/protocol_tests/aws-query/README.md index 7f383c2c28f7..85fab793a794 100644 --- a/protocol_tests/aws-query/README.md +++ b/protocol_tests/aws-query/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/aws-query/latest.svg)](https://www.npmjs.com/package/@aws-sdk/aws-query) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/aws-query.svg)](https://www.npmjs.com/package/@aws-sdk/aws-query) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript QueryProtocol Client for Node.js, Browser and React Native. + +A query service that sends query requests and XML responses. + +## Installing + +To install the this package, simply type add or install @aws-sdk/aws-query +using your favorite package manager: + +- `npm install @aws-sdk/aws-query` +- `yarn add @aws-sdk/aws-query` +- `pnpm add @aws-sdk/aws-query` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `QueryProtocolClient` and +the commands you need, for example `EmptyInputAndEmptyOutputCommand`: + +```js +// ES5 example +const { QueryProtocolClient, EmptyInputAndEmptyOutputCommand } = require("@aws-sdk/aws-query"); +``` + +```ts +// ES6+ example +import { QueryProtocolClient, EmptyInputAndEmptyOutputCommand } from "@aws-sdk/aws-query"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new QueryProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new EmptyInputAndEmptyOutputCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-query"; +const client = new AWS.QueryProtocol({ region: "REGION" }); + +// async/await. +try { + const data = client.emptyInputAndEmptyOutput(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .emptyInputAndEmptyOutput(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.emptyInputAndEmptyOutput(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-query` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/protocol_tests/aws-restjson/README.md b/protocol_tests/aws-restjson/README.md index 7f8d41793ba2..deb3e4b1391c 100644 --- a/protocol_tests/aws-restjson/README.md +++ b/protocol_tests/aws-restjson/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/aws-restjson/latest.svg)](https://www.npmjs.com/package/@aws-sdk/aws-restjson) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/aws-restjson.svg)](https://www.npmjs.com/package/@aws-sdk/aws-restjson) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RestJsonProtocol Client for Node.js, Browser and React Native. + +A REST JSON service that sends JSON requests and responses. + +## Installing + +To install the this package, simply type add or install @aws-sdk/aws-restjson +using your favorite package manager: + +- `npm install @aws-sdk/aws-restjson` +- `yarn add @aws-sdk/aws-restjson` +- `pnpm add @aws-sdk/aws-restjson` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RestJsonProtocolClient` and +the commands you need, for example `AllQueryStringTypesCommand`: + +```js +// ES5 example +const { RestJsonProtocolClient, AllQueryStringTypesCommand } = require("@aws-sdk/aws-restjson"); +``` + +```ts +// ES6+ example +import { RestJsonProtocolClient, AllQueryStringTypesCommand } from "@aws-sdk/aws-restjson"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RestJsonProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AllQueryStringTypesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-restjson"; +const client = new AWS.RestJsonProtocol({ region: "REGION" }); + +// async/await. +try { + const data = client.allQueryStringTypes(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .allQueryStringTypes(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.allQueryStringTypes(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-restjson` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/protocol_tests/aws-restxml/README.md b/protocol_tests/aws-restxml/README.md index 27d69b20799c..9642135e1407 100644 --- a/protocol_tests/aws-restxml/README.md +++ b/protocol_tests/aws-restxml/README.md @@ -3,4 +3,201 @@ [![NPM version](https://img.shields.io/npm/v/@aws-sdk/aws-restxml/latest.svg)](https://www.npmjs.com/package/@aws-sdk/aws-restxml) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/aws-restxml.svg)](https://www.npmjs.com/package/@aws-sdk/aws-restxml) -For SDK usage, please step to [SDK readme](https://github.com/aws/aws-sdk-js-v3). +## Description + +AWS SDK for JavaScript RestXmlProtocol Client for Node.js, Browser and React Native. + +A REST XML service that sends XML requests and responses. + +## Installing + +To install the this package, simply type add or install @aws-sdk/aws-restxml +using your favorite package manager: + +- `npm install @aws-sdk/aws-restxml` +- `yarn add @aws-sdk/aws-restxml` +- `pnpm add @aws-sdk/aws-restxml` + +## Getting Started + +### Import + +The AWS SDK is modulized by clients and commands. +To send a request, you only need to import the `RestXmlProtocolClient` and +the commands you need, for example `AllQueryStringTypesCommand`: + +```js +// ES5 example +const { RestXmlProtocolClient, AllQueryStringTypesCommand } = require("@aws-sdk/aws-restxml"); +``` + +```ts +// ES6+ example +import { RestXmlProtocolClient, AllQueryStringTypesCommand } from "@aws-sdk/aws-restxml"; +``` + +### Usage + +To send a request, you: + +- Initiate client with configuration (e.g. credentials, region). +- Initiate command with input parameters. +- Call `send` operation on client with command object as input. +- If you are using a custom http handler, you may call `destroy()` to close open connections. + +```js +// a client can be shared by difference commands. +const client = new RestXmlProtocolClient({ region: "REGION" }); + +const params = { + /** input parameters */ +}; +const command = new AllQueryStringTypesCommand(params); +``` + +#### Async/await + +We recommend using [await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) +operator to wait for the promise returned by send operation as follows: + +```js +// async/await. +try { + const data = await client.send(command); + // process data. +} catch (error) { + // error handling. +} finally { + // finally. +} +``` + +Async-await is clean, concise, intuitive, easy to debug and has better error handling +as compared to using Promise chains or callbacks. + +#### Promises + +You can also use [Promise chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises#chaining) +to execute send operation. + +```js +client.send(command).then( + (data) => { + // process data. + }, + (error) => { + // error handling. + } +); +``` + +Promises can also be called using `.catch()` and `.finally()` as follows: + +```js +client + .send(command) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }) + .finally(() => { + // finally. + }); +``` + +#### Callbacks + +We do not recommend using callbacks because of [callback hell](http://callbackhell.com/), +but they are supported by the send operation. + +```js +// callbacks. +client.send(command, (err, data) => { + // proccess err and data. +}); +``` + +#### v2 compatible style + +The client can also send requests using v2 compatible style. +However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post +on [modular packages in AWS SDK for JavaScript](https://aws.amazon.com/blogs/developer/modular-packages-in-aws-sdk-for-javascript/) + +```ts +import * as AWS from "@aws-sdk/aws-restxml"; +const client = new AWS.RestXmlProtocol({ region: "REGION" }); + +// async/await. +try { + const data = client.allQueryStringTypes(params); + // process data. +} catch (error) { + // error handling. +} + +// Promises. +client + .allQueryStringTypes(params) + .then((data) => { + // process data. + }) + .catch((error) => { + // error handling. + }); + +// callbacks. +client.allQueryStringTypes(params, (err, data) => { + // proccess err and data. +}); +``` + +### Troubleshooting + +When the service returns an exception, the error will include the exception information, +as well as response metadata (e.g. request id). + +```js +try { + const data = await client.send(command); + // process data. +} catch (error) { + const { requestId, cfId, extendedRequestId } = error.$metadata; + console.log({ requestId, cfId, extendedRequestId }); + /** + * The keys within exceptions are also parsed. + * You can access them by specifying exception names: + * if (error.name === 'SomeServiceException') { + * const value = error.specialKeyInException; + * } + */ +} +``` + +## Getting Help + +Please use these community resources for getting help. +We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them. + +- Visit [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html) + or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html). +- Check out the blog posts tagged with [`aws-sdk-js`](https://aws.amazon.com/blogs/developer/tag/aws-sdk-js/) + on AWS Developer Blog. +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js) and tag it with `aws-sdk-js`. +- Join the AWS JavaScript community on [gitter](https://gitter.im/aws/aws-sdk-js-v3). +- If it turns out that you may have found a bug, please [open an issue](https://github.com/aws/aws-sdk-js-v3/issues/new/choose). + +To test your universal JavaScript code in Node.js, browser and react-native environments, +visit our [code samples repo](https://github.com/aws-samples/aws-sdk-js-tests). + +## Contributing + +This client code is generated automatically. Any modifications will be overwritten the next time the `@aws-sdk/aws-restxml` package is updated. +To contribute to client you can check our [generate clients scripts](https://github.com/aws/aws-sdk-js-v3/tree/master/scripts/generate-clients). + +## License + +This SDK is distributed under the +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), +see LICENSE for more information. diff --git a/scripts/generate-clients/copy-to-clients.js b/scripts/generate-clients/copy-to-clients.js index cec408e9a104..afbbc4ce8638 100644 --- a/scripts/generate-clients/copy-to-clients.js +++ b/scripts/generate-clients/copy-to-clients.js @@ -17,6 +17,7 @@ const getOverwritablePredicate = (packageName) => (pathName) => { "runtimeConfig.native.ts", "index.ts", "endpoints.ts", + "README.md", ]; return ( pathName