npm package: @stedi/sdk-client-buckets
Description: Stedi SDK for JavaScript that includes Buckets client for Node.js, Browser and React Native
Author: Stedi Team
Latest version: 0.4.78
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<!-- generated file, do not edit directly -->

# @stedi/sdk-client-buckets

[![NPM version](https://img.shields.io/npm/v/@stedi/sdk-client-buckets/latest.svg)](https://www.npmjs.com/package/@stedi/sdk-client-buckets)
[![NPM downloads](https://img.shields.io/npm/dm/@stedi/sdk-client-buckets.svg)](https://www.npmjs.com/package/@stedi/sdk-client-buckets)
[![Stability Index](https://img.shields.io/badge/dynamic/json?color=yellow&url=https://unpkg.com/@stedi/sdk-client-buckets/package.json&query=$.stability&label=stability)](https://github.com/dominictarr/stability)
[![Minimum Node.js version](https://img.shields.io/badge/dynamic/json?color=brightgreen&url=https://unpkg.com/@stedi/sdk-client-buckets/package.json&query=$.engines.node&label=nodejs)](https://nodejs.org/)

## Description

Stedi Buckets SDK for JavaScript.

## Installing

To install the this package, simply type add or install @stedi/sdk-client-buckets
using your favorite package manager:

- `npm install @stedi/sdk-client-buckets`
- `yarn add @stedi/sdk-client-buckets`
- `pnpm add @stedi/sdk-client-buckets`

## Getting Started

### Initialize the client

First, create a new `BucketsClient`.

```ts
import { BucketsClient, CheckBucketNameAvailabilityCommand } from "@stedi/sdk-client-buckets";

const client = new BucketsClient({
  region: "us",
  apiKey: "my-api-key",
});
```

### Usage

Once the client is initiated, you may use it to send multiple commands.
If you are using a custom http handler, you may call `destroy()` to close open connections.

Create a command by creating a new `CheckBucketNameAvailabilityCommand`.

```ts
import { BucketsClient, CheckBucketNameAvailabilityCommand } from "@stedi/sdk-client-buckets";

const client = new BucketsClient({
  region: "us",
  apiKey: "my-api-key",
});

const params = {
  /** input parameters */
};

const command = new CheckBucketNameAvailabilityCommand(params);

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}
```

### 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 checking if it is a certain instance of exception:
   * if (error instanceof SomeServiceException) {
   *     const value = error.specialKeyInException;
   * }
   */
}
```

## 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.

## Client Commands (Operations List)

<details>
<summary>
CheckBucketNameAvailability
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/CheckBucketNameAvailabilityCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/CheckBucketNameAvailabilityCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/CheckBucketNameAvailabilityCommandOutput.html)

</details>
<details>
<summary>
CopyObject
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/CopyObjectCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/CopyObjectCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/CopyObjectCommandOutput.html)

</details>
<details>
<summary>
CreateBucket
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/CreateBucketCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/CreateBucketCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/CreateBucketCommandOutput.html)

</details>
<details>
<summary>
DeleteBucket
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/DeleteBucketCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/DeleteBucketCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/DeleteBucketCommandOutput.html)

</details>
<details>
<summary>
DeleteObject
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/DeleteObjectCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/DeleteObjectCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/DeleteObjectCommandOutput.html)

</details>
<details>
<summary>
DeleteObjects
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/DeleteObjectsCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/DeleteObjectsCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/DeleteObjectsCommandOutput.html)

</details>
<details>
<summary>
DescribeBucket
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/DescribeBucketCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/DescribeBucketCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/DescribeBucketCommandOutput.html)

</details>
<details>
<summary>
GetObject
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/GetObjectCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/GetObjectCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/GetObjectCommandOutput.html)

</details>
<details>
<summary>
ListBuckets
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/ListBucketsCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/ListBucketsCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/ListBucketsCommandOutput.html)

</details>
<details>
<summary>
ListObjects
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/ListObjectsCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/ListObjectsCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/ListObjectsCommandOutput.html)

</details>
<details>
<summary>
PutObject
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/PutObjectCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/PutObjectCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/PutObjectCommandOutput.html)

</details>
<details>
<summary>
UpdateBucket
</summary>

[Command API Reference](/docs/sdk/clients/buckets/docs/classes/UpdateBucketCommand.html) / [Input](/docs/sdk/clients/buckets/docs/interfaces/UpdateBucketCommandInput.html) / [Output](/docs/sdk/clients/buckets/docs/interfaces/UpdateBucketCommandOutput.html)

</details>