- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetResourcesCommand
Retrieves a collection of resources, including folders and documents. The only CollectionType
supported is SHARED_WITH_ME
.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { WorkDocsClient, GetResourcesCommand } from "@aws-sdk/client-workdocs"; // ES Modules import
// const { WorkDocsClient, GetResourcesCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import
const client = new WorkDocsClient(config);
const input = { // GetResourcesRequest
AuthenticationToken: "STRING_VALUE",
UserId: "STRING_VALUE",
CollectionType: "SHARED_WITH_ME",
Limit: Number("int"),
Marker: "STRING_VALUE",
};
const command = new GetResourcesCommand(input);
const response = await client.send(command);
// { // GetResourcesResponse
// Folders: [ // FolderMetadataList
// { // FolderMetadata
// Id: "STRING_VALUE",
// Name: "STRING_VALUE",
// CreatorId: "STRING_VALUE",
// ParentFolderId: "STRING_VALUE",
// CreatedTimestamp: new Date("TIMESTAMP"),
// ModifiedTimestamp: new Date("TIMESTAMP"),
// ResourceState: "ACTIVE" || "RESTORING" || "RECYCLING" || "RECYCLED",
// Signature: "STRING_VALUE",
// Labels: [ // SharedLabels
// "STRING_VALUE",
// ],
// Size: Number("long"),
// LatestVersionSize: Number("long"),
// },
// ],
// Documents: [ // DocumentMetadataList
// { // DocumentMetadata
// Id: "STRING_VALUE",
// CreatorId: "STRING_VALUE",
// ParentFolderId: "STRING_VALUE",
// CreatedTimestamp: new Date("TIMESTAMP"),
// ModifiedTimestamp: new Date("TIMESTAMP"),
// LatestVersionMetadata: { // DocumentVersionMetadata
// Id: "STRING_VALUE",
// Name: "STRING_VALUE",
// ContentType: "STRING_VALUE",
// Size: Number("long"),
// Signature: "STRING_VALUE",
// Status: "INITIALIZED" || "ACTIVE",
// CreatedTimestamp: new Date("TIMESTAMP"),
// ModifiedTimestamp: new Date("TIMESTAMP"),
// ContentCreatedTimestamp: new Date("TIMESTAMP"),
// ContentModifiedTimestamp: new Date("TIMESTAMP"),
// CreatorId: "STRING_VALUE",
// Thumbnail: { // DocumentThumbnailUrlMap
// "<keys>": "STRING_VALUE",
// },
// Source: { // DocumentSourceUrlMap
// "<keys>": "STRING_VALUE",
// },
// },
// ResourceState: "ACTIVE" || "RESTORING" || "RECYCLING" || "RECYCLED",
// Labels: [
// "STRING_VALUE",
// ],
// },
// ],
// Marker: "STRING_VALUE",
// };
GetResourcesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
AuthenticationToken | string | undefined | The Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API. |
CollectionType | ResourceCollectionType | undefined | The collection type. |
Limit | number | undefined | The maximum number of resources to return. |
Marker | string | undefined | The marker for the next set of results. This marker was received from a previous call. |
UserId | string | undefined | The user ID for the resource collection. This is a required field for accessing the API operation using IAM credentials. |
GetResourcesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Documents | DocumentMetadata[] | undefined | The documents in the specified collection. |
Folders | FolderMetadata[] | undefined | The folders in the specified folder. |
Marker | string | undefined | The marker to use when requesting the next set of results. If there are no additional results, the string is empty. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
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. |
InvalidArgumentException | client | The pagination marker or limit fields are not valid. |
ServiceUnavailableException | server | One or more of the dependencies is unavailable. |
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. |