|
| 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 | +} |
0 commit comments