Skip to content

Commit

Permalink
feat(client-resource-explorer-2): AWS Resource Explorer released List…
Browse files Browse the repository at this point in the history
…Resources feature which allows customers to list all indexed AWS resources within a view.
  • Loading branch information
awstools committed Sep 23, 2024
1 parent a99738f commit 093a53f
Show file tree
Hide file tree
Showing 11 changed files with 520 additions and 68 deletions.
8 changes: 8 additions & 0 deletions clients/client-resource-explorer-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ ListIndexesForMembers

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/resource-explorer-2/command/ListIndexesForMembersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resource-explorer-2/Interface/ListIndexesForMembersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resource-explorer-2/Interface/ListIndexesForMembersCommandOutput/)

</details>
<details>
<summary>
ListResources
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/resource-explorer-2/command/ListResourcesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resource-explorer-2/Interface/ListResourcesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-resource-explorer-2/Interface/ListResourcesCommandOutput/)

</details>
<details>
<summary>
Expand Down
18 changes: 18 additions & 0 deletions clients/client-resource-explorer-2/src/ResourceExplorer2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ import {
ListIndexesForMembersCommandInput,
ListIndexesForMembersCommandOutput,
} from "./commands/ListIndexesForMembersCommand";
import {
ListResourcesCommand,
ListResourcesCommandInput,
ListResourcesCommandOutput,
} from "./commands/ListResourcesCommand";
import {
ListSupportedResourceTypesCommand,
ListSupportedResourceTypesCommandInput,
Expand Down Expand Up @@ -79,6 +84,7 @@ const commands = {
GetViewCommand,
ListIndexesCommand,
ListIndexesForMembersCommand,
ListResourcesCommand,
ListSupportedResourceTypesCommand,
ListTagsForResourceCommand,
ListViewsCommand,
Expand Down Expand Up @@ -267,6 +273,18 @@ export interface ResourceExplorer2 {
cb: (err: any, data?: ListIndexesForMembersCommandOutput) => void
): void;

/**
* @see {@link ListResourcesCommand}
*/
listResources(): Promise<ListResourcesCommandOutput>;
listResources(args: ListResourcesCommandInput, options?: __HttpHandlerOptions): Promise<ListResourcesCommandOutput>;
listResources(args: ListResourcesCommandInput, cb: (err: any, data?: ListResourcesCommandOutput) => void): void;
listResources(
args: ListResourcesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListResourcesCommandOutput) => void
): void;

/**
* @see {@link ListSupportedResourceTypesCommand}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import {
ListIndexesForMembersCommandInput,
ListIndexesForMembersCommandOutput,
} from "./commands/ListIndexesForMembersCommand";
import { ListResourcesCommandInput, ListResourcesCommandOutput } from "./commands/ListResourcesCommand";
import {
ListSupportedResourceTypesCommandInput,
ListSupportedResourceTypesCommandOutput,
Expand Down Expand Up @@ -120,6 +121,7 @@ export type ServiceInputTypes =
| GetViewCommandInput
| ListIndexesCommandInput
| ListIndexesForMembersCommandInput
| ListResourcesCommandInput
| ListSupportedResourceTypesCommandInput
| ListTagsForResourceCommandInput
| ListViewsCommandInput
Expand All @@ -146,6 +148,7 @@ export type ServiceOutputTypes =
| GetViewCommandOutput
| ListIndexesCommandOutput
| ListIndexesForMembersCommandOutput
| ListResourcesCommandOutput
| ListSupportedResourceTypesCommandOutput
| ListTagsForResourceCommandOutput
| ListViewsCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ export interface GetAccountLevelServiceConfigurationCommandOutput
/**
* <p>Retrieves the status of your account's Amazon Web Services service access, and validates the service
* linked role required to access the multi-account search feature. Only the management
* account or a delegated administrator with service access enabled can invoke this API
* call. </p>
* account can invoke this API call. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { ListResourcesInput, ListResourcesInputFilterSensitiveLog, ListResourcesOutput } from "../models/models_0";
import { de_ListResourcesCommand, se_ListResourcesCommand } from "../protocols/Aws_restJson1";
import {
ResourceExplorer2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../ResourceExplorer2Client";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ListResourcesCommand}.
*/
export interface ListResourcesCommandInput extends ListResourcesInput {}
/**
* @public
*
* The output of {@link ListResourcesCommand}.
*/
export interface ListResourcesCommandOutput extends ListResourcesOutput, __MetadataBearer {}

/**
* <p>Returns a list of resources and their details that match the specified criteria. This query must
* use a view. If you don’t explicitly specify a view, then Resource Explorer uses the default view for the Amazon Web Services Region
* in which you call this operation. </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ResourceExplorer2Client, ListResourcesCommand } from "@aws-sdk/client-resource-explorer-2"; // ES Modules import
* // const { ResourceExplorer2Client, ListResourcesCommand } = require("@aws-sdk/client-resource-explorer-2"); // CommonJS import
* const client = new ResourceExplorer2Client(config);
* const input = { // ListResourcesInput
* Filters: { // SearchFilter
* FilterString: "STRING_VALUE", // required
* },
* MaxResults: Number("int"),
* ViewArn: "STRING_VALUE",
* NextToken: "STRING_VALUE",
* };
* const command = new ListResourcesCommand(input);
* const response = await client.send(command);
* // { // ListResourcesOutput
* // Resources: [ // ResourceList
* // { // Resource
* // Arn: "STRING_VALUE",
* // OwningAccountId: "STRING_VALUE",
* // Region: "STRING_VALUE",
* // ResourceType: "STRING_VALUE",
* // Service: "STRING_VALUE",
* // LastReportedAt: new Date("TIMESTAMP"),
* // Properties: [ // ResourcePropertyList
* // { // ResourceProperty
* // Name: "STRING_VALUE",
* // LastReportedAt: new Date("TIMESTAMP"),
* // Data: "DOCUMENT_VALUE",
* // },
* // ],
* // },
* // ],
* // NextToken: "STRING_VALUE",
* // ViewArn: "STRING_VALUE",
* // };
*
* ```
*
* @param ListResourcesCommandInput - {@link ListResourcesCommandInput}
* @returns {@link ListResourcesCommandOutput}
* @see {@link ListResourcesCommandInput} for command's `input` shape.
* @see {@link ListResourcesCommandOutput} for command's `response` shape.
* @see {@link ResourceExplorer2ClientResolvedConfig | config} for ResourceExplorer2Client's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The credentials that you used to call this operation don't have the minimum required
* permissions.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>The request failed because of internal service error. Try your request again
* later.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>You specified a resource that doesn't exist. Check the ID or ARN that you used to
* identity the resource, and try again.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The request failed because you exceeded a rate limit for this operation. For more
* information, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html">Quotas for
* Resource Explorer</a>.</p>
*
* @throws {@link UnauthorizedException} (client fault)
* <p>The principal making the request isn't permitted to perform the operation.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>You provided an invalid value for one of the operation's parameters. Check the syntax
* for the operation, and try again.</p>
*
* @throws {@link ResourceExplorer2ServiceException}
* <p>Base exception class for all service exceptions from ResourceExplorer2 service.</p>
*
* @public
*/
export class ListResourcesCommand extends $Command
.classBuilder<
ListResourcesCommandInput,
ListResourcesCommandOutput,
ResourceExplorer2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: ResourceExplorer2ClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("ResourceExplorer", "ListResources", {})
.n("ResourceExplorer2Client", "ListResourcesCommand")
.f(ListResourcesInputFilterSensitiveLog, void 0)
.ser(se_ListResourcesCommand)
.de(de_ListResourcesCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ListResourcesInput;
output: ListResourcesOutput;
};
sdk: {
input: ListResourcesCommandInput;
output: ListResourcesCommandOutput;
};
};
}
1 change: 1 addition & 0 deletions clients/client-resource-explorer-2/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * from "./GetIndexCommand";
export * from "./GetViewCommand";
export * from "./ListIndexesCommand";
export * from "./ListIndexesForMembersCommand";
export * from "./ListResourcesCommand";
export * from "./ListSupportedResourceTypesCommand";
export * from "./ListTagsForResourceCommand";
export * from "./ListViewsCommand";
Expand Down
Loading

0 comments on commit 093a53f

Please sign in to comment.