import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CodeartifactClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CodeartifactClient"; import type { GetAuthorizationTokenRequest, GetAuthorizationTokenResult } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link GetAuthorizationTokenCommand}. */ export interface GetAuthorizationTokenCommandInput extends GetAuthorizationTokenRequest { } /** * @public * * The output of {@link GetAuthorizationTokenCommand}. */ export interface GetAuthorizationTokenCommandOutput extends GetAuthorizationTokenResult, __MetadataBearer { } declare const GetAuthorizationTokenCommand_base: { new (input: GetAuthorizationTokenCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: GetAuthorizationTokenCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

* Generates a temporary authorization token for accessing repositories in the domain. * This API requires the codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken permissions. * For more information about authorization tokens, see * CodeArtifact authentication and tokens. *

* *

CodeArtifact authorization tokens are valid for a period of 12 hours when created with the login command. * You can call login periodically to refresh the token. When * you create an authorization token with the GetAuthorizationToken API, you can set a custom authorization period, * up to a maximum of 12 hours, with the durationSeconds parameter.

*

The authorization period begins after login * or GetAuthorizationToken is called. If login or GetAuthorizationToken is called while * assuming a role, the token lifetime is independent of the maximum session duration * of the role. For example, if you call sts assume-role and specify a session duration of 15 minutes, then * generate a CodeArtifact authorization token, the token will be valid for the full authorization period * even though this is longer than the 15-minute session duration.

*

See * Using IAM Roles * for more information on controlling session duration.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { CodeartifactClient, GetAuthorizationTokenCommand } from "@aws-sdk/client-codeartifact"; // ES Modules import * // const { CodeartifactClient, GetAuthorizationTokenCommand } = require("@aws-sdk/client-codeartifact"); // CommonJS import * // import type { CodeartifactClientConfig } from "@aws-sdk/client-codeartifact"; * const config = {}; // type is CodeartifactClientConfig * const client = new CodeartifactClient(config); * const input = { // GetAuthorizationTokenRequest * domain: "STRING_VALUE", // required * domainOwner: "STRING_VALUE", * durationSeconds: Number("long"), * }; * const command = new GetAuthorizationTokenCommand(input); * const response = await client.send(command); * // { // GetAuthorizationTokenResult * // authorizationToken: "STRING_VALUE", * // expiration: new Date("TIMESTAMP"), * // }; * * ``` * * @param GetAuthorizationTokenCommandInput - {@link GetAuthorizationTokenCommandInput} * @returns {@link GetAuthorizationTokenCommandOutput} * @see {@link GetAuthorizationTokenCommandInput} for command's `input` shape. * @see {@link GetAuthorizationTokenCommandOutput} for command's `response` shape. * @see {@link CodeartifactClientResolvedConfig | config} for CodeartifactClient's `config` shape. * * @throws {@link AccessDeniedException} (client fault) *

* The operation did not succeed because of an unauthorized access attempt. *

* * @throws {@link InternalServerException} (server fault) *

The operation did not succeed because of an error that occurred inside CodeArtifact.

* * @throws {@link ResourceNotFoundException} (client fault) *

* The operation did not succeed because the resource requested is not found in the service. *

* * @throws {@link ThrottlingException} (client fault) *

* The operation did not succeed because too many requests are sent to the service. *

* * @throws {@link ValidationException} (client fault) *

* The operation did not succeed because a parameter in the request was sent with an invalid value. *

* * @throws {@link CodeartifactServiceException} *

Base exception class for all service exceptions from Codeartifact service.

* * * @public */ export declare class GetAuthorizationTokenCommand extends GetAuthorizationTokenCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: GetAuthorizationTokenRequest; output: GetAuthorizationTokenResult; }; sdk: { input: GetAuthorizationTokenCommandInput; output: GetAuthorizationTokenCommandOutput; }; }; }