-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-workdocs): This release adds a new API, SearchResources, …
…which enable users to search through metadata and content of folders, documents, document versions and comments in a WorkDocs site.
- Loading branch information
awstools
committed
Mar 20, 2023
1 parent
56a152d
commit e1674aa
Showing
20 changed files
with
2,705 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
clients/client-workdocs/src/commands/SearchResourcesCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 {} | ||
|
||
/** | ||
* <p>Searches metadata and the content of folders, documents, document versions, and comments.</p> | ||
* @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) | ||
* <p>The pagination marker or limit fields are not valid.</p> | ||
* | ||
* @throws {@link ServiceUnavailableException} (server fault) | ||
* <p>One or more of the dependencies is unavailable.</p> | ||
* | ||
* @throws {@link UnauthorizedOperationException} (client fault) | ||
* <p>The operation is not permitted.</p> | ||
* | ||
* @throws {@link UnauthorizedResourceAccessException} (client fault) | ||
* <p>The caller does not have access to perform the action on the resource.</p> | ||
* | ||
* | ||
*/ | ||
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<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: WorkDocsClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<SearchResourcesCommandInput, SearchResourcesCommandOutput> { | ||
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<any>) => | ||
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<SearchResourcesCommandOutput> { | ||
return deserializeAws_restJson1SearchResourcesCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.