Skip to content

Commit ef24039

Browse files
author
awstools
committed
feat(client-iot): This release add new api listRelatedResourcesForAuditFinding and new member type IssuerCertificates for Iot device device defender Audit.
1 parent de55f7e commit ef24039

File tree

13 files changed

+900
-301
lines changed

13 files changed

+900
-301
lines changed

clients/client-iot/src/IoT.ts

Lines changed: 78 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,11 @@ import {
795795
ListProvisioningTemplateVersionsCommandInput,
796796
ListProvisioningTemplateVersionsCommandOutput,
797797
} from "./commands/ListProvisioningTemplateVersionsCommand";
798+
import {
799+
ListRelatedResourcesForAuditFindingCommand,
800+
ListRelatedResourcesForAuditFindingCommandInput,
801+
ListRelatedResourcesForAuditFindingCommandOutput,
802+
} from "./commands/ListRelatedResourcesForAuditFindingCommand";
798803
import {
799804
ListRoleAliasesCommand,
800805
ListRoleAliasesCommandInput,
@@ -6766,6 +6771,74 @@ export class IoT extends IoTClient {
67666771
}
67676772
}
67686773

6774+
/**
6775+
* <p>The related resources of an Audit finding.
6776+
* The following resources can be returned from calling this API:</p>
6777+
* <ul>
6778+
* <li>
6779+
* <p>DEVICE_CERTIFICATE</p>
6780+
* </li>
6781+
* <li>
6782+
* <p>CA_CERTIFICATE</p>
6783+
* </li>
6784+
* <li>
6785+
* <p>IOT_POLICY</p>
6786+
* </li>
6787+
* <li>
6788+
* <p>COGNITO_IDENTITY_POOL</p>
6789+
* </li>
6790+
* <li>
6791+
* <p>CLIENT_ID</p>
6792+
* </li>
6793+
* <li>
6794+
* <p>ACCOUNT_SETTINGS</p>
6795+
* </li>
6796+
* <li>
6797+
* <p>ROLE_ALIAS</p>
6798+
* </li>
6799+
* <li>
6800+
* <p>IAM_ROLE</p>
6801+
* </li>
6802+
* <li>
6803+
* <p>ISSUER_CERTIFICATE</p>
6804+
* </li>
6805+
* </ul>
6806+
* <note>
6807+
* <p>This API is similar to DescribeAuditFinding's <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html">RelatedResources</a>
6808+
* but provides pagination and is not limited to 10 resources.
6809+
* When calling <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html">DescribeAuditFinding</a> for the intermediate CA revoked for
6810+
* active device certificates check, RelatedResources will not be populated. You must use this API, ListRelatedResourcesForAuditFinding, to list the certificates.</p>
6811+
* </note>
6812+
*/
6813+
public listRelatedResourcesForAuditFinding(
6814+
args: ListRelatedResourcesForAuditFindingCommandInput,
6815+
options?: __HttpHandlerOptions
6816+
): Promise<ListRelatedResourcesForAuditFindingCommandOutput>;
6817+
public listRelatedResourcesForAuditFinding(
6818+
args: ListRelatedResourcesForAuditFindingCommandInput,
6819+
cb: (err: any, data?: ListRelatedResourcesForAuditFindingCommandOutput) => void
6820+
): void;
6821+
public listRelatedResourcesForAuditFinding(
6822+
args: ListRelatedResourcesForAuditFindingCommandInput,
6823+
options: __HttpHandlerOptions,
6824+
cb: (err: any, data?: ListRelatedResourcesForAuditFindingCommandOutput) => void
6825+
): void;
6826+
public listRelatedResourcesForAuditFinding(
6827+
args: ListRelatedResourcesForAuditFindingCommandInput,
6828+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListRelatedResourcesForAuditFindingCommandOutput) => void),
6829+
cb?: (err: any, data?: ListRelatedResourcesForAuditFindingCommandOutput) => void
6830+
): Promise<ListRelatedResourcesForAuditFindingCommandOutput> | void {
6831+
const command = new ListRelatedResourcesForAuditFindingCommand(args);
6832+
if (typeof optionsOrCb === "function") {
6833+
this.send(command, optionsOrCb);
6834+
} else if (typeof cb === "function") {
6835+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
6836+
this.send(command, optionsOrCb || {}, cb);
6837+
} else {
6838+
return this.send(command, optionsOrCb);
6839+
}
6840+
}
6841+
67696842
/**
67706843
* <p>Lists the role aliases registered in your account.</p>
67716844
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ListRoleAliases</a> action.</p>
@@ -7197,11 +7270,11 @@ export class IoT extends IoTClient {
71977270
}
71987271

71997272
/**
7200-
* <p>Lists your things. Use the <b>attributeName</b> and
7201-
* <b>attributeValue</b> parameters to filter your things.
7202-
* For example, calling <code>ListThings</code> with attributeName=Color and
7203-
* attributeValue=Red retrieves all things in the registry that contain an attribute
7204-
* <b>Color</b> with the value <b>Red</b>. </p>
7273+
* <p>Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters to filter your things. For example,
7274+
* calling <code>ListThings</code> with attributeName=Color and attributeValue=Red
7275+
* retrieves all things in the registry that contain an attribute <b>Color</b> with the value <b>Red</b>. For more
7276+
* information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html#list-things">List Things</a> from the <i>Amazon Web Services IoT Core Developer
7277+
* Guide</i>.</p>
72057278
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ListThings</a> action.</p>
72067279
*
72077280
* <note>

clients/client-iot/src/IoTClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,10 @@ import {
489489
ListProvisioningTemplateVersionsCommandInput,
490490
ListProvisioningTemplateVersionsCommandOutput,
491491
} from "./commands/ListProvisioningTemplateVersionsCommand";
492+
import {
493+
ListRelatedResourcesForAuditFindingCommandInput,
494+
ListRelatedResourcesForAuditFindingCommandOutput,
495+
} from "./commands/ListRelatedResourcesForAuditFindingCommand";
492496
import { ListRoleAliasesCommandInput, ListRoleAliasesCommandOutput } from "./commands/ListRoleAliasesCommand";
493497
import {
494498
ListScheduledAuditsCommandInput,
@@ -873,6 +877,7 @@ export type ServiceInputTypes =
873877
| ListPrincipalThingsCommandInput
874878
| ListProvisioningTemplateVersionsCommandInput
875879
| ListProvisioningTemplatesCommandInput
880+
| ListRelatedResourcesForAuditFindingCommandInput
876881
| ListRoleAliasesCommandInput
877882
| ListScheduledAuditsCommandInput
878883
| ListSecurityProfilesCommandInput
@@ -1112,6 +1117,7 @@ export type ServiceOutputTypes =
11121117
| ListPrincipalThingsCommandOutput
11131118
| ListProvisioningTemplateVersionsCommandOutput
11141119
| ListProvisioningTemplatesCommandOutput
1120+
| ListRelatedResourcesForAuditFindingCommandOutput
11151121
| ListRoleAliasesCommandOutput
11161122
| ListScheduledAuditsCommandOutput
11171123
| ListSecurityProfilesCommandOutput

clients/client-iot/src/commands/DeleteRegistrationCodeCommand.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ import {
1414
} from "@aws-sdk/types";
1515

1616
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
17-
import { DeleteRegistrationCodeRequest, DeleteRegistrationCodeRequestFilterSensitiveLog } from "../models/models_0";
18-
import { DeleteRegistrationCodeResponse, DeleteRegistrationCodeResponseFilterSensitiveLog } from "../models/models_1";
17+
import {
18+
DeleteRegistrationCodeRequest,
19+
DeleteRegistrationCodeRequestFilterSensitiveLog,
20+
DeleteRegistrationCodeResponse,
21+
DeleteRegistrationCodeResponseFilterSensitiveLog,
22+
} from "../models/models_1";
1923
import {
2024
deserializeAws_restJson1DeleteRegistrationCodeCommand,
2125
serializeAws_restJson1DeleteRegistrationCodeCommand,
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
17+
import {
18+
ListRelatedResourcesForAuditFindingRequest,
19+
ListRelatedResourcesForAuditFindingRequestFilterSensitiveLog,
20+
ListRelatedResourcesForAuditFindingResponse,
21+
ListRelatedResourcesForAuditFindingResponseFilterSensitiveLog,
22+
} from "../models/models_1";
23+
import {
24+
deserializeAws_restJson1ListRelatedResourcesForAuditFindingCommand,
25+
serializeAws_restJson1ListRelatedResourcesForAuditFindingCommand,
26+
} from "../protocols/Aws_restJson1";
27+
28+
export interface ListRelatedResourcesForAuditFindingCommandInput extends ListRelatedResourcesForAuditFindingRequest {}
29+
export interface ListRelatedResourcesForAuditFindingCommandOutput
30+
extends ListRelatedResourcesForAuditFindingResponse,
31+
__MetadataBearer {}
32+
33+
/**
34+
* <p>The related resources of an Audit finding.
35+
* The following resources can be returned from calling this API:</p>
36+
* <ul>
37+
* <li>
38+
* <p>DEVICE_CERTIFICATE</p>
39+
* </li>
40+
* <li>
41+
* <p>CA_CERTIFICATE</p>
42+
* </li>
43+
* <li>
44+
* <p>IOT_POLICY</p>
45+
* </li>
46+
* <li>
47+
* <p>COGNITO_IDENTITY_POOL</p>
48+
* </li>
49+
* <li>
50+
* <p>CLIENT_ID</p>
51+
* </li>
52+
* <li>
53+
* <p>ACCOUNT_SETTINGS</p>
54+
* </li>
55+
* <li>
56+
* <p>ROLE_ALIAS</p>
57+
* </li>
58+
* <li>
59+
* <p>IAM_ROLE</p>
60+
* </li>
61+
* <li>
62+
* <p>ISSUER_CERTIFICATE</p>
63+
* </li>
64+
* </ul>
65+
* <note>
66+
* <p>This API is similar to DescribeAuditFinding's <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html">RelatedResources</a>
67+
* but provides pagination and is not limited to 10 resources.
68+
* When calling <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeAuditFinding.html">DescribeAuditFinding</a> for the intermediate CA revoked for
69+
* active device certificates check, RelatedResources will not be populated. You must use this API, ListRelatedResourcesForAuditFinding, to list the certificates.</p>
70+
* </note>
71+
* @example
72+
* Use a bare-bones client and the command you need to make an API call.
73+
* ```javascript
74+
* import { IoTClient, ListRelatedResourcesForAuditFindingCommand } from "@aws-sdk/client-iot"; // ES Modules import
75+
* // const { IoTClient, ListRelatedResourcesForAuditFindingCommand } = require("@aws-sdk/client-iot"); // CommonJS import
76+
* const client = new IoTClient(config);
77+
* const command = new ListRelatedResourcesForAuditFindingCommand(input);
78+
* const response = await client.send(command);
79+
* ```
80+
*
81+
* @see {@link ListRelatedResourcesForAuditFindingCommandInput} for command's `input` shape.
82+
* @see {@link ListRelatedResourcesForAuditFindingCommandOutput} for command's `response` shape.
83+
* @see {@link IoTClientResolvedConfig | config} for IoTClient's `config` shape.
84+
*
85+
*/
86+
export class ListRelatedResourcesForAuditFindingCommand extends $Command<
87+
ListRelatedResourcesForAuditFindingCommandInput,
88+
ListRelatedResourcesForAuditFindingCommandOutput,
89+
IoTClientResolvedConfig
90+
> {
91+
// Start section: command_properties
92+
// End section: command_properties
93+
94+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
95+
return {
96+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
97+
Endpoint: { type: "builtInParams", name: "endpoint" },
98+
Region: { type: "builtInParams", name: "region" },
99+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
100+
};
101+
}
102+
103+
constructor(readonly input: ListRelatedResourcesForAuditFindingCommandInput) {
104+
// Start section: command_constructor
105+
super();
106+
// End section: command_constructor
107+
}
108+
109+
/**
110+
* @internal
111+
*/
112+
resolveMiddleware(
113+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
114+
configuration: IoTClientResolvedConfig,
115+
options?: __HttpHandlerOptions
116+
): Handler<ListRelatedResourcesForAuditFindingCommandInput, ListRelatedResourcesForAuditFindingCommandOutput> {
117+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
118+
this.middlewareStack.use(
119+
getEndpointPlugin(configuration, ListRelatedResourcesForAuditFindingCommand.getEndpointParameterInstructions())
120+
);
121+
122+
const stack = clientStack.concat(this.middlewareStack);
123+
124+
const { logger } = configuration;
125+
const clientName = "IoTClient";
126+
const commandName = "ListRelatedResourcesForAuditFindingCommand";
127+
const handlerExecutionContext: HandlerExecutionContext = {
128+
logger,
129+
clientName,
130+
commandName,
131+
inputFilterSensitiveLog: ListRelatedResourcesForAuditFindingRequestFilterSensitiveLog,
132+
outputFilterSensitiveLog: ListRelatedResourcesForAuditFindingResponseFilterSensitiveLog,
133+
};
134+
const { requestHandler } = configuration;
135+
return stack.resolve(
136+
(request: FinalizeHandlerArguments<any>) =>
137+
requestHandler.handle(request.request as __HttpRequest, options || {}),
138+
handlerExecutionContext
139+
);
140+
}
141+
142+
private serialize(
143+
input: ListRelatedResourcesForAuditFindingCommandInput,
144+
context: __SerdeContext
145+
): Promise<__HttpRequest> {
146+
return serializeAws_restJson1ListRelatedResourcesForAuditFindingCommand(input, context);
147+
}
148+
149+
private deserialize(
150+
output: __HttpResponse,
151+
context: __SerdeContext
152+
): Promise<ListRelatedResourcesForAuditFindingCommandOutput> {
153+
return deserializeAws_restJson1ListRelatedResourcesForAuditFindingCommand(output, context);
154+
}
155+
156+
// Start section: command_body_extra
157+
// End section: command_body_extra
158+
}

clients/client-iot/src/commands/ListTargetsForPolicyCommand.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ import {
1414
} from "@aws-sdk/types";
1515

1616
import { IoTClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTClient";
17-
import {
18-
ListTargetsForPolicyRequest,
19-
ListTargetsForPolicyRequestFilterSensitiveLog,
20-
ListTargetsForPolicyResponse,
21-
ListTargetsForPolicyResponseFilterSensitiveLog,
22-
} from "../models/models_1";
17+
import { ListTargetsForPolicyRequest, ListTargetsForPolicyRequestFilterSensitiveLog } from "../models/models_1";
18+
import { ListTargetsForPolicyResponse, ListTargetsForPolicyResponseFilterSensitiveLog } from "../models/models_2";
2319
import {
2420
deserializeAws_restJson1ListTargetsForPolicyCommand,
2521
serializeAws_restJson1ListTargetsForPolicyCommand,

clients/client-iot/src/commands/ListTargetsForSecurityProfileCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
ListTargetsForSecurityProfileRequestFilterSensitiveLog,
2020
ListTargetsForSecurityProfileResponse,
2121
ListTargetsForSecurityProfileResponseFilterSensitiveLog,
22-
} from "../models/models_1";
22+
} from "../models/models_2";
2323
import {
2424
deserializeAws_restJson1ListTargetsForSecurityProfileCommand,
2525
serializeAws_restJson1ListTargetsForSecurityProfileCommand,

clients/client-iot/src/commands/ListThingsCommand.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ export interface ListThingsCommandInput extends ListThingsRequest {}
2929
export interface ListThingsCommandOutput extends ListThingsResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Lists your things. Use the <b>attributeName</b> and
33-
* <b>attributeValue</b> parameters to filter your things.
34-
* For example, calling <code>ListThings</code> with attributeName=Color and
35-
* attributeValue=Red retrieves all things in the registry that contain an attribute
36-
* <b>Color</b> with the value <b>Red</b>. </p>
32+
* <p>Lists your things. Use the <b>attributeName</b> and <b>attributeValue</b> parameters to filter your things. For example,
33+
* calling <code>ListThings</code> with attributeName=Color and attributeValue=Red
34+
* retrieves all things in the registry that contain an attribute <b>Color</b> with the value <b>Red</b>. For more
35+
* information, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/thing-registry.html#list-things">List Things</a> from the <i>Amazon Web Services IoT Core Developer
36+
* Guide</i>.</p>
3737
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">ListThings</a> action.</p>
3838
*
3939
* <note>

clients/client-iot/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export * from "./ListPrincipalPoliciesCommand";
165165
export * from "./ListPrincipalThingsCommand";
166166
export * from "./ListProvisioningTemplateVersionsCommand";
167167
export * from "./ListProvisioningTemplatesCommand";
168+
export * from "./ListRelatedResourcesForAuditFindingCommand";
168169
export * from "./ListRoleAliasesCommand";
169170
export * from "./ListScheduledAuditsCommand";
170171
export * from "./ListSecurityProfilesCommand";

0 commit comments

Comments
 (0)