Skip to content

Commit 093a53f

Browse files
author
awstools
committed
feat(client-resource-explorer-2): AWS Resource Explorer released ListResources feature which allows customers to list all indexed AWS resources within a view.
1 parent a99738f commit 093a53f

File tree

11 files changed

+520
-68
lines changed

11 files changed

+520
-68
lines changed

clients/client-resource-explorer-2/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,14 @@ ListIndexesForMembers
326326

327327
[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/)
328328

329+
</details>
330+
<details>
331+
<summary>
332+
ListResources
333+
</summary>
334+
335+
[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/)
336+
329337
</details>
330338
<details>
331339
<summary>

clients/client-resource-explorer-2/src/ResourceExplorer2.ts

+18
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ import {
3939
ListIndexesForMembersCommandInput,
4040
ListIndexesForMembersCommandOutput,
4141
} from "./commands/ListIndexesForMembersCommand";
42+
import {
43+
ListResourcesCommand,
44+
ListResourcesCommandInput,
45+
ListResourcesCommandOutput,
46+
} from "./commands/ListResourcesCommand";
4247
import {
4348
ListSupportedResourceTypesCommand,
4449
ListSupportedResourceTypesCommandInput,
@@ -79,6 +84,7 @@ const commands = {
7984
GetViewCommand,
8085
ListIndexesCommand,
8186
ListIndexesForMembersCommand,
87+
ListResourcesCommand,
8288
ListSupportedResourceTypesCommand,
8389
ListTagsForResourceCommand,
8490
ListViewsCommand,
@@ -267,6 +273,18 @@ export interface ResourceExplorer2 {
267273
cb: (err: any, data?: ListIndexesForMembersCommandOutput) => void
268274
): void;
269275

276+
/**
277+
* @see {@link ListResourcesCommand}
278+
*/
279+
listResources(): Promise<ListResourcesCommandOutput>;
280+
listResources(args: ListResourcesCommandInput, options?: __HttpHandlerOptions): Promise<ListResourcesCommandOutput>;
281+
listResources(args: ListResourcesCommandInput, cb: (err: any, data?: ListResourcesCommandOutput) => void): void;
282+
listResources(
283+
args: ListResourcesCommandInput,
284+
options: __HttpHandlerOptions,
285+
cb: (err: any, data?: ListResourcesCommandOutput) => void
286+
): void;
287+
270288
/**
271289
* @see {@link ListSupportedResourceTypesCommand}
272290
*/

clients/client-resource-explorer-2/src/ResourceExplorer2Client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ import {
7878
ListIndexesForMembersCommandInput,
7979
ListIndexesForMembersCommandOutput,
8080
} from "./commands/ListIndexesForMembersCommand";
81+
import { ListResourcesCommandInput, ListResourcesCommandOutput } from "./commands/ListResourcesCommand";
8182
import {
8283
ListSupportedResourceTypesCommandInput,
8384
ListSupportedResourceTypesCommandOutput,
@@ -120,6 +121,7 @@ export type ServiceInputTypes =
120121
| GetViewCommandInput
121122
| ListIndexesCommandInput
122123
| ListIndexesForMembersCommandInput
124+
| ListResourcesCommandInput
123125
| ListSupportedResourceTypesCommandInput
124126
| ListTagsForResourceCommandInput
125127
| ListViewsCommandInput
@@ -146,6 +148,7 @@ export type ServiceOutputTypes =
146148
| GetViewCommandOutput
147149
| ListIndexesCommandOutput
148150
| ListIndexesForMembersCommandOutput
151+
| ListResourcesCommandOutput
149152
| ListSupportedResourceTypesCommandOutput
150153
| ListTagsForResourceCommandOutput
151154
| ListViewsCommandOutput

clients/client-resource-explorer-2/src/commands/GetAccountLevelServiceConfigurationCommand.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ export interface GetAccountLevelServiceConfigurationCommandOutput
3939
/**
4040
* <p>Retrieves the status of your account's Amazon Web Services service access, and validates the service
4141
* linked role required to access the multi-account search feature. Only the management
42-
* account or a delegated administrator with service access enabled can invoke this API
43-
* call. </p>
42+
* account can invoke this API call. </p>
4443
* @example
4544
* Use a bare-bones client and the command you need to make an API call.
4645
* ```javascript
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { ListResourcesInput, ListResourcesInputFilterSensitiveLog, ListResourcesOutput } from "../models/models_0";
9+
import { de_ListResourcesCommand, se_ListResourcesCommand } from "../protocols/Aws_restJson1";
10+
import {
11+
ResourceExplorer2ClientResolvedConfig,
12+
ServiceInputTypes,
13+
ServiceOutputTypes,
14+
} from "../ResourceExplorer2Client";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link ListResourcesCommand}.
25+
*/
26+
export interface ListResourcesCommandInput extends ListResourcesInput {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link ListResourcesCommand}.
31+
*/
32+
export interface ListResourcesCommandOutput extends ListResourcesOutput, __MetadataBearer {}
33+
34+
/**
35+
* <p>Returns a list of resources and their details that match the specified criteria. This query must
36+
* use a view. If you don’t explicitly specify a view, then Resource Explorer uses the default view for the Amazon Web Services Region
37+
* in which you call this operation. </p>
38+
* @example
39+
* Use a bare-bones client and the command you need to make an API call.
40+
* ```javascript
41+
* import { ResourceExplorer2Client, ListResourcesCommand } from "@aws-sdk/client-resource-explorer-2"; // ES Modules import
42+
* // const { ResourceExplorer2Client, ListResourcesCommand } = require("@aws-sdk/client-resource-explorer-2"); // CommonJS import
43+
* const client = new ResourceExplorer2Client(config);
44+
* const input = { // ListResourcesInput
45+
* Filters: { // SearchFilter
46+
* FilterString: "STRING_VALUE", // required
47+
* },
48+
* MaxResults: Number("int"),
49+
* ViewArn: "STRING_VALUE",
50+
* NextToken: "STRING_VALUE",
51+
* };
52+
* const command = new ListResourcesCommand(input);
53+
* const response = await client.send(command);
54+
* // { // ListResourcesOutput
55+
* // Resources: [ // ResourceList
56+
* // { // Resource
57+
* // Arn: "STRING_VALUE",
58+
* // OwningAccountId: "STRING_VALUE",
59+
* // Region: "STRING_VALUE",
60+
* // ResourceType: "STRING_VALUE",
61+
* // Service: "STRING_VALUE",
62+
* // LastReportedAt: new Date("TIMESTAMP"),
63+
* // Properties: [ // ResourcePropertyList
64+
* // { // ResourceProperty
65+
* // Name: "STRING_VALUE",
66+
* // LastReportedAt: new Date("TIMESTAMP"),
67+
* // Data: "DOCUMENT_VALUE",
68+
* // },
69+
* // ],
70+
* // },
71+
* // ],
72+
* // NextToken: "STRING_VALUE",
73+
* // ViewArn: "STRING_VALUE",
74+
* // };
75+
*
76+
* ```
77+
*
78+
* @param ListResourcesCommandInput - {@link ListResourcesCommandInput}
79+
* @returns {@link ListResourcesCommandOutput}
80+
* @see {@link ListResourcesCommandInput} for command's `input` shape.
81+
* @see {@link ListResourcesCommandOutput} for command's `response` shape.
82+
* @see {@link ResourceExplorer2ClientResolvedConfig | config} for ResourceExplorer2Client's `config` shape.
83+
*
84+
* @throws {@link AccessDeniedException} (client fault)
85+
* <p>The credentials that you used to call this operation don't have the minimum required
86+
* permissions.</p>
87+
*
88+
* @throws {@link InternalServerException} (server fault)
89+
* <p>The request failed because of internal service error. Try your request again
90+
* later.</p>
91+
*
92+
* @throws {@link ResourceNotFoundException} (client fault)
93+
* <p>You specified a resource that doesn't exist. Check the ID or ARN that you used to
94+
* identity the resource, and try again.</p>
95+
*
96+
* @throws {@link ThrottlingException} (client fault)
97+
* <p>The request failed because you exceeded a rate limit for this operation. For more
98+
* information, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html">Quotas for
99+
* Resource Explorer</a>.</p>
100+
*
101+
* @throws {@link UnauthorizedException} (client fault)
102+
* <p>The principal making the request isn't permitted to perform the operation.</p>
103+
*
104+
* @throws {@link ValidationException} (client fault)
105+
* <p>You provided an invalid value for one of the operation's parameters. Check the syntax
106+
* for the operation, and try again.</p>
107+
*
108+
* @throws {@link ResourceExplorer2ServiceException}
109+
* <p>Base exception class for all service exceptions from ResourceExplorer2 service.</p>
110+
*
111+
* @public
112+
*/
113+
export class ListResourcesCommand extends $Command
114+
.classBuilder<
115+
ListResourcesCommandInput,
116+
ListResourcesCommandOutput,
117+
ResourceExplorer2ClientResolvedConfig,
118+
ServiceInputTypes,
119+
ServiceOutputTypes
120+
>()
121+
.ep(commonParams)
122+
.m(function (this: any, Command: any, cs: any, config: ResourceExplorer2ClientResolvedConfig, o: any) {
123+
return [
124+
getSerdePlugin(config, this.serialize, this.deserialize),
125+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
126+
];
127+
})
128+
.s("ResourceExplorer", "ListResources", {})
129+
.n("ResourceExplorer2Client", "ListResourcesCommand")
130+
.f(ListResourcesInputFilterSensitiveLog, void 0)
131+
.ser(se_ListResourcesCommand)
132+
.de(de_ListResourcesCommand)
133+
.build() {
134+
/** @internal type navigation helper, not in runtime. */
135+
protected declare static __types: {
136+
api: {
137+
input: ListResourcesInput;
138+
output: ListResourcesOutput;
139+
};
140+
sdk: {
141+
input: ListResourcesCommandInput;
142+
output: ListResourcesCommandOutput;
143+
};
144+
};
145+
}

clients/client-resource-explorer-2/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export * from "./GetIndexCommand";
1212
export * from "./GetViewCommand";
1313
export * from "./ListIndexesCommand";
1414
export * from "./ListIndexesForMembersCommand";
15+
export * from "./ListResourcesCommand";
1516
export * from "./ListSupportedResourceTypesCommand";
1617
export * from "./ListTagsForResourceCommand";
1718
export * from "./ListViewsCommand";

0 commit comments

Comments
 (0)