Skip to content

Commit d21a546

Browse files
author
awstools
committed
feat(client-bedrock-agentcore): Updated InvokeAgentRuntime API to accept account id optionally and added CompleteResourceTokenAuth API.
1 parent d1cdea8 commit d21a546

File tree

10 files changed

+529
-7
lines changed

10 files changed

+529
-7
lines changed

clients/client-bedrock-agentcore/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ BatchUpdateMemoryRecords
226226

227227
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agentcore/command/BatchUpdateMemoryRecordsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agentcore/Interface/BatchUpdateMemoryRecordsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agentcore/Interface/BatchUpdateMemoryRecordsCommandOutput/)
228228

229+
</details>
230+
<details>
231+
<summary>
232+
CompleteResourceTokenAuth
233+
</summary>
234+
235+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-agentcore/command/CompleteResourceTokenAuthCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agentcore/Interface/CompleteResourceTokenAuthCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock-agentcore/Interface/CompleteResourceTokenAuthCommandOutput/)
236+
229237
</details>
230238
<details>
231239
<summary>

clients/client-bedrock-agentcore/src/BedrockAgentCore.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ import {
1818
BatchUpdateMemoryRecordsCommandInput,
1919
BatchUpdateMemoryRecordsCommandOutput,
2020
} from "./commands/BatchUpdateMemoryRecordsCommand";
21+
import {
22+
CompleteResourceTokenAuthCommand,
23+
CompleteResourceTokenAuthCommandInput,
24+
CompleteResourceTokenAuthCommandOutput,
25+
} from "./commands/CompleteResourceTokenAuthCommand";
2126
import { CreateEventCommand, CreateEventCommandInput, CreateEventCommandOutput } from "./commands/CreateEventCommand";
2227
import { DeleteEventCommand, DeleteEventCommandInput, DeleteEventCommandOutput } from "./commands/DeleteEventCommand";
2328
import {
@@ -143,6 +148,7 @@ const commands = {
143148
BatchCreateMemoryRecordsCommand,
144149
BatchDeleteMemoryRecordsCommand,
145150
BatchUpdateMemoryRecordsCommand,
151+
CompleteResourceTokenAuthCommand,
146152
CreateEventCommand,
147153
DeleteEventCommand,
148154
DeleteMemoryRecordCommand,
@@ -225,6 +231,23 @@ export interface BedrockAgentCore {
225231
cb: (err: any, data?: BatchUpdateMemoryRecordsCommandOutput) => void
226232
): void;
227233

234+
/**
235+
* @see {@link CompleteResourceTokenAuthCommand}
236+
*/
237+
completeResourceTokenAuth(
238+
args: CompleteResourceTokenAuthCommandInput,
239+
options?: __HttpHandlerOptions
240+
): Promise<CompleteResourceTokenAuthCommandOutput>;
241+
completeResourceTokenAuth(
242+
args: CompleteResourceTokenAuthCommandInput,
243+
cb: (err: any, data?: CompleteResourceTokenAuthCommandOutput) => void
244+
): void;
245+
completeResourceTokenAuth(
246+
args: CompleteResourceTokenAuthCommandInput,
247+
options: __HttpHandlerOptions,
248+
cb: (err: any, data?: CompleteResourceTokenAuthCommandOutput) => void
249+
): void;
250+
228251
/**
229252
* @see {@link CreateEventCommand}
230253
*/

clients/client-bedrock-agentcore/src/BedrockAgentCoreClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ import {
7272
BatchUpdateMemoryRecordsCommandInput,
7373
BatchUpdateMemoryRecordsCommandOutput,
7474
} from "./commands/BatchUpdateMemoryRecordsCommand";
75+
import {
76+
CompleteResourceTokenAuthCommandInput,
77+
CompleteResourceTokenAuthCommandOutput,
78+
} from "./commands/CompleteResourceTokenAuthCommand";
7579
import { CreateEventCommandInput, CreateEventCommandOutput } from "./commands/CreateEventCommand";
7680
import { DeleteEventCommandInput, DeleteEventCommandOutput } from "./commands/DeleteEventCommand";
7781
import { DeleteMemoryRecordCommandInput, DeleteMemoryRecordCommandOutput } from "./commands/DeleteMemoryRecordCommand";
@@ -157,6 +161,7 @@ export type ServiceInputTypes =
157161
| BatchCreateMemoryRecordsCommandInput
158162
| BatchDeleteMemoryRecordsCommandInput
159163
| BatchUpdateMemoryRecordsCommandInput
164+
| CompleteResourceTokenAuthCommandInput
160165
| CreateEventCommandInput
161166
| DeleteEventCommandInput
162167
| DeleteMemoryRecordCommandInput
@@ -193,6 +198,7 @@ export type ServiceOutputTypes =
193198
| BatchCreateMemoryRecordsCommandOutput
194199
| BatchDeleteMemoryRecordsCommandOutput
195200
| BatchUpdateMemoryRecordsCommandOutput
201+
| CompleteResourceTokenAuthCommandOutput
196202
| CreateEventCommandOutput
197203
| DeleteEventCommandOutput
198204
| DeleteMemoryRecordCommandOutput
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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 { BedrockAgentCoreClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockAgentCoreClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import {
10+
CompleteResourceTokenAuthRequest,
11+
CompleteResourceTokenAuthRequestFilterSensitiveLog,
12+
CompleteResourceTokenAuthResponse,
13+
} from "../models/models_0";
14+
import { de_CompleteResourceTokenAuthCommand, se_CompleteResourceTokenAuthCommand } from "../protocols/Aws_restJson1";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link CompleteResourceTokenAuthCommand}.
25+
*/
26+
export interface CompleteResourceTokenAuthCommandInput extends CompleteResourceTokenAuthRequest {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link CompleteResourceTokenAuthCommand}.
31+
*/
32+
export interface CompleteResourceTokenAuthCommandOutput extends CompleteResourceTokenAuthResponse, __MetadataBearer {}
33+
34+
/**
35+
* <p>Confirms the user authentication session for obtaining OAuth2.0 tokens for a resource.</p>
36+
* @example
37+
* Use a bare-bones client and the command you need to make an API call.
38+
* ```javascript
39+
* import { BedrockAgentCoreClient, CompleteResourceTokenAuthCommand } from "@aws-sdk/client-bedrock-agentcore"; // ES Modules import
40+
* // const { BedrockAgentCoreClient, CompleteResourceTokenAuthCommand } = require("@aws-sdk/client-bedrock-agentcore"); // CommonJS import
41+
* // import type { BedrockAgentCoreClientConfig } from "@aws-sdk/client-bedrock-agentcore";
42+
* const config = {}; // type is BedrockAgentCoreClientConfig
43+
* const client = new BedrockAgentCoreClient(config);
44+
* const input = { // CompleteResourceTokenAuthRequest
45+
* userIdentifier: { // UserIdentifier Union: only one key present
46+
* userToken: "STRING_VALUE",
47+
* userId: "STRING_VALUE",
48+
* },
49+
* sessionUri: "STRING_VALUE", // required
50+
* };
51+
* const command = new CompleteResourceTokenAuthCommand(input);
52+
* const response = await client.send(command);
53+
* // {};
54+
*
55+
* ```
56+
*
57+
* @param CompleteResourceTokenAuthCommandInput - {@link CompleteResourceTokenAuthCommandInput}
58+
* @returns {@link CompleteResourceTokenAuthCommandOutput}
59+
* @see {@link CompleteResourceTokenAuthCommandInput} for command's `input` shape.
60+
* @see {@link CompleteResourceTokenAuthCommandOutput} for command's `response` shape.
61+
* @see {@link BedrockAgentCoreClientResolvedConfig | config} for BedrockAgentCoreClient's `config` shape.
62+
*
63+
* @throws {@link AccessDeniedException} (client fault)
64+
* <p>The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.</p>
65+
*
66+
* @throws {@link InternalServerException} (server fault)
67+
* <p>The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.</p>
68+
*
69+
* @throws {@link ResourceNotFoundException} (client fault)
70+
* <p>The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.</p>
71+
*
72+
* @throws {@link ThrottlingException} (client fault)
73+
* <p>The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.</p>
74+
*
75+
* @throws {@link UnauthorizedException} (client fault)
76+
* <p>This exception is thrown when the JWT bearer token is invalid or not found for OAuth bearer token based access</p>
77+
*
78+
* @throws {@link ValidationException} (client fault)
79+
* <p>The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.</p>
80+
*
81+
* @throws {@link BedrockAgentCoreServiceException}
82+
* <p>Base exception class for all service exceptions from BedrockAgentCore service.</p>
83+
*
84+
*
85+
* @public
86+
*/
87+
export class CompleteResourceTokenAuthCommand extends $Command
88+
.classBuilder<
89+
CompleteResourceTokenAuthCommandInput,
90+
CompleteResourceTokenAuthCommandOutput,
91+
BedrockAgentCoreClientResolvedConfig,
92+
ServiceInputTypes,
93+
ServiceOutputTypes
94+
>()
95+
.ep(commonParams)
96+
.m(function (this: any, Command: any, cs: any, config: BedrockAgentCoreClientResolvedConfig, o: any) {
97+
return [
98+
getSerdePlugin(config, this.serialize, this.deserialize),
99+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
100+
];
101+
})
102+
.s("AmazonBedrockAgentCore", "CompleteResourceTokenAuth", {})
103+
.n("BedrockAgentCoreClient", "CompleteResourceTokenAuthCommand")
104+
.f(CompleteResourceTokenAuthRequestFilterSensitiveLog, void 0)
105+
.ser(se_CompleteResourceTokenAuthCommand)
106+
.de(de_CompleteResourceTokenAuthCommand)
107+
.build() {
108+
/** @internal type navigation helper, not in runtime. */
109+
protected declare static __types: {
110+
api: {
111+
input: CompleteResourceTokenAuthRequest;
112+
output: {};
113+
};
114+
sdk: {
115+
input: CompleteResourceTokenAuthCommandInput;
116+
output: CompleteResourceTokenAuthCommandOutput;
117+
};
118+
};
119+
}

clients/client-bedrock-agentcore/src/commands/GetResourceOauth2TokenCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,21 @@ export interface GetResourceOauth2TokenCommandOutput extends GetResourceOauth2To
4949
* "STRING_VALUE",
5050
* ],
5151
* oauth2Flow: "USER_FEDERATION" || "M2M", // required
52+
* sessionUri: "STRING_VALUE",
5253
* resourceOauth2ReturnUrl: "STRING_VALUE",
5354
* forceAuthentication: true || false,
5455
* customParameters: { // CustomRequestParametersType
5556
* "<keys>": "STRING_VALUE",
5657
* },
58+
* customState: "STRING_VALUE",
5759
* };
5860
* const command = new GetResourceOauth2TokenCommand(input);
5961
* const response = await client.send(command);
6062
* // { // GetResourceOauth2TokenResponse
6163
* // authorizationUrl: "STRING_VALUE",
6264
* // accessToken: "STRING_VALUE",
65+
* // sessionUri: "STRING_VALUE",
66+
* // sessionStatus: "IN_PROGRESS" || "FAILED",
6367
* // };
6468
*
6569
* ```

clients/client-bedrock-agentcore/src/commands/InvokeAgentRuntimeCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface InvokeAgentRuntimeCommandOutput
7070
* baggage: "STRING_VALUE",
7171
* agentRuntimeArn: "STRING_VALUE", // required
7272
* qualifier: "STRING_VALUE",
73+
* accountId: "STRING_VALUE",
7374
* payload: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
7475
* };
7576
* const command = new InvokeAgentRuntimeCommand(input);

clients/client-bedrock-agentcore/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
export * from "./BatchCreateMemoryRecordsCommand";
33
export * from "./BatchDeleteMemoryRecordsCommand";
44
export * from "./BatchUpdateMemoryRecordsCommand";
5+
export * from "./CompleteResourceTokenAuthCommand";
56
export * from "./CreateEventCommand";
67
export * from "./DeleteEventCommand";
78
export * from "./DeleteMemoryRecordCommand";

0 commit comments

Comments
 (0)