CreateLabelsCommand

Adds the specified list of labels to the given resource (a document or folder)

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { WorkDocsClient, CreateLabelsCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, CreateLabelsCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // CreateLabelsRequest
  ResourceId: "STRING_VALUE", // required
  Labels: [ // SharedLabels // required
    "STRING_VALUE",
  ],
  AuthenticationToken: "STRING_VALUE",
};
const command = new CreateLabelsCommand(input);
const response = await client.send(command);
// {};

CreateLabelsCommand Input

See CreateLabelsCommandInput for more details

Parameter
Type
Description
Labels
Required
string[] | undefined

List of labels to add to the resource.

ResourceId
Required
string | undefined

The ID of the resource.

AuthenticationToken
string | undefined

Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

CreateLabelsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
EntityNotExistsException
client

The resource does not exist.

FailedDependencyException
client

The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.

ServiceUnavailableException
server

One or more of the dependencies is unavailable.

TooManyLabelsException
client

The limit has been reached on the number of labels for the specified resource.

UnauthorizedOperationException
client

The operation is not permitted.

UnauthorizedResourceAccessException
client

The caller does not have access to perform the action on the resource.

WorkDocsServiceException
Base exception class for all service exceptions from WorkDocs service.