Back to Aws Sdk Js V3

@aws-sdk/client-qbusiness

clients/client-qbusiness/README.md

3.1043.045.4 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-qbusiness

Description

AWS SDK for JavaScript QBusiness Client for Node.js, Browser and React Native.

<p>This is the <i>Amazon Q Business</i> API Reference. Amazon Q Business is a fully managed, generative-AI powered enterprise chat assistant that you can deploy within your organization. Amazon Q Business enhances employee productivity by supporting key tasks such as question-answering, knowledge discovery, writing email messages, summarizing text, drafting document outlines, and brainstorming ideas. Users ask questions of Amazon Q Business and get answers that are presented in a conversational manner. For an introduction to the service, see the <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/what-is.html"> <i>Amazon Q Business User Guide</i> </a>.</p> <p>For an overview of the Amazon Q Business APIs, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/api-ref.html#api-overview">Overview of Amazon Q Business API operations</a>.</p> <p>For information about the IAM access control permissions you need to use this API, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/iam-roles.html">IAM roles for Amazon Q Business</a> in the <i>Amazon Q Business User Guide</i>.</p> <p>The following resources provide additional information about using the Amazon Q Business API:</p> <ul> <li> <p> <i> <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/setting-up.html">Setting up for Amazon Q Business</a> </i> </p> </li> <li> <p> <i> <a href="https://awscli.amazonaws.com/v2/documentation/api/latest/reference/qbusiness/index.html">Amazon Q Business CLI Reference</a> </i> </p> </li> <li> <p> <i> <a href="https://docs.aws.amazon.com/general/latest/gr/amazonq.html">Amazon Web Services General Reference</a> </i> </p> </li> </ul>

Installing

To install this package, use the CLI of your favorite package manager:

  • npm install @aws-sdk/client-qbusiness
  • yarn add @aws-sdk/client-qbusiness
  • pnpm add @aws-sdk/client-qbusiness

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the QBusinessClient and the commands you need, for example ListApplicationsCommand:

js
// ES5 example
const { QBusinessClient, ListApplicationsCommand } = require("@aws-sdk/client-qbusiness");
ts
// ES6+ example
import { QBusinessClient, ListApplicationsCommand } from "@aws-sdk/client-qbusiness";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new QBusinessClient({ region: "REGION" });

const params = { /** input parameters */ };
const command = new ListApplicationsCommand(params);

Async/await

We recommend using the 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.
}

Promises

You can also use Promise chaining.

js
client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

QBusiness extends QBusinessClient and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (QBusinessClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { QBusiness } from "@aws-sdk/client-qbusiness";

const client = new QBusiness({ region: "REGION" });

// async/await.
try {
  const data = await client.listApplications(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listApplications(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks (not recommended).
client.listApplications(params, (err, data) => {
  // process 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;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-qbusiness package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

<details> <summary> AssociatePermission </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchDeleteDocument </summary>

Command API Reference / Input / Output

</details> <details> <summary> BatchPutDocument </summary>

Command API Reference / Input / Output

</details> <details> <summary> CancelSubscription </summary>

Command API Reference / Input / Output

</details> <details> <summary> Chat </summary>

Command API Reference / Input / Output

</details> <details> <summary> ChatSync </summary>

Command API Reference / Input / Output

</details> <details> <summary> CheckDocumentAccess </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateAnonymousWebExperienceUrl </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateChatResponseConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateDataAccessor </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateDataSource </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateIndex </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreatePlugin </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateRetriever </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateSubscription </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateWebExperience </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAttachment </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteChatControlsConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteChatResponseConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteConversation </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteDataAccessor </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteDataSource </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteIndex </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeletePlugin </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRetriever </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteWebExperience </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociatePermission </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetChatControlsConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetChatResponseConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDataAccessor </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDataSource </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDocumentContent </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetIndex </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMedia </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPlugin </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetRetriever </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetWebExperience </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListApplications </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAttachments </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListChatResponseConfigurations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListConversations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDataAccessors </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDataSources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDataSourceSyncJobs </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListDocuments </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListGroups </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListIndices </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMessages </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPluginActions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPlugins </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPluginTypeActions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPluginTypeMetadata </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListRetrievers </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListSubscriptions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListWebExperiences </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutFeedback </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> SearchRelevantContent </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartDataSourceSyncJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> StopDataSourceSyncJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> TagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UntagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateChatControlsConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateChatResponseConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateDataAccessor </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateDataSource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateIndex </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdatePlugin </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateRetriever </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateSubscription </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateWebExperience </summary>

Command API Reference / Input / Output

</details>