diff --git a/clients/client-workdocs/README.md b/clients/client-workdocs/README.md index 691d0afa0d52..ac1df5d8c1c7 100644 --- a/clients/client-workdocs/README.md +++ b/clients/client-workdocs/README.md @@ -575,6 +575,14 @@ RestoreDocumentVersions [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-workdocs/classes/restoredocumentversionscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-workdocs/interfaces/restoredocumentversionscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-workdocs/interfaces/restoredocumentversionscommandoutput.html) + +
+ +SearchResources + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-workdocs/classes/searchresourcescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-workdocs/interfaces/searchresourcescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-workdocs/interfaces/searchresourcescommandoutput.html) +
diff --git a/clients/client-workdocs/package.json b/clients/client-workdocs/package.json index 8b28244b8cb7..271d1af36eb2 100644 --- a/clients/client-workdocs/package.json +++ b/clients/client-workdocs/package.json @@ -64,27 +64,15 @@ "typedoc": "0.23.23", "typescript": "~4.9.5" }, - "engines": { - "node": ">=14.0.0" - }, - "typesVersions": { - "<4.0": { - "dist-types/*": [ - "dist-types/ts3.4/*" - ] - } - }, - "files": [ - "dist-*" - ], + "engines": { "node": ">=14.0.0" }, + "typesVersions": { "<4.0": { "dist-types/*": ["dist-types/ts3.4/*"] } }, + "files": ["dist-*"], "author": { "name": "AWS SDK for JavaScript Team", "url": "https://aws.amazon.com/javascript/" }, "license": "Apache-2.0", - "browser": { - "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" - }, + "browser": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser" }, "react-native": { "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native" }, diff --git a/clients/client-workdocs/src/WorkDocs.ts b/clients/client-workdocs/src/WorkDocs.ts index c091c275452f..6b573981a052 100644 --- a/clients/client-workdocs/src/WorkDocs.ts +++ b/clients/client-workdocs/src/WorkDocs.ts @@ -180,6 +180,11 @@ import { RestoreDocumentVersionsCommandInput, RestoreDocumentVersionsCommandOutput, } from "./commands/RestoreDocumentVersionsCommand"; +import { + SearchResourcesCommand, + SearchResourcesCommandInput, + SearchResourcesCommandOutput, +} from "./commands/SearchResourcesCommand"; import { UpdateDocumentCommand, UpdateDocumentCommandInput, @@ -1524,6 +1529,38 @@ export class WorkDocs extends WorkDocsClient { } } + /** + *

Searches metadata and the content of folders, documents, document versions, and comments.

+ */ + public searchResources( + args: SearchResourcesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public searchResources( + args: SearchResourcesCommandInput, + cb: (err: any, data?: SearchResourcesCommandOutput) => void + ): void; + public searchResources( + args: SearchResourcesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: SearchResourcesCommandOutput) => void + ): void; + public searchResources( + args: SearchResourcesCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: SearchResourcesCommandOutput) => void), + cb?: (err: any, data?: SearchResourcesCommandOutput) => void + ): Promise | void { + const command = new SearchResourcesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Updates the specified attributes of a document. The user must have access to both * the document and its parent folder, if applicable.

diff --git a/clients/client-workdocs/src/WorkDocsClient.ts b/clients/client-workdocs/src/WorkDocsClient.ts index 8a75ac009477..bd4bb627f04b 100644 --- a/clients/client-workdocs/src/WorkDocsClient.ts +++ b/clients/client-workdocs/src/WorkDocsClient.ts @@ -139,6 +139,7 @@ import { RestoreDocumentVersionsCommandInput, RestoreDocumentVersionsCommandOutput, } from "./commands/RestoreDocumentVersionsCommand"; +import { SearchResourcesCommandInput, SearchResourcesCommandOutput } from "./commands/SearchResourcesCommand"; import { UpdateDocumentCommandInput, UpdateDocumentCommandOutput } from "./commands/UpdateDocumentCommand"; import { UpdateDocumentVersionCommandInput, @@ -194,6 +195,7 @@ export type ServiceInputTypes = | RemoveAllResourcePermissionsCommandInput | RemoveResourcePermissionCommandInput | RestoreDocumentVersionsCommandInput + | SearchResourcesCommandInput | UpdateDocumentCommandInput | UpdateDocumentVersionCommandInput | UpdateFolderCommandInput @@ -239,6 +241,7 @@ export type ServiceOutputTypes = | RemoveAllResourcePermissionsCommandOutput | RemoveResourcePermissionCommandOutput | RestoreDocumentVersionsCommandOutput + | SearchResourcesCommandOutput | UpdateDocumentCommandOutput | UpdateDocumentVersionCommandOutput | UpdateFolderCommandOutput diff --git a/clients/client-workdocs/src/commands/InitiateDocumentVersionUploadCommand.ts b/clients/client-workdocs/src/commands/InitiateDocumentVersionUploadCommand.ts index 831bea6b9193..6980a550edab 100644 --- a/clients/client-workdocs/src/commands/InitiateDocumentVersionUploadCommand.ts +++ b/clients/client-workdocs/src/commands/InitiateDocumentVersionUploadCommand.ts @@ -72,6 +72,9 @@ export interface InitiateDocumentVersionUploadCommandOutput * under the control of the organization is failing, such as a connected Active * Directory.

* + * @throws {@link InvalidArgumentException} (client fault) + *

The pagination marker or limit fields are not valid.

+ * * @throws {@link InvalidPasswordException} (client fault) *

The password is invalid.

* diff --git a/clients/client-workdocs/src/commands/SearchResourcesCommand.ts b/clients/client-workdocs/src/commands/SearchResourcesCommand.ts new file mode 100644 index 000000000000..706d0a94e9c0 --- /dev/null +++ b/clients/client-workdocs/src/commands/SearchResourcesCommand.ts @@ -0,0 +1,133 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { + SearchResourcesRequest, + SearchResourcesRequestFilterSensitiveLog, + SearchResourcesResponse, + SearchResourcesResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + deserializeAws_restJson1SearchResourcesCommand, + serializeAws_restJson1SearchResourcesCommand, +} from "../protocols/Aws_restJson1"; +import { ServiceInputTypes, ServiceOutputTypes, WorkDocsClientResolvedConfig } from "../WorkDocsClient"; + +/** + * The input for {@link SearchResourcesCommand}. + */ +export interface SearchResourcesCommandInput extends SearchResourcesRequest {} +/** + * The output of {@link SearchResourcesCommand}. + */ +export interface SearchResourcesCommandOutput extends SearchResourcesResponse, __MetadataBearer {} + +/** + *

Searches metadata and the content of folders, documents, document versions, and comments.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { WorkDocsClient, SearchResourcesCommand } from "@aws-sdk/client-workdocs"; // ES Modules import + * // const { WorkDocsClient, SearchResourcesCommand } = require("@aws-sdk/client-workdocs"); // CommonJS import + * const client = new WorkDocsClient(config); + * const command = new SearchResourcesCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link SearchResourcesCommandInput} for command's `input` shape. + * @see {@link SearchResourcesCommandOutput} for command's `response` shape. + * @see {@link WorkDocsClientResolvedConfig | config} for WorkDocsClient's `config` shape. + * + * @throws {@link InvalidArgumentException} (client fault) + *

The pagination marker or limit fields are not valid.

+ * + * @throws {@link ServiceUnavailableException} (server fault) + *

One or more of the dependencies is unavailable.

+ * + * @throws {@link UnauthorizedOperationException} (client fault) + *

The operation is not permitted.

+ * + * @throws {@link UnauthorizedResourceAccessException} (client fault) + *

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

+ * + * + */ +export class SearchResourcesCommand extends $Command< + SearchResourcesCommandInput, + SearchResourcesCommandOutput, + WorkDocsClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + constructor(readonly input: SearchResourcesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: WorkDocsClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, SearchResourcesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "WorkDocsClient"; + const commandName = "SearchResourcesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: SearchResourcesRequestFilterSensitiveLog, + outputFilterSensitiveLog: SearchResourcesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: SearchResourcesCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_restJson1SearchResourcesCommand(input, context); + } + + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return deserializeAws_restJson1SearchResourcesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-workdocs/src/commands/index.ts b/clients/client-workdocs/src/commands/index.ts index 54a63f03921d..97f76bbfa77c 100644 --- a/clients/client-workdocs/src/commands/index.ts +++ b/clients/client-workdocs/src/commands/index.ts @@ -38,6 +38,7 @@ export * from "./InitiateDocumentVersionUploadCommand"; export * from "./RemoveAllResourcePermissionsCommand"; export * from "./RemoveResourcePermissionCommand"; export * from "./RestoreDocumentVersionsCommand"; +export * from "./SearchResourcesCommand"; export * from "./UpdateDocumentCommand"; export * from "./UpdateDocumentVersionCommand"; export * from "./UpdateFolderCommand"; diff --git a/clients/client-workdocs/src/endpoint/EndpointParameters.ts b/clients/client-workdocs/src/endpoint/EndpointParameters.ts index 43801fbb4e2e..d0dd00f93b32 100644 --- a/clients/client-workdocs/src/endpoint/EndpointParameters.ts +++ b/clients/client-workdocs/src/endpoint/EndpointParameters.ts @@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = ( }; export interface EndpointParameters extends __EndpointParameters { - Region: string; + Region?: string; UseDualStack?: boolean; UseFIPS?: boolean; Endpoint?: string; diff --git a/clients/client-workdocs/src/endpoint/ruleset.ts b/clients/client-workdocs/src/endpoint/ruleset.ts index aaab3b82c312..aaf4d3f2783a 100644 --- a/clients/client-workdocs/src/endpoint/ruleset.ts +++ b/clients/client-workdocs/src/endpoint/ruleset.ts @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints"; or see "smithy.rules#endpointRuleSet" in codegen/sdk-codegen/aws-models/workdocs.json */ -const q="fn", -r="argv", -s="ref"; -const a=true, -b=false, -c="String", -d="PartitionResult", -e="tree", -f="error", -g="endpoint", -h={"required":true,"default":false,"type":"Boolean"}, -i={[s]:"Endpoint"}, -j={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]}, -k={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]}, -l={}, -m={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsFIPS"]}]}, -n={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsDualStack"]}]}, +const q="required", +r="fn", +s="argv", +t="ref"; +const a="isSet", +b="tree", +c="error", +d="endpoint", +e="PartitionResult", +f={[q]:false,"type":"String"}, +g={[q]:true,"default":false,"type":"Boolean"}, +h={[t]:"Endpoint"}, +i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]}, +j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]}, +k={}, +l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]}, +m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]}, +n=[i], o=[j], -p=[k]; -const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[q]:"isSet",[r]:[i]}],type:e,rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:p,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://workdocs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:o,type:e,rules:[{conditions:[m],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://workdocs-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:p,type:e,rules:[{conditions:[n],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://workdocs.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{type:e,rules:[{endpoint:{url:"https://workdocs.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]}]}; +p=[{[t]:"Region"}]; +const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://workdocs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://workdocs-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://workdocs.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://workdocs.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]}; export const ruleSet: RuleSetObject = _data; diff --git a/clients/client-workdocs/src/models/models_0.ts b/clients/client-workdocs/src/models/models_0.ts index b5748e654643..bc99fba1cffc 100644 --- a/clients/client-workdocs/src/models/models_0.ts +++ b/clients/client-workdocs/src/models/models_0.ts @@ -372,6 +372,11 @@ export interface CommentMetadata { *

The ID of the user being replied to.

*/ RecipientId?: string; + + /** + *

The ID of the user who made the comment.

+ */ + ContributorId?: string; } /** @@ -573,6 +578,10 @@ export interface Activity { CommentMetadata?: CommentMetadata; } +export enum AdditionalResponseFieldType { + WEBURL = "WEBURL", +} + /** *

Set of options which defines notification preferences of given action.

*/ @@ -2595,6 +2604,306 @@ export interface RestoreDocumentVersionsRequest { DocumentId: string | undefined; } +export enum ContentCategoryType { + AUDIO = "AUDIO", + DOCUMENT = "DOCUMENT", + IMAGE = "IMAGE", + OTHER = "OTHER", + PDF = "PDF", + PRESENTATION = "PRESENTATION", + SOURCE_CODE = "SOURCE_CODE", + SPREADSHEET = "SPREADSHEET", + VIDEO = "VIDEO", +} + +/** + *

Filters results based on timestamp range (in epochs).

+ */ +export interface DateRangeType { + /** + *

Timestamp range start value (in epochs)

+ */ + StartValue?: Date; + + /** + *

Timestamp range end value (in epochs).

+ */ + EndValue?: Date; +} + +export enum PrincipalRoleType { + CONTRIBUTOR = "CONTRIBUTOR", + COOWNER = "COOWNER", + OWNER = "OWNER", + VIEWER = "VIEWER", +} + +/** + *

Filter based on UserIds or GroupIds.

+ */ +export interface SearchPrincipalType { + /** + *

UserIds or GroupIds.

+ */ + Id: string | undefined; + + /** + *

The Role of a User or Group.

+ */ + Roles?: (PrincipalRoleType | string)[]; +} + +export enum SearchResourceType { + COMMENT = "COMMENT", + DOCUMENT = "DOCUMENT", + DOCUMENT_VERSION = "DOCUMENT_VERSION", + FOLDER = "FOLDER", +} + +export enum SearchCollectionType { + OWNED = "OWNED", + SHARED_WITH_ME = "SHARED_WITH_ME", +} + +/** + *

Filter based on size (in bytes).

+ */ +export interface LongRangeType { + /** + *

The size start range (in bytes).

+ */ + StartValue?: number; + + /** + *

The size end range (in bytes).

+ */ + EndValue?: number; +} + +export enum LanguageCodeType { + AR = "AR", + BG = "BG", + BN = "BN", + CS = "CS", + DA = "DA", + DE = "DE", + DEFAULT = "DEFAULT", + EL = "EL", + EN = "EN", + ES = "ES", + FA = "FA", + FI = "FI", + FR = "FR", + HI = "HI", + HU = "HU", + ID = "ID", + IT = "IT", + JA = "JA", + KO = "KO", + LT = "LT", + LV = "LV", + NL = "NL", + NO = "NO", + PT = "PT", + RO = "RO", + RU = "RU", + SV = "SV", + SW = "SW", + TH = "TH", + TR = "TR", + ZH = "ZH", +} + +/** + *

Filters results based on entity metadata.

+ */ +export interface Filters { + /** + *

Filters by the locale of the content or comment.

+ */ + TextLocales?: (LanguageCodeType | string)[]; + + /** + *

Filters by content category.

+ */ + ContentCategories?: (ContentCategoryType | string)[]; + + /** + *

Filters based on entity type.

+ */ + ResourceTypes?: (SearchResourceType | string)[]; + + /** + *

Filter by labels using exact match.

+ */ + Labels?: string[]; + + /** + *

Filter based on UserIds or GroupIds.

+ */ + Principals?: SearchPrincipalType[]; + + /** + *

Filter based on resource’s path.

+ */ + AncestorIds?: string[]; + + /** + *

Filter based on file groupings.

+ */ + SearchCollectionTypes?: (SearchCollectionType | string)[]; + + /** + *

Filter based on size (in bytes).

+ */ + SizeRange?: LongRangeType; + + /** + *

Filter based on resource’s creation timestamp.

+ */ + CreatedRange?: DateRangeType; + + /** + *

Filter based on resource’s modified timestamp.

+ */ + ModifiedRange?: DateRangeType; +} + +export enum OrderByFieldType { + CREATED_TIMESTAMP = "CREATED_TIMESTAMP", + MODIFIED_TIMESTAMP = "MODIFIED_TIMESTAMP", + NAME = "NAME", + RELEVANCE = "RELEVANCE", + SIZE = "SIZE", +} + +export enum SortOrder { + ASC = "ASC", + DESC = "DESC", +} + +/** + *

The result of the sort operation.

+ */ +export interface SearchSortResult { + /** + *

Sort search results based on this field name.

+ */ + Field?: OrderByFieldType | string; + + /** + *

Sort direction.

+ */ + Order?: SortOrder | string; +} + +export enum SearchQueryScopeType { + CONTENT = "CONTENT", + NAME = "NAME", +} + +export interface SearchResourcesRequest { + /** + *

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

+ */ + AuthenticationToken?: string; + + /** + *

The String to search for. Searches across different text fields based on request parameters. Use double quotes around the query string for exact phrase matches.

+ */ + QueryText?: string; + + /** + *

Filter based on the text field type. A Folder has only a name and no content. A Comment has only content and no name. A Document or Document Version has a name and content

+ */ + QueryScopes?: (SearchQueryScopeType | string)[]; + + /** + *

Filters based on the resource owner OrgId. This is a mandatory parameter when using Admin SigV4 credentials.

+ */ + OrganizationId?: string; + + /** + *

A list of attributes to include in the response. Used to request fields that are not normally + * returned in a standard response.

+ */ + AdditionalResponseFields?: (AdditionalResponseFieldType | string)[]; + + /** + *

Filters results based on entity metadata.

+ */ + Filters?: Filters; + + /** + *

Order by results in one or more categories.

+ */ + OrderBy?: SearchSortResult[]; + + /** + *

Max results count per page.

+ */ + Limit?: number; + + /** + *

The marker for the next set of results.

+ */ + Marker?: string; +} + +export enum ResponseItemType { + COMMENT = "COMMENT", + DOCUMENT = "DOCUMENT", + DOCUMENT_VERSION = "DOCUMENT_VERSION", + FOLDER = "FOLDER", +} + +/** + *

List of Documents, Folders, Comments, and Document Versions matching the query.

+ */ +export interface ResponseItem { + /** + *

The type of item being returned.

+ */ + ResourceType?: ResponseItemType | string; + + /** + *

The webUrl of the item being returned.

+ */ + WebUrl?: string; + + /** + *

The document that matches the query.

+ */ + DocumentMetadata?: DocumentMetadata; + + /** + *

The folder that matches the query.

+ */ + FolderMetadata?: FolderMetadata; + + /** + *

The comment that matches the query.

+ */ + CommentMetadata?: CommentMetadata; + + /** + *

The document version that matches the metadata.

+ */ + DocumentVersionMetadata?: DocumentVersionMetadata; +} + +export interface SearchResourcesResponse { + /** + *

List of Documents, Folders, Comments, and Document Versions matching the query.

+ */ + Items?: ResponseItem[]; + + /** + *

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

+ */ + Marker?: string; +} + export interface UpdateDocumentRequest { /** *

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

@@ -2815,7 +3124,10 @@ export const UserStorageMetadataFilterSensitiveLog = (obj: UserStorageMetadata): */ export const UserFilterSensitiveLog = (obj: User): any => ({ ...obj, + ...(obj.Username && { Username: SENSITIVE_STRING }), ...(obj.EmailAddress && { EmailAddress: SENSITIVE_STRING }), + ...(obj.GivenName && { GivenName: SENSITIVE_STRING }), + ...(obj.Surname && { Surname: SENSITIVE_STRING }), }); /** @@ -2839,6 +3151,9 @@ export const CommentMetadataFilterSensitiveLog = (obj: CommentMetadata): any => */ export const UserMetadataFilterSensitiveLog = (obj: UserMetadata): any => ({ ...obj, + ...(obj.Username && { Username: SENSITIVE_STRING }), + ...(obj.GivenName && { GivenName: SENSITIVE_STRING }), + ...(obj.Surname && { Surname: SENSITIVE_STRING }), ...(obj.EmailAddress && { EmailAddress: SENSITIVE_STRING }), }); @@ -2847,6 +3162,8 @@ export const UserMetadataFilterSensitiveLog = (obj: UserMetadata): any => ({ */ export const ResourceMetadataFilterSensitiveLog = (obj: ResourceMetadata): any => ({ ...obj, + ...(obj.Name && { Name: SENSITIVE_STRING }), + ...(obj.OriginalName && { OriginalName: SENSITIVE_STRING }), ...(obj.Owner && { Owner: UserMetadataFilterSensitiveLog(obj.Owner) }), }); @@ -2966,6 +3283,7 @@ export const CreateCustomMetadataResponseFilterSensitiveLog = (obj: CreateCustom export const CreateFolderRequestFilterSensitiveLog = (obj: CreateFolderRequest): any => ({ ...obj, ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), + ...(obj.Name && { Name: SENSITIVE_STRING }), }); /** @@ -2973,6 +3291,7 @@ export const CreateFolderRequestFilterSensitiveLog = (obj: CreateFolderRequest): */ export const FolderMetadataFilterSensitiveLog = (obj: FolderMetadata): any => ({ ...obj, + ...(obj.Name && { Name: SENSITIVE_STRING }), }); /** @@ -2980,6 +3299,7 @@ export const FolderMetadataFilterSensitiveLog = (obj: FolderMetadata): any => ({ */ export const CreateFolderResponseFilterSensitiveLog = (obj: CreateFolderResponse): any => ({ ...obj, + ...(obj.Metadata && { Metadata: FolderMetadataFilterSensitiveLog(obj.Metadata) }), }); /** @@ -3027,7 +3347,10 @@ export const CreateNotificationSubscriptionResponseFilterSensitiveLog = ( */ export const CreateUserRequestFilterSensitiveLog = (obj: CreateUserRequest): any => ({ ...obj, + ...(obj.Username && { Username: SENSITIVE_STRING }), ...(obj.EmailAddress && { EmailAddress: SENSITIVE_STRING }), + ...(obj.GivenName && { GivenName: SENSITIVE_STRING }), + ...(obj.Surname && { Surname: SENSITIVE_STRING }), ...(obj.Password && { Password: SENSITIVE_STRING }), ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), }); @@ -3180,6 +3503,7 @@ export const DescribeDocumentVersionsRequestFilterSensitiveLog = (obj: DescribeD */ export const DocumentVersionMetadataFilterSensitiveLog = (obj: DocumentVersionMetadata): any => ({ ...obj, + ...(obj.Name && { Name: SENSITIVE_STRING }), ...(obj.Thumbnail && { Thumbnail: SENSITIVE_STRING }), ...(obj.Source && { Source: SENSITIVE_STRING }), }); @@ -3217,6 +3541,7 @@ export const DocumentMetadataFilterSensitiveLog = (obj: DocumentMetadata): any = */ export const DescribeFolderContentsResponseFilterSensitiveLog = (obj: DescribeFolderContentsResponse): any => ({ ...obj, + ...(obj.Folders && { Folders: obj.Folders.map((item) => FolderMetadataFilterSensitiveLog(item)) }), ...(obj.Documents && { Documents: obj.Documents.map((item) => DocumentMetadataFilterSensitiveLog(item)) }), }); @@ -3298,6 +3623,7 @@ export const DescribeRootFoldersRequestFilterSensitiveLog = (obj: DescribeRootFo */ export const DescribeRootFoldersResponseFilterSensitiveLog = (obj: DescribeRootFoldersResponse): any => ({ ...obj, + ...(obj.Folders && { Folders: obj.Folders.map((item) => FolderMetadataFilterSensitiveLog(item)) }), }); /** @@ -3362,6 +3688,7 @@ export const GetDocumentPathRequestFilterSensitiveLog = (obj: GetDocumentPathReq */ export const ResourcePathComponentFilterSensitiveLog = (obj: ResourcePathComponent): any => ({ ...obj, + ...(obj.Name && { Name: SENSITIVE_STRING }), }); /** @@ -3369,6 +3696,7 @@ export const ResourcePathComponentFilterSensitiveLog = (obj: ResourcePathCompone */ export const ResourcePathFilterSensitiveLog = (obj: ResourcePath): any => ({ ...obj, + ...(obj.Components && { Components: obj.Components.map((item) => ResourcePathComponentFilterSensitiveLog(item)) }), }); /** @@ -3376,6 +3704,7 @@ export const ResourcePathFilterSensitiveLog = (obj: ResourcePath): any => ({ */ export const GetDocumentPathResponseFilterSensitiveLog = (obj: GetDocumentPathResponse): any => ({ ...obj, + ...(obj.Path && { Path: ResourcePathFilterSensitiveLog(obj.Path) }), }); /** @@ -3407,6 +3736,7 @@ export const GetFolderRequestFilterSensitiveLog = (obj: GetFolderRequest): any = */ export const GetFolderResponseFilterSensitiveLog = (obj: GetFolderResponse): any => ({ ...obj, + ...(obj.Metadata && { Metadata: FolderMetadataFilterSensitiveLog(obj.Metadata) }), }); /** @@ -3422,6 +3752,7 @@ export const GetFolderPathRequestFilterSensitiveLog = (obj: GetFolderPathRequest */ export const GetFolderPathResponseFilterSensitiveLog = (obj: GetFolderPathResponse): any => ({ ...obj, + ...(obj.Path && { Path: ResourcePathFilterSensitiveLog(obj.Path) }), }); /** @@ -3437,6 +3768,7 @@ export const GetResourcesRequestFilterSensitiveLog = (obj: GetResourcesRequest): */ export const GetResourcesResponseFilterSensitiveLog = (obj: GetResourcesResponse): any => ({ ...obj, + ...(obj.Folders && { Folders: obj.Folders.map((item) => FolderMetadataFilterSensitiveLog(item)) }), ...(obj.Documents && { Documents: obj.Documents.map((item) => DocumentMetadataFilterSensitiveLog(item)) }), }); @@ -3448,6 +3780,7 @@ export const InitiateDocumentVersionUploadRequestFilterSensitiveLog = ( ): any => ({ ...obj, ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), + ...(obj.Name && { Name: SENSITIVE_STRING }), }); /** @@ -3495,12 +3828,79 @@ export const RestoreDocumentVersionsRequestFilterSensitiveLog = (obj: RestoreDoc ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), }); +/** + * @internal + */ +export const DateRangeTypeFilterSensitiveLog = (obj: DateRangeType): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const SearchPrincipalTypeFilterSensitiveLog = (obj: SearchPrincipalType): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const LongRangeTypeFilterSensitiveLog = (obj: LongRangeType): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const FiltersFilterSensitiveLog = (obj: Filters): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const SearchSortResultFilterSensitiveLog = (obj: SearchSortResult): any => ({ + ...obj, +}); + +/** + * @internal + */ +export const SearchResourcesRequestFilterSensitiveLog = (obj: SearchResourcesRequest): any => ({ + ...obj, + ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), + ...(obj.QueryText && { QueryText: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ResponseItemFilterSensitiveLog = (obj: ResponseItem): any => ({ + ...obj, + ...(obj.WebUrl && { WebUrl: SENSITIVE_STRING }), + ...(obj.DocumentMetadata && { DocumentMetadata: DocumentMetadataFilterSensitiveLog(obj.DocumentMetadata) }), + ...(obj.FolderMetadata && { FolderMetadata: FolderMetadataFilterSensitiveLog(obj.FolderMetadata) }), + ...(obj.CommentMetadata && { CommentMetadata: CommentMetadataFilterSensitiveLog(obj.CommentMetadata) }), + ...(obj.DocumentVersionMetadata && { + DocumentVersionMetadata: DocumentVersionMetadataFilterSensitiveLog(obj.DocumentVersionMetadata), + }), +}); + +/** + * @internal + */ +export const SearchResourcesResponseFilterSensitiveLog = (obj: SearchResourcesResponse): any => ({ + ...obj, + ...(obj.Items && { Items: obj.Items.map((item) => ResponseItemFilterSensitiveLog(item)) }), +}); + /** * @internal */ export const UpdateDocumentRequestFilterSensitiveLog = (obj: UpdateDocumentRequest): any => ({ ...obj, ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), + ...(obj.Name && { Name: SENSITIVE_STRING }), }); /** @@ -3517,6 +3917,7 @@ export const UpdateDocumentVersionRequestFilterSensitiveLog = (obj: UpdateDocume export const UpdateFolderRequestFilterSensitiveLog = (obj: UpdateFolderRequest): any => ({ ...obj, ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), + ...(obj.Name && { Name: SENSITIVE_STRING }), }); /** @@ -3525,6 +3926,8 @@ export const UpdateFolderRequestFilterSensitiveLog = (obj: UpdateFolderRequest): export const UpdateUserRequestFilterSensitiveLog = (obj: UpdateUserRequest): any => ({ ...obj, ...(obj.AuthenticationToken && { AuthenticationToken: SENSITIVE_STRING }), + ...(obj.GivenName && { GivenName: SENSITIVE_STRING }), + ...(obj.Surname && { Surname: SENSITIVE_STRING }), }); /** diff --git a/clients/client-workdocs/src/pagination/DescribeActivitiesPaginator.ts b/clients/client-workdocs/src/pagination/DescribeActivitiesPaginator.ts new file mode 100644 index 000000000000..52bb7567950e --- /dev/null +++ b/clients/client-workdocs/src/pagination/DescribeActivitiesPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeActivitiesCommand, + DescribeActivitiesCommandInput, + DescribeActivitiesCommandOutput, +} from "../commands/DescribeActivitiesCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeActivitiesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeActivitiesCommand(input), ...args); +}; +export async function* paginateDescribeActivities( + config: WorkDocsPaginationConfiguration, + input: DescribeActivitiesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeActivitiesCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/DescribeCommentsPaginator.ts b/clients/client-workdocs/src/pagination/DescribeCommentsPaginator.ts new file mode 100644 index 000000000000..3b37b5805672 --- /dev/null +++ b/clients/client-workdocs/src/pagination/DescribeCommentsPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeCommentsCommand, + DescribeCommentsCommandInput, + DescribeCommentsCommandOutput, +} from "../commands/DescribeCommentsCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeCommentsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeCommentsCommand(input), ...args); +}; +export async function* paginateDescribeComments( + config: WorkDocsPaginationConfiguration, + input: DescribeCommentsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeCommentsCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/DescribeGroupsPaginator.ts b/clients/client-workdocs/src/pagination/DescribeGroupsPaginator.ts new file mode 100644 index 000000000000..c5631d433fc9 --- /dev/null +++ b/clients/client-workdocs/src/pagination/DescribeGroupsPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeGroupsCommand, + DescribeGroupsCommandInput, + DescribeGroupsCommandOutput, +} from "../commands/DescribeGroupsCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeGroupsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeGroupsCommand(input), ...args); +}; +export async function* paginateDescribeGroups( + config: WorkDocsPaginationConfiguration, + input: DescribeGroupsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeGroupsCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/DescribeNotificationSubscriptionsPaginator.ts b/clients/client-workdocs/src/pagination/DescribeNotificationSubscriptionsPaginator.ts new file mode 100644 index 000000000000..fd7391212f0d --- /dev/null +++ b/clients/client-workdocs/src/pagination/DescribeNotificationSubscriptionsPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeNotificationSubscriptionsCommand, + DescribeNotificationSubscriptionsCommandInput, + DescribeNotificationSubscriptionsCommandOutput, +} from "../commands/DescribeNotificationSubscriptionsCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeNotificationSubscriptionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeNotificationSubscriptionsCommand(input), ...args); +}; +export async function* paginateDescribeNotificationSubscriptions( + config: WorkDocsPaginationConfiguration, + input: DescribeNotificationSubscriptionsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeNotificationSubscriptionsCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/DescribeResourcePermissionsPaginator.ts b/clients/client-workdocs/src/pagination/DescribeResourcePermissionsPaginator.ts new file mode 100644 index 000000000000..ad2edb83b83c --- /dev/null +++ b/clients/client-workdocs/src/pagination/DescribeResourcePermissionsPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeResourcePermissionsCommand, + DescribeResourcePermissionsCommandInput, + DescribeResourcePermissionsCommandOutput, +} from "../commands/DescribeResourcePermissionsCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeResourcePermissionsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeResourcePermissionsCommand(input), ...args); +}; +export async function* paginateDescribeResourcePermissions( + config: WorkDocsPaginationConfiguration, + input: DescribeResourcePermissionsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeResourcePermissionsCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/DescribeRootFoldersPaginator.ts b/clients/client-workdocs/src/pagination/DescribeRootFoldersPaginator.ts new file mode 100644 index 000000000000..6d0b6eceae54 --- /dev/null +++ b/clients/client-workdocs/src/pagination/DescribeRootFoldersPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeRootFoldersCommand, + DescribeRootFoldersCommandInput, + DescribeRootFoldersCommandOutput, +} from "../commands/DescribeRootFoldersCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: DescribeRootFoldersCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeRootFoldersCommand(input), ...args); +}; +export async function* paginateDescribeRootFolders( + config: WorkDocsPaginationConfiguration, + input: DescribeRootFoldersCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeRootFoldersCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/SearchResourcesPaginator.ts b/clients/client-workdocs/src/pagination/SearchResourcesPaginator.ts new file mode 100644 index 000000000000..0997c6af845f --- /dev/null +++ b/clients/client-workdocs/src/pagination/SearchResourcesPaginator.ts @@ -0,0 +1,47 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + SearchResourcesCommand, + SearchResourcesCommandInput, + SearchResourcesCommandOutput, +} from "../commands/SearchResourcesCommand"; +import { WorkDocsClient } from "../WorkDocsClient"; +import { WorkDocsPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkDocsClient, + input: SearchResourcesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new SearchResourcesCommand(input), ...args); +}; +export async function* paginateSearchResources( + config: WorkDocsPaginationConfiguration, + input: SearchResourcesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.Marker + let token: typeof input.Marker | undefined = config.startingToken || undefined; + let hasNext = true; + let page: SearchResourcesCommandOutput; + while (hasNext) { + input.Marker = token; + input["Limit"] = config.pageSize; + if (config.client instanceof WorkDocsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkDocs | WorkDocsClient"); + } + yield page; + const prevToken = token; + token = page.Marker; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workdocs/src/pagination/index.ts b/clients/client-workdocs/src/pagination/index.ts index 611dabf80611..c9c9beb9da32 100644 --- a/clients/client-workdocs/src/pagination/index.ts +++ b/clients/client-workdocs/src/pagination/index.ts @@ -1,7 +1,20 @@ +export * from "./DescribeActivitiesPaginator"; + +export * from "./DescribeCommentsPaginator"; + export * from "./DescribeDocumentVersionsPaginator"; export * from "./DescribeFolderContentsPaginator"; +export * from "./DescribeGroupsPaginator"; + +export * from "./DescribeNotificationSubscriptionsPaginator"; + +export * from "./DescribeResourcePermissionsPaginator"; + +export * from "./DescribeRootFoldersPaginator"; + export * from "./DescribeUsersPaginator"; // smithy-typescript generated code export * from "./Interfaces"; +export * from "./SearchResourcesPaginator"; diff --git a/clients/client-workdocs/src/protocols/Aws_restJson1.ts b/clients/client-workdocs/src/protocols/Aws_restJson1.ts index 2bb847931a63..ed3c556c07ce 100644 --- a/clients/client-workdocs/src/protocols/Aws_restJson1.ts +++ b/clients/client-workdocs/src/protocols/Aws_restJson1.ts @@ -110,6 +110,7 @@ import { RestoreDocumentVersionsCommandInput, RestoreDocumentVersionsCommandOutput, } from "../commands/RestoreDocumentVersionsCommand"; +import { SearchResourcesCommandInput, SearchResourcesCommandOutput } from "../commands/SearchResourcesCommand"; import { UpdateDocumentCommandInput, UpdateDocumentCommandOutput } from "../commands/UpdateDocumentCommand"; import { UpdateDocumentVersionCommandInput, @@ -119,11 +120,14 @@ import { UpdateFolderCommandInput, UpdateFolderCommandOutput } from "../commands import { UpdateUserCommandInput, UpdateUserCommandOutput } from "../commands/UpdateUserCommand"; import { Activity, + AdditionalResponseFieldType, Comment, CommentMetadata, ConcurrentModificationException, ConflictingOperationException, + ContentCategoryType, CustomMetadataLimitExceededException, + DateRangeType, DeactivatingLastSystemUserException, DocumentLockedForCommentsException, DocumentMetadata, @@ -134,6 +138,7 @@ import { EntityAlreadyExistsException, EntityNotExistsException, FailedDependencyException, + Filters, FolderMetadata, GroupMetadata, IllegalUserStateException, @@ -141,17 +146,26 @@ import { InvalidCommentOperationException, InvalidOperationException, InvalidPasswordException, + LanguageCodeType, LimitExceededException, + LongRangeType, NotificationOptions, Participants, PermissionInfo, Principal, + PrincipalRoleType, ProhibitedStateException, RequestedEntityTooLargeException, ResourceAlreadyCheckedOutException, ResourceMetadata, ResourcePath, ResourcePathComponent, + ResponseItem, + SearchCollectionType, + SearchPrincipalType, + SearchQueryScopeType, + SearchResourceType, + SearchSortResult, ServiceUnavailableException, SharePrincipal, ShareResult, @@ -1302,6 +1316,45 @@ export const serializeAws_restJson1RestoreDocumentVersionsCommand = async ( }); }; +export const serializeAws_restJson1SearchResourcesCommand = async ( + input: SearchResourcesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = map({}, isSerializableHeaderValue, { + "content-type": "application/json", + authentication: input.AuthenticationToken!, + }); + const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/api/v1/search"; + let body: any; + body = JSON.stringify({ + ...(input.AdditionalResponseFields != null && { + AdditionalResponseFields: serializeAws_restJson1AdditionalResponseFieldsList( + input.AdditionalResponseFields, + context + ), + }), + ...(input.Filters != null && { Filters: serializeAws_restJson1Filters(input.Filters, context) }), + ...(input.Limit != null && { Limit: input.Limit }), + ...(input.Marker != null && { Marker: input.Marker }), + ...(input.OrderBy != null && { OrderBy: serializeAws_restJson1SearchResultSortList(input.OrderBy, context) }), + ...(input.OrganizationId != null && { OrganizationId: input.OrganizationId }), + ...(input.QueryScopes != null && { + QueryScopes: serializeAws_restJson1SearchQueryScopeTypeList(input.QueryScopes, context), + }), + ...(input.QueryText != null && { QueryText: input.QueryText }), + }); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + export const serializeAws_restJson1UpdateDocumentCommand = async ( input: UpdateDocumentCommandInput, context: __SerdeContext @@ -3443,6 +3496,9 @@ const deserializeAws_restJson1InitiateDocumentVersionUploadCommandError = async case "FailedDependencyException": case "com.amazonaws.workdocs#FailedDependencyException": throw await deserializeAws_restJson1FailedDependencyExceptionResponse(parsedOutput, context); + case "InvalidArgumentException": + case "com.amazonaws.workdocs#InvalidArgumentException": + throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context); case "InvalidPasswordException": case "com.amazonaws.workdocs#InvalidPasswordException": throw await deserializeAws_restJson1InvalidPasswordExceptionResponse(parsedOutput, context); @@ -3634,6 +3690,59 @@ const deserializeAws_restJson1RestoreDocumentVersionsCommandError = async ( } }; +export const deserializeAws_restJson1SearchResourcesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return deserializeAws_restJson1SearchResourcesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + if (data.Items != null) { + contents.Items = deserializeAws_restJson1ResponseItemsList(data.Items, context); + } + if (data.Marker != null) { + contents.Marker = __expectString(data.Marker); + } + return contents; +}; + +const deserializeAws_restJson1SearchResourcesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidArgumentException": + case "com.amazonaws.workdocs#InvalidArgumentException": + throw await deserializeAws_restJson1InvalidArgumentExceptionResponse(parsedOutput, context); + case "ServiceUnavailableException": + case "com.amazonaws.workdocs#ServiceUnavailableException": + throw await deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context); + case "UnauthorizedOperationException": + case "com.amazonaws.workdocs#UnauthorizedOperationException": + throw await deserializeAws_restJson1UnauthorizedOperationExceptionResponse(parsedOutput, context); + case "UnauthorizedResourceAccessException": + case "com.amazonaws.workdocs#UnauthorizedResourceAccessException": + throw await deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + throwDefaultError({ + output, + parsedBody, + exceptionCtor: __BaseException, + errorCode, + }); + } +}; + export const deserializeAws_restJson1UpdateDocumentCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -4298,6 +4407,17 @@ const deserializeAws_restJson1UnauthorizedResourceAccessExceptionResponse = asyn return __decorateServiceException(exception, parsedOutput.body); }; +const serializeAws_restJson1AdditionalResponseFieldsList = ( + input: (AdditionalResponseFieldType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + const serializeAws_restJson1CustomMetadataMap = (input: Record, context: __SerdeContext): any => { return Object.entries(input).reduce((acc: Record, [key, value]: [string, any]) => { if (value === null) { @@ -4308,6 +4428,51 @@ const serializeAws_restJson1CustomMetadataMap = (input: Record, }, {}); }; +const serializeAws_restJson1DateRangeType = (input: DateRangeType, context: __SerdeContext): any => { + return { + ...(input.EndValue != null && { EndValue: Math.round(input.EndValue.getTime() / 1000) }), + ...(input.StartValue != null && { StartValue: Math.round(input.StartValue.getTime() / 1000) }), + }; +}; + +const serializeAws_restJson1Filters = (input: Filters, context: __SerdeContext): any => { + return { + ...(input.AncestorIds != null && { + AncestorIds: serializeAws_restJson1SearchAncestorIdList(input.AncestorIds, context), + }), + ...(input.ContentCategories != null && { + ContentCategories: serializeAws_restJson1SearchContentCategoryTypeList(input.ContentCategories, context), + }), + ...(input.CreatedRange != null && { + CreatedRange: serializeAws_restJson1DateRangeType(input.CreatedRange, context), + }), + ...(input.Labels != null && { Labels: serializeAws_restJson1SearchLabelList(input.Labels, context) }), + ...(input.ModifiedRange != null && { + ModifiedRange: serializeAws_restJson1DateRangeType(input.ModifiedRange, context), + }), + ...(input.Principals != null && { + Principals: serializeAws_restJson1SearchPrincipalTypeList(input.Principals, context), + }), + ...(input.ResourceTypes != null && { + ResourceTypes: serializeAws_restJson1SearchResourceTypeList(input.ResourceTypes, context), + }), + ...(input.SearchCollectionTypes != null && { + SearchCollectionTypes: serializeAws_restJson1SearchCollectionTypeList(input.SearchCollectionTypes, context), + }), + ...(input.SizeRange != null && { SizeRange: serializeAws_restJson1LongRangeType(input.SizeRange, context) }), + ...(input.TextLocales != null && { + TextLocales: serializeAws_restJson1TextLocaleTypeList(input.TextLocales, context), + }), + }; +}; + +const serializeAws_restJson1LongRangeType = (input: LongRangeType, context: __SerdeContext): any => { + return { + ...(input.EndValue != null && { EndValue: input.EndValue }), + ...(input.StartValue != null && { StartValue: input.StartValue }), + }; +}; + const serializeAws_restJson1NotificationOptions = (input: NotificationOptions, context: __SerdeContext): any => { return { ...(input.EmailMessage != null && { EmailMessage: input.EmailMessage }), @@ -4315,6 +4480,107 @@ const serializeAws_restJson1NotificationOptions = (input: NotificationOptions, c }; }; +const serializeAws_restJson1SearchAncestorIdList = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchCollectionTypeList = ( + input: (SearchCollectionType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchContentCategoryTypeList = ( + input: (ContentCategoryType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchLabelList = (input: string[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchPrincipalRoleList = ( + input: (PrincipalRoleType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchPrincipalType = (input: SearchPrincipalType, context: __SerdeContext): any => { + return { + ...(input.Id != null && { Id: input.Id }), + ...(input.Roles != null && { Roles: serializeAws_restJson1SearchPrincipalRoleList(input.Roles, context) }), + }; +}; + +const serializeAws_restJson1SearchPrincipalTypeList = (input: SearchPrincipalType[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return serializeAws_restJson1SearchPrincipalType(entry, context); + }); +}; + +const serializeAws_restJson1SearchQueryScopeTypeList = ( + input: (SearchQueryScopeType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchResourceTypeList = ( + input: (SearchResourceType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + +const serializeAws_restJson1SearchResultSortList = (input: SearchSortResult[], context: __SerdeContext): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return serializeAws_restJson1SearchSortResult(entry, context); + }); +}; + +const serializeAws_restJson1SearchSortResult = (input: SearchSortResult, context: __SerdeContext): any => { + return { + ...(input.Field != null && { Field: input.Field }), + ...(input.Order != null && { Order: input.Order }), + }; +}; + const serializeAws_restJson1SharedLabels = (input: string[], context: __SerdeContext): any => { return input .filter((e: any) => e != null) @@ -4346,6 +4612,17 @@ const serializeAws_restJson1StorageRuleType = (input: StorageRuleType, context: }; }; +const serializeAws_restJson1TextLocaleTypeList = ( + input: (LanguageCodeType | string)[], + context: __SerdeContext +): any => { + return input + .filter((e: any) => e != null) + .map((entry) => { + return entry; + }); +}; + const deserializeAws_restJson1Activity = (output: any, context: __SerdeContext): Activity => { return { CommentMetadata: @@ -4405,6 +4682,7 @@ const deserializeAws_restJson1CommentMetadata = (output: any, context: __SerdeCo CommentId: __expectString(output.CommentId), CommentStatus: __expectString(output.CommentStatus), Contributor: output.Contributor != null ? deserializeAws_restJson1User(output.Contributor, context) : undefined, + ContributorId: __expectString(output.ContributorId), CreatedTimestamp: output.CreatedTimestamp != null ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTimestamp))) @@ -4701,6 +4979,41 @@ const deserializeAws_restJson1ResourcePathComponentList = ( return retVal; }; +const deserializeAws_restJson1ResponseItem = (output: any, context: __SerdeContext): ResponseItem => { + return { + CommentMetadata: + output.CommentMetadata != null + ? deserializeAws_restJson1CommentMetadata(output.CommentMetadata, context) + : undefined, + DocumentMetadata: + output.DocumentMetadata != null + ? deserializeAws_restJson1DocumentMetadata(output.DocumentMetadata, context) + : undefined, + DocumentVersionMetadata: + output.DocumentVersionMetadata != null + ? deserializeAws_restJson1DocumentVersionMetadata(output.DocumentVersionMetadata, context) + : undefined, + FolderMetadata: + output.FolderMetadata != null + ? deserializeAws_restJson1FolderMetadata(output.FolderMetadata, context) + : undefined, + ResourceType: __expectString(output.ResourceType), + WebUrl: __expectString(output.WebUrl), + } as any; +}; + +const deserializeAws_restJson1ResponseItemsList = (output: any, context: __SerdeContext): ResponseItem[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_restJson1ResponseItem(entry, context); + }); + return retVal; +}; + const deserializeAws_restJson1SharedLabels = (output: any, context: __SerdeContext): string[] => { const retVal = (output || []) .filter((e: any) => e != null) diff --git a/codegen/sdk-codegen/aws-models/workdocs.json b/codegen/sdk-codegen/aws-models/workdocs.json index 473151209f26..440ce395b43a 100644 --- a/codegen/sdk-codegen/aws-models/workdocs.json +++ b/codegen/sdk-codegen/aws-models/workdocs.json @@ -150,6 +150,9 @@ { "target": "com.amazonaws.workdocs#RestoreDocumentVersions" }, + { + "target": "com.amazonaws.workdocs#SearchResources" + }, { "target": "com.amazonaws.workdocs#UpdateDocument" }, @@ -185,7 +188,7 @@ "parameters": { "Region": { "builtIn": "AWS::Region", - "required": true, + "required": false, "documentation": "The AWS region used to dispatch the request.", "type": "String" }, @@ -214,13 +217,12 @@ { "conditions": [ { - "fn": "aws.partition", + "fn": "isSet", "argv": [ { - "ref": "Region" + "ref": "Endpoint" } - ], - "assign": "PartitionResult" + ] } ], "type": "tree", @@ -228,14 +230,20 @@ { "conditions": [ { - "fn": "isSet", + "fn": "booleanEquals", "argv": [ { - "ref": "Endpoint" - } + "ref": "UseFIPS" + }, + true ] } ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], "type": "tree", "rules": [ { @@ -244,67 +252,42 @@ "fn": "booleanEquals", "argv": [ { - "ref": "UseFIPS" + "ref": "UseDualStack" }, true ] } ], - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", "type": "error" }, { "conditions": [], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" + "endpoint": { + "url": { + "ref": "Endpoint" }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" - }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ] - }, + } + ] + }, + { + "conditions": [], + "type": "tree", + "rules": [ { "conditions": [ { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - }, - { - "fn": "booleanEquals", + "fn": "isSet", "argv": [ { - "ref": "UseDualStack" - }, - true + "ref": "Region" + } ] } ], @@ -313,154 +296,215 @@ { "conditions": [ { - "fn": "booleanEquals", + "fn": "aws.partition", "argv": [ - true, { - "fn": "getAttr", + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "ref": "UseFIPS" }, - "supportsFIPS" + true ] - } - ] - }, - { - "fn": "booleanEquals", - "argv": [ - true, + }, { - "fn": "getAttr", + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "ref": "UseDualStack" }, - "supportsDualStack" + true ] } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], + ], "type": "tree", "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://workdocs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, { "conditions": [], - "endpoint": { - "url": "https://workdocs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" } ] - } - ] - }, - { - "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ { - "fn": "booleanEquals", - "argv": [ - true, + "conditions": [ { - "fn": "getAttr", + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "ref": "UseFIPS" }, - "supportsFIPS" + true ] } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], + ], "type": "tree", "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://workdocs-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } + ] + }, { "conditions": [], - "endpoint": { - "url": "https://workdocs-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" } ] - } - ] - }, - { - "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ { - "fn": "booleanEquals", - "argv": [ - true, + "conditions": [ { - "fn": "getAttr", + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "ref": "UseDualStack" }, - "supportsDualStack" + true + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "type": "tree", + "rules": [ + { + "conditions": [], + "type": "tree", + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://workdocs.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ] + } ] + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" } ] - } - ], - "type": "tree", - "rules": [ + }, { "conditions": [], "type": "tree", @@ -468,7 +512,7 @@ { "conditions": [], "endpoint": { - "url": "https://workdocs.{Region}.{PartitionResult#dualStackDnsSuffix}", + "url": "https://workdocs.{Region}.{PartitionResult#dnsSuffix}", "properties": {}, "headers": {} }, @@ -477,28 +521,13 @@ ] } ] - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" } ] }, { "conditions": [], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://workdocs.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] + "error": "Invalid Configuration: Missing Region", + "type": "error" } ] } @@ -793,7 +822,7 @@ } }, { - "documentation": "For custom endpoint with fips disabled and dualstack disabled", + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", "expect": { "endpoint": { "url": "https://example.com" @@ -806,6 +835,19 @@ "Endpoint": "https://example.com" } }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, { "documentation": "For custom endpoint with fips enabled and dualstack disabled", "expect": { @@ -1337,6 +1379,23 @@ "smithy.api#output": {} } }, + "com.amazonaws.workdocs#AdditionalResponseFieldType": { + "type": "enum", + "members": { + "WEBURL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "WEBURL" + } + } + } + }, + "com.amazonaws.workdocs#AdditionalResponseFieldsList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#AdditionalResponseFieldType" + } + }, "com.amazonaws.workdocs#AuthenticationHeaderType": { "type": "string", "traits": { @@ -1481,6 +1540,12 @@ "traits": { "smithy.api#documentation": "

The ID of the user being replied to.

" } + }, + "ContributorId": { + "target": "com.amazonaws.workdocs#IdType", + "traits": { + "smithy.api#documentation": "

The ID of the user who made the comment.

" + } } }, "traits": { @@ -1563,19 +1628,78 @@ "smithy.api#httpError": 409 } }, - "com.amazonaws.workdocs#CreateComment": { - "type": "operation", - "input": { - "target": "com.amazonaws.workdocs#CreateCommentRequest" - }, - "output": { - "target": "com.amazonaws.workdocs#CreateCommentResponse" - }, - "errors": [ - { - "target": "com.amazonaws.workdocs#DocumentLockedForCommentsException" + "com.amazonaws.workdocs#ContentCategoryType": { + "type": "enum", + "members": { + "IMAGE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IMAGE" + } }, - { + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "PDF": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PDF" + } + }, + "SPREADSHEET": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SPREADSHEET" + } + }, + "PRESENTATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRESENTATION" + } + }, + "AUDIO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "AUDIO" + } + }, + "VIDEO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VIDEO" + } + }, + "SOURCE_CODE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SOURCE_CODE" + } + }, + "OTHER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OTHER" + } + } + } + }, + "com.amazonaws.workdocs#CreateComment": { + "type": "operation", + "input": { + "target": "com.amazonaws.workdocs#CreateCommentRequest" + }, + "output": { + "target": "com.amazonaws.workdocs#CreateCommentResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workdocs#DocumentLockedForCommentsException" + }, + { "target": "com.amazonaws.workdocs#EntityNotExistsException" }, { @@ -2189,6 +2313,26 @@ "smithy.api#pattern": "^[a-zA-Z0-9._+-/=][a-zA-Z0-9 ._+-/=]*$" } }, + "com.amazonaws.workdocs#DateRangeType": { + "type": "structure", + "members": { + "StartValue": { + "target": "com.amazonaws.workdocs#TimestampType", + "traits": { + "smithy.api#documentation": "

Timestamp range start value (in epochs)

" + } + }, + "EndValue": { + "target": "com.amazonaws.workdocs#TimestampType", + "traits": { + "smithy.api#documentation": "

Timestamp range end value (in epochs).

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Filters results based on timestamp range (in epochs).

" + } + }, "com.amazonaws.workdocs#DeactivateUser": { "type": "operation", "input": { @@ -2939,6 +3083,12 @@ "method": "GET", "uri": "/api/v1/activities", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "UserActivities", + "pageSize": "Limit" } } }, @@ -3075,6 +3225,12 @@ "method": "GET", "uri": "/api/v1/documents/{DocumentId}/versions/{VersionId}/comments", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "Comments", + "pageSize": "Limit" } } }, @@ -3424,6 +3580,12 @@ "method": "GET", "uri": "/api/v1/groups", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "Groups", + "pageSize": "Limit" } } }, @@ -3516,6 +3678,12 @@ "method": "GET", "uri": "/api/v1/organizations/{OrganizationId}/subscriptions", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "Subscriptions", + "pageSize": "Limit" } } }, @@ -3600,6 +3768,12 @@ "method": "GET", "uri": "/api/v1/resources/{ResourceId}/permissions", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "Principals", + "pageSize": "Limit" } } }, @@ -3698,6 +3872,12 @@ "method": "GET", "uri": "/api/v1/me/root", "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "Folders", + "pageSize": "Limit" } } }, @@ -4265,6 +4445,74 @@ "smithy.api#pattern": "^[\\w,]+$" } }, + "com.amazonaws.workdocs#Filters": { + "type": "structure", + "members": { + "TextLocales": { + "target": "com.amazonaws.workdocs#TextLocaleTypeList", + "traits": { + "smithy.api#documentation": "

Filters by the locale of the content or comment.

" + } + }, + "ContentCategories": { + "target": "com.amazonaws.workdocs#SearchContentCategoryTypeList", + "traits": { + "smithy.api#documentation": "

Filters by content category.

" + } + }, + "ResourceTypes": { + "target": "com.amazonaws.workdocs#SearchResourceTypeList", + "traits": { + "smithy.api#documentation": "

Filters based on entity type.

" + } + }, + "Labels": { + "target": "com.amazonaws.workdocs#SearchLabelList", + "traits": { + "smithy.api#documentation": "

Filter by labels using exact match.

" + } + }, + "Principals": { + "target": "com.amazonaws.workdocs#SearchPrincipalTypeList", + "traits": { + "smithy.api#documentation": "

Filter based on UserIds or GroupIds.

" + } + }, + "AncestorIds": { + "target": "com.amazonaws.workdocs#SearchAncestorIdList", + "traits": { + "smithy.api#documentation": "

Filter based on resource’s path.

" + } + }, + "SearchCollectionTypes": { + "target": "com.amazonaws.workdocs#SearchCollectionTypeList", + "traits": { + "smithy.api#documentation": "

Filter based on file groupings.

" + } + }, + "SizeRange": { + "target": "com.amazonaws.workdocs#LongRangeType", + "traits": { + "smithy.api#documentation": "

Filter based on size (in bytes).

" + } + }, + "CreatedRange": { + "target": "com.amazonaws.workdocs#DateRangeType", + "traits": { + "smithy.api#documentation": "

Filter based on resource’s creation timestamp.

" + } + }, + "ModifiedRange": { + "target": "com.amazonaws.workdocs#DateRangeType", + "traits": { + "smithy.api#documentation": "

Filter based on resource’s modified timestamp.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Filters results based on entity metadata.

" + } + }, "com.amazonaws.workdocs#FolderContentType": { "type": "enum", "members": { @@ -5109,6 +5357,9 @@ { "target": "com.amazonaws.workdocs#FailedDependencyException" }, + { + "target": "com.amazonaws.workdocs#InvalidArgumentException" + }, { "target": "com.amazonaws.workdocs#InvalidPasswordException" }, @@ -5275,163 +5526,422 @@ "smithy.api#httpError": 401 } }, - "com.amazonaws.workdocs#LimitExceededException": { - "type": "structure", - "members": { - "Message": { - "target": "com.amazonaws.workdocs#ErrorMessageType" - } - }, - "traits": { - "smithy.api#documentation": "

The maximum of 100,000 files and folders under the parent folder has been exceeded.

", - "smithy.api#error": "client", - "smithy.api#httpError": 409 - } - }, - "com.amazonaws.workdocs#LimitType": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 1, - "max": 999 - } - } - }, - "com.amazonaws.workdocs#LocaleType": { + "com.amazonaws.workdocs#LanguageCodeType": { "type": "enum", "members": { - "EN": { + "AR": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "en" + "smithy.api#enumValue": "AR" } }, - "FR": { + "BG": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "fr" + "smithy.api#enumValue": "BG" } }, - "KO": { + "BN": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "ko" + "smithy.api#enumValue": "BN" + } + }, + "DA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DA" } }, "DE": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "de" + "smithy.api#enumValue": "DE" + } + }, + "CS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CS" + } + }, + "EL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EL" + } + }, + "EN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EN" } }, "ES": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "es" + "smithy.api#enumValue": "ES" } }, - "JA": { + "FA": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "ja" + "smithy.api#enumValue": "FA" } }, - "RU": { + "FI": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "ru" + "smithy.api#enumValue": "FI" } }, - "ZH_CN": { + "FR": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "zh_CN" + "smithy.api#enumValue": "FR" } }, - "ZH_TW": { + "HI": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "zh_TW" + "smithy.api#enumValue": "HI" } }, - "PT_BR": { + "HU": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "pt_BR" + "smithy.api#enumValue": "HU" } }, - "DEFAULT": { + "ID": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "default" + "smithy.api#enumValue": "ID" } - } - } - }, - "com.amazonaws.workdocs#MarkerType": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 2048 }, - "smithy.api#pattern": "^[\\u0000-\\u00FF]+$" - } - }, - "com.amazonaws.workdocs#MessageType": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 2048 + "IT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IT" + } }, - "smithy.api#sensitive": {} - } - }, - "com.amazonaws.workdocs#NotificationOptions": { - "type": "structure", - "members": { - "SendEmail": { - "target": "com.amazonaws.workdocs#BooleanType", + "JA": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#default": false, - "smithy.api#documentation": "

Boolean value to indicate an email notification should be sent to the\n recipients.

" + "smithy.api#enumValue": "JA" } }, - "EmailMessage": { - "target": "com.amazonaws.workdocs#MessageType", + "KO": { + "target": "smithy.api#Unit", "traits": { - "smithy.api#documentation": "

Text value to be included in the email body.

" + "smithy.api#enumValue": "KO" } - } - }, - "traits": { - "smithy.api#documentation": "

Set of options which defines notification preferences of given action.

" - } - }, - "com.amazonaws.workdocs#OrderType": { - "type": "enum", - "members": { - "ASCENDING": { + }, + "LT": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "ASCENDING" + "smithy.api#enumValue": "LT" } }, - "DESCENDING": { + "LV": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "DESCENDING" + "smithy.api#enumValue": "LV" } - } - } - }, - "com.amazonaws.workdocs#OrganizationUserList": { - "type": "list", - "member": { - "target": "com.amazonaws.workdocs#User" - } - }, + }, + "NL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NL" + } + }, + "NO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NO" + } + }, + "PT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PT" + } + }, + "RO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RO" + } + }, + "RU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RU" + } + }, + "SV": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SV" + } + }, + "SW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SW" + } + }, + "TH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TH" + } + }, + "TR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TR" + } + }, + "ZH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ZH" + } + }, + "DEFAULT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DEFAULT" + } + } + } + }, + "com.amazonaws.workdocs#LimitExceededException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.workdocs#ErrorMessageType" + } + }, + "traits": { + "smithy.api#documentation": "

The maximum of 100,000 files and folders under the parent folder has been exceeded.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.workdocs#LimitType": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 999 + } + } + }, + "com.amazonaws.workdocs#LocaleType": { + "type": "enum", + "members": { + "EN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "en" + } + }, + "FR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "fr" + } + }, + "KO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ko" + } + }, + "DE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "de" + } + }, + "ES": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "es" + } + }, + "JA": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ja" + } + }, + "RU": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ru" + } + }, + "ZH_CN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "zh_CN" + } + }, + "ZH_TW": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "zh_TW" + } + }, + "PT_BR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "pt_BR" + } + }, + "DEFAULT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "default" + } + } + } + }, + "com.amazonaws.workdocs#LongRangeType": { + "type": "structure", + "members": { + "StartValue": { + "target": "com.amazonaws.workdocs#LongType", + "traits": { + "smithy.api#documentation": "

The size start range (in bytes).

" + } + }, + "EndValue": { + "target": "com.amazonaws.workdocs#LongType", + "traits": { + "smithy.api#documentation": "

The size end range (in bytes).

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Filter based on size (in bytes).

" + } + }, + "com.amazonaws.workdocs#LongType": { + "type": "long" + }, + "com.amazonaws.workdocs#MarkerType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^[\\u0000-\\u00FF]+$" + } + }, + "com.amazonaws.workdocs#MessageType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2048 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.workdocs#NextMarkerType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + }, + "smithy.api#pattern": "^[\\d]+$" + } + }, + "com.amazonaws.workdocs#NotificationOptions": { + "type": "structure", + "members": { + "SendEmail": { + "target": "com.amazonaws.workdocs#BooleanType", + "traits": { + "smithy.api#default": false, + "smithy.api#documentation": "

Boolean value to indicate an email notification should be sent to the\n recipients.

" + } + }, + "EmailMessage": { + "target": "com.amazonaws.workdocs#MessageType", + "traits": { + "smithy.api#documentation": "

Text value to be included in the email body.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Set of options which defines notification preferences of given action.

" + } + }, + "com.amazonaws.workdocs#OrderByFieldType": { + "type": "enum", + "members": { + "RELEVANCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RELEVANCE" + } + }, + "NAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NAME" + } + }, + "SIZE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SIZE" + } + }, + "CREATED_TIMESTAMP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CREATED_TIMESTAMP" + } + }, + "MODIFIED_TIMESTAMP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MODIFIED_TIMESTAMP" + } + } + } + }, + "com.amazonaws.workdocs#OrderType": { + "type": "enum", + "members": { + "ASCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ASCENDING" + } + }, + "DESCENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DESCENDING" + } + } + } + }, + "com.amazonaws.workdocs#OrganizationUserList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#User" + } + }, "com.amazonaws.workdocs#PageMarkerType": { "type": "string", "traits": { @@ -5546,10 +6056,39 @@ "target": "com.amazonaws.workdocs#Principal" } }, - "com.amazonaws.workdocs#PrincipalType": { + "com.amazonaws.workdocs#PrincipalRoleType": { "type": "enum", "members": { - "USER": { + "VIEWER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VIEWER" + } + }, + "CONTRIBUTOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONTRIBUTOR" + } + }, + "OWNER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OWNER" + } + }, + "COOWNER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COOWNER" + } + } + } + }, + "com.amazonaws.workdocs#PrincipalType": { + "type": "enum", + "members": { + "USER": { "target": "smithy.api#Unit", "traits": { "smithy.api#enumValue": "USER" @@ -5811,148 +6350,564 @@ } }, "traits": { - "smithy.api#documentation": "

Describes the metadata of a resource.

" + "smithy.api#documentation": "

Describes the metadata of a resource.

" + } + }, + "com.amazonaws.workdocs#ResourceNameType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^[\\u0020-\\u202D\\u202F-\\uFFFF]+$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.workdocs#ResourcePath": { + "type": "structure", + "members": { + "Components": { + "target": "com.amazonaws.workdocs#ResourcePathComponentList", + "traits": { + "smithy.api#documentation": "

The components of the resource path.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes the path information of a resource.

" + } + }, + "com.amazonaws.workdocs#ResourcePathComponent": { + "type": "structure", + "members": { + "Id": { + "target": "com.amazonaws.workdocs#IdType", + "traits": { + "smithy.api#documentation": "

The ID of the resource path.

" + } + }, + "Name": { + "target": "com.amazonaws.workdocs#ResourceNameType", + "traits": { + "smithy.api#documentation": "

The name of the resource path.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes the resource path.

" + } + }, + "com.amazonaws.workdocs#ResourcePathComponentList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#ResourcePathComponent" + } + }, + "com.amazonaws.workdocs#ResourceSortType": { + "type": "enum", + "members": { + "DATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATE" + } + }, + "NAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NAME" + } + } + } + }, + "com.amazonaws.workdocs#ResourceStateType": { + "type": "enum", + "members": { + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "RESTORING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RESTORING" + } + }, + "RECYCLING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RECYCLING" + } + }, + "RECYCLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RECYCLED" + } + } + } + }, + "com.amazonaws.workdocs#ResourceType": { + "type": "enum", + "members": { + "FOLDER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FOLDER" + } + }, + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + } + } + }, + "com.amazonaws.workdocs#ResponseItem": { + "type": "structure", + "members": { + "ResourceType": { + "target": "com.amazonaws.workdocs#ResponseItemType", + "traits": { + "smithy.api#documentation": "

The type of item being returned.

" + } + }, + "WebUrl": { + "target": "com.amazonaws.workdocs#ResponseItemWebUrl", + "traits": { + "smithy.api#documentation": "

The webUrl of the item being returned.

" + } + }, + "DocumentMetadata": { + "target": "com.amazonaws.workdocs#DocumentMetadata", + "traits": { + "smithy.api#documentation": "

The document that matches the query.

" + } + }, + "FolderMetadata": { + "target": "com.amazonaws.workdocs#FolderMetadata", + "traits": { + "smithy.api#documentation": "

The folder that matches the query.

" + } + }, + "CommentMetadata": { + "target": "com.amazonaws.workdocs#CommentMetadata", + "traits": { + "smithy.api#documentation": "

The comment that matches the query.

" + } + }, + "DocumentVersionMetadata": { + "target": "com.amazonaws.workdocs#DocumentVersionMetadata", + "traits": { + "smithy.api#documentation": "

The document version that matches the metadata.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

List of Documents, Folders, Comments, and Document Versions matching the query.

" + } + }, + "com.amazonaws.workdocs#ResponseItemType": { + "type": "enum", + "members": { + "DOCUMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT" + } + }, + "FOLDER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FOLDER" + } + }, + "COMMENT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMMENT" + } + }, + "DOCUMENT_VERSION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOCUMENT_VERSION" + } + } + } + }, + "com.amazonaws.workdocs#ResponseItemWebUrl": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 512 + }, + "smithy.api#pattern": "^[\\u0020-\\uFFFF]+$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.workdocs#ResponseItemsList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#ResponseItem" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 100 + } + } + }, + "com.amazonaws.workdocs#RestoreDocumentVersions": { + "type": "operation", + "input": { + "target": "com.amazonaws.workdocs#RestoreDocumentVersionsRequest" + }, + "output": { + "target": "smithy.api#Unit" + }, + "errors": [ + { + "target": "com.amazonaws.workdocs#ConcurrentModificationException" + }, + { + "target": "com.amazonaws.workdocs#ConflictingOperationException" + }, + { + "target": "com.amazonaws.workdocs#EntityNotExistsException" + }, + { + "target": "com.amazonaws.workdocs#FailedDependencyException" + }, + { + "target": "com.amazonaws.workdocs#InvalidOperationException" + }, + { + "target": "com.amazonaws.workdocs#ProhibitedStateException" + }, + { + "target": "com.amazonaws.workdocs#UnauthorizedOperationException" + }, + { + "target": "com.amazonaws.workdocs#UnauthorizedResourceAccessException" + } + ], + "traits": { + "smithy.api#documentation": "

Recovers a deleted version of an Amazon WorkDocs document.

", + "smithy.api#http": { + "method": "POST", + "uri": "/api/v1/documentVersions/restore/{DocumentId}", + "code": 204 + } + } + }, + "com.amazonaws.workdocs#RestoreDocumentVersionsRequest": { + "type": "structure", + "members": { + "AuthenticationToken": { + "target": "com.amazonaws.workdocs#AuthenticationHeaderType", + "traits": { + "smithy.api#documentation": "

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

", + "smithy.api#httpHeader": "Authentication" + } + }, + "DocumentId": { + "target": "com.amazonaws.workdocs#ResourceIdType", + "traits": { + "smithy.api#documentation": "

The ID of the document.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.workdocs#RolePermissionType": { + "type": "enum", + "members": { + "DIRECT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECT" + } + }, + "INHERITED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INHERITED" + } + } + } + }, + "com.amazonaws.workdocs#RoleType": { + "type": "enum", + "members": { + "VIEWER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "VIEWER" + } + }, + "CONTRIBUTOR": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONTRIBUTOR" + } + }, + "OWNER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OWNER" + } + }, + "COOWNER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COOWNER" + } + } + } + }, + "com.amazonaws.workdocs#SearchAncestorId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.workdocs#SearchAncestorIdList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#SearchAncestorId" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } + } + }, + "com.amazonaws.workdocs#SearchCollectionType": { + "type": "enum", + "members": { + "OWNED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "OWNED" + } + }, + "SHARED_WITH_ME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "SHARED_WITH_ME" + } + } + } + }, + "com.amazonaws.workdocs#SearchCollectionTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#SearchCollectionType" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2 + } + } + }, + "com.amazonaws.workdocs#SearchContentCategoryTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#ContentCategoryType" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 9 + } + } + }, + "com.amazonaws.workdocs#SearchLabel": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.workdocs#SearchLabelList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#SearchLabel" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } } }, - "com.amazonaws.workdocs#ResourceNameType": { + "com.amazonaws.workdocs#SearchMarkerType": { "type": "string", "traits": { "smithy.api#length": { "min": 1, - "max": 255 + "max": 12288 }, - "smithy.api#pattern": "^[\\u0020-\\u202D\\u202F-\\uFFFF]+$" + "smithy.api#pattern": "^[\\u0000-\\u00FF]+$" } }, - "com.amazonaws.workdocs#ResourcePath": { - "type": "structure", - "members": { - "Components": { - "target": "com.amazonaws.workdocs#ResourcePathComponentList", - "traits": { - "smithy.api#documentation": "

The components of the resource path.

" - } - } + "com.amazonaws.workdocs#SearchPrincipalRoleList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#PrincipalRoleType" }, "traits": { - "smithy.api#documentation": "

Describes the path information of a resource.

" + "smithy.api#length": { + "min": 0, + "max": 4 + } } }, - "com.amazonaws.workdocs#ResourcePathComponent": { + "com.amazonaws.workdocs#SearchPrincipalType": { "type": "structure", "members": { "Id": { "target": "com.amazonaws.workdocs#IdType", "traits": { - "smithy.api#documentation": "

The ID of the resource path.

" + "smithy.api#documentation": "

UserIds or GroupIds.

", + "smithy.api#required": {} } }, - "Name": { - "target": "com.amazonaws.workdocs#ResourceNameType", + "Roles": { + "target": "com.amazonaws.workdocs#SearchPrincipalRoleList", "traits": { - "smithy.api#documentation": "

The name of the resource path.

" + "smithy.api#documentation": "

The Role of a User or Group.

" } } }, "traits": { - "smithy.api#documentation": "

Describes the resource path.

" + "smithy.api#documentation": "

Filter based on UserIds or GroupIds.

" } }, - "com.amazonaws.workdocs#ResourcePathComponentList": { + "com.amazonaws.workdocs#SearchPrincipalTypeList": { "type": "list", "member": { - "target": "com.amazonaws.workdocs#ResourcePathComponent" + "target": "com.amazonaws.workdocs#SearchPrincipalType" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } } }, - "com.amazonaws.workdocs#ResourceSortType": { + "com.amazonaws.workdocs#SearchQueryScopeType": { "type": "enum", "members": { - "DATE": { + "NAME": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "DATE" + "smithy.api#enumValue": "NAME" } }, - "NAME": { + "CONTENT": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "NAME" + "smithy.api#enumValue": "CONTENT" } } } }, - "com.amazonaws.workdocs#ResourceStateType": { + "com.amazonaws.workdocs#SearchQueryScopeTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#SearchQueryScopeType" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2 + } + } + }, + "com.amazonaws.workdocs#SearchQueryType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 512 + }, + "smithy.api#pattern": "^[\\u0020-\\uFFFF]+$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.workdocs#SearchResourceType": { "type": "enum", "members": { - "ACTIVE": { + "FOLDER": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "ACTIVE" + "smithy.api#enumValue": "FOLDER" } }, - "RESTORING": { + "DOCUMENT": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "RESTORING" + "smithy.api#enumValue": "DOCUMENT" } }, - "RECYCLING": { + "COMMENT": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "RECYCLING" + "smithy.api#enumValue": "COMMENT" } }, - "RECYCLED": { + "DOCUMENT_VERSION": { "target": "smithy.api#Unit", "traits": { - "smithy.api#enumValue": "RECYCLED" + "smithy.api#enumValue": "DOCUMENT_VERSION" } } } }, - "com.amazonaws.workdocs#ResourceType": { - "type": "enum", - "members": { - "FOLDER": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "FOLDER" - } - }, - "DOCUMENT": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "DOCUMENT" - } + "com.amazonaws.workdocs#SearchResourceTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#SearchResourceType" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 4 } } }, - "com.amazonaws.workdocs#RestoreDocumentVersions": { + "com.amazonaws.workdocs#SearchResources": { "type": "operation", "input": { - "target": "com.amazonaws.workdocs#RestoreDocumentVersionsRequest" + "target": "com.amazonaws.workdocs#SearchResourcesRequest" }, "output": { - "target": "smithy.api#Unit" + "target": "com.amazonaws.workdocs#SearchResourcesResponse" }, "errors": [ { - "target": "com.amazonaws.workdocs#ConcurrentModificationException" - }, - { - "target": "com.amazonaws.workdocs#ConflictingOperationException" - }, - { - "target": "com.amazonaws.workdocs#EntityNotExistsException" - }, - { - "target": "com.amazonaws.workdocs#FailedDependencyException" - }, - { - "target": "com.amazonaws.workdocs#InvalidOperationException" + "target": "com.amazonaws.workdocs#InvalidArgumentException" }, { - "target": "com.amazonaws.workdocs#ProhibitedStateException" + "target": "com.amazonaws.workdocs#ServiceUnavailableException" }, { "target": "com.amazonaws.workdocs#UnauthorizedOperationException" @@ -5962,15 +6917,21 @@ } ], "traits": { - "smithy.api#documentation": "

Recovers a deleted version of an Amazon WorkDocs document.

", + "smithy.api#documentation": "

Searches metadata and the content of folders, documents, document versions, and comments.

", "smithy.api#http": { "method": "POST", - "uri": "/api/v1/documentVersions/restore/{DocumentId}", - "code": 204 + "uri": "/api/v1/search", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "Marker", + "outputToken": "Marker", + "items": "Items", + "pageSize": "Limit" } } }, - "com.amazonaws.workdocs#RestoreDocumentVersionsRequest": { + "com.amazonaws.workdocs#SearchResourcesRequest": { "type": "structure", "members": { "AuthenticationToken": { @@ -5980,84 +6941,118 @@ "smithy.api#httpHeader": "Authentication" } }, - "DocumentId": { - "target": "com.amazonaws.workdocs#ResourceIdType", + "QueryText": { + "target": "com.amazonaws.workdocs#SearchQueryType", "traits": { - "smithy.api#documentation": "

The ID of the document.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} + "smithy.api#documentation": "

The String to search for. Searches across different text fields based on request parameters. Use double quotes around the query string for exact phrase matches.

" } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.workdocs#RolePermissionType": { - "type": "enum", - "members": { - "DIRECT": { - "target": "smithy.api#Unit", + }, + "QueryScopes": { + "target": "com.amazonaws.workdocs#SearchQueryScopeTypeList", "traits": { - "smithy.api#enumValue": "DIRECT" + "smithy.api#documentation": "

Filter based on the text field type. A Folder has only a name and no content. A Comment has only content and no name. A Document or Document Version has a name and content

" } }, - "INHERITED": { - "target": "smithy.api#Unit", + "OrganizationId": { + "target": "com.amazonaws.workdocs#IdType", "traits": { - "smithy.api#enumValue": "INHERITED" + "smithy.api#documentation": "

Filters based on the resource owner OrgId. This is a mandatory parameter when using Admin SigV4 credentials.

" } - } - } - }, - "com.amazonaws.workdocs#RoleType": { - "type": "enum", - "members": { - "VIEWER": { - "target": "smithy.api#Unit", + }, + "AdditionalResponseFields": { + "target": "com.amazonaws.workdocs#AdditionalResponseFieldsList", "traits": { - "smithy.api#enumValue": "VIEWER" + "smithy.api#documentation": "

A list of attributes to include in the response. Used to request fields that are not normally\n returned in a standard response.

" } }, - "CONTRIBUTOR": { - "target": "smithy.api#Unit", + "Filters": { + "target": "com.amazonaws.workdocs#Filters", "traits": { - "smithy.api#enumValue": "CONTRIBUTOR" + "smithy.api#documentation": "

Filters results based on entity metadata.

" } }, - "OWNER": { - "target": "smithy.api#Unit", + "OrderBy": { + "target": "com.amazonaws.workdocs#SearchResultSortList", "traits": { - "smithy.api#enumValue": "OWNER" + "smithy.api#documentation": "

Order by results in one or more categories.

" } }, - "COOWNER": { - "target": "smithy.api#Unit", + "Limit": { + "target": "com.amazonaws.workdocs#SearchResultsLimitType", "traits": { - "smithy.api#enumValue": "COOWNER" + "smithy.api#documentation": "

Max results count per page.

" + } + }, + "Marker": { + "target": "com.amazonaws.workdocs#NextMarkerType", + "traits": { + "smithy.api#documentation": "

The marker for the next set of results.

" } } + }, + "traits": { + "smithy.api#input": {} } }, - "com.amazonaws.workdocs#SearchMarkerType": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 12288 + "com.amazonaws.workdocs#SearchResourcesResponse": { + "type": "structure", + "members": { + "Items": { + "target": "com.amazonaws.workdocs#ResponseItemsList", + "traits": { + "smithy.api#documentation": "

List of Documents, Folders, Comments, and Document Versions matching the query.

" + } }, - "smithy.api#pattern": "^[\\u0000-\\u00FF]+$" + "Marker": { + "target": "com.amazonaws.workdocs#NextMarkerType", + "traits": { + "smithy.api#documentation": "

The marker to use when requesting the next set of results. If there are no additional results, the string is empty.

" + } + } + }, + "traits": { + "smithy.api#output": {} } }, - "com.amazonaws.workdocs#SearchQueryType": { - "type": "string", + "com.amazonaws.workdocs#SearchResultSortList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#SearchSortResult" + }, "traits": { "smithy.api#length": { + "min": 0, + "max": 1 + } + } + }, + "com.amazonaws.workdocs#SearchResultsLimitType": { + "type": "integer", + "traits": { + "smithy.api#range": { "min": 1, - "max": 512 + "max": 100 + } + } + }, + "com.amazonaws.workdocs#SearchSortResult": { + "type": "structure", + "members": { + "Field": { + "target": "com.amazonaws.workdocs#OrderByFieldType", + "traits": { + "smithy.api#documentation": "

Sort search results based on this field name.

" + } }, - "smithy.api#pattern": "^[\\u0020-\\uFFFF]+$", - "smithy.api#sensitive": {} + "Order": { + "target": "com.amazonaws.workdocs#SortOrder", + "traits": { + "smithy.api#documentation": "

Sort direction.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The result of the sort operation.

" } }, "com.amazonaws.workdocs#ServiceUnavailableException": { @@ -6209,6 +7204,23 @@ "com.amazonaws.workdocs#SizeType": { "type": "long" }, + "com.amazonaws.workdocs#SortOrder": { + "type": "enum", + "members": { + "ASC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ASC" + } + }, + "DESC": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DESC" + } + } + } + }, "com.amazonaws.workdocs#StorageLimitExceededException": { "type": "structure", "members": { @@ -6347,6 +7359,18 @@ } } }, + "com.amazonaws.workdocs#TextLocaleTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.workdocs#LanguageCodeType" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1 + } + } + }, "com.amazonaws.workdocs#TimeZoneIdType": { "type": "string", "traits": { @@ -6939,7 +7963,8 @@ "smithy.api#length": { "min": 1, "max": 64 - } + }, + "smithy.api#sensitive": {} } }, "com.amazonaws.workdocs#UserFilterType": { @@ -7133,7 +8158,8 @@ "min": 1, "max": 256 }, - "smithy.api#pattern": "^[\\w\\-+.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]+)?$" + "smithy.api#pattern": "^[\\w\\-+.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]+)?$", + "smithy.api#sensitive": {} } } }