import { SSOClient } from "./SSOClient";
import {
GetRoleCredentialsCommand,
GetRoleCredentialsCommandInput,
GetRoleCredentialsCommandOutput,
} from "./commands/GetRoleCredentialsCommand";
import {
ListAccountRolesCommand,
ListAccountRolesCommandInput,
ListAccountRolesCommandOutput,
} from "./commands/ListAccountRolesCommand";
import {
ListAccountsCommand,
ListAccountsCommandInput,
ListAccountsCommandOutput,
} from "./commands/ListAccountsCommand";
import { LogoutCommand, LogoutCommandInput, LogoutCommandOutput } from "./commands/LogoutCommand";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
/**
*
AWS Single Sign-On Portal is a web service that makes it easy for you to assign user
* access to AWS SSO resources such as the user portal. Users can get AWS account applications
* and roles assigned to them and get federated into the application.
*
* For general information about AWS SSO, see What is AWS
* Single Sign-On? in the AWS SSO User Guide.
*
* This API reference guide describes the AWS SSO Portal operations that you can call
* programatically and includes detailed information on data types and errors.
*
*
* AWS provides SDKs that consist of libraries and sample code for various programming
* languages and platforms, such as Java, Ruby, .Net, iOS, or Android. The SDKs provide a
* convenient way to create programmatic access to AWS SSO and other AWS services. For more
* information about the AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.
*
*/
export class SSO extends SSOClient {
/**
* Returns the STS short-term credentials for a given role name that is assigned to the
* user.
*/
public getRoleCredentials(
args: GetRoleCredentialsCommandInput,
options?: __HttpHandlerOptions
): Promise;
public getRoleCredentials(
args: GetRoleCredentialsCommandInput,
cb: (err: any, data?: GetRoleCredentialsCommandOutput) => void
): void;
public getRoleCredentials(
args: GetRoleCredentialsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetRoleCredentialsCommandOutput) => void
): void;
public getRoleCredentials(
args: GetRoleCredentialsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetRoleCredentialsCommandOutput) => void),
cb?: (err: any, data?: GetRoleCredentialsCommandOutput) => void
): Promise | void {
const command = new GetRoleCredentialsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* Lists all roles that are assigned to the user for a given AWS account.
*/
public listAccountRoles(
args: ListAccountRolesCommandInput,
options?: __HttpHandlerOptions
): Promise;
public listAccountRoles(
args: ListAccountRolesCommandInput,
cb: (err: any, data?: ListAccountRolesCommandOutput) => void
): void;
public listAccountRoles(
args: ListAccountRolesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAccountRolesCommandOutput) => void
): void;
public listAccountRoles(
args: ListAccountRolesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAccountRolesCommandOutput) => void),
cb?: (err: any, data?: ListAccountRolesCommandOutput) => void
): Promise | void {
const command = new ListAccountRolesCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the
* administrator of the account. For more information, see Assign User Access in the AWS SSO User Guide. This operation
* returns a paginated response.
*/
public listAccounts(
args: ListAccountsCommandInput,
options?: __HttpHandlerOptions
): Promise;
public listAccounts(args: ListAccountsCommandInput, cb: (err: any, data?: ListAccountsCommandOutput) => void): void;
public listAccounts(
args: ListAccountsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAccountsCommandOutput) => void
): void;
public listAccounts(
args: ListAccountsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAccountsCommandOutput) => void),
cb?: (err: any, data?: ListAccountsCommandOutput) => void
): Promise | void {
const command = new ListAccountsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* Removes the client- and server-side session that is associated with the user.
*/
public logout(args: LogoutCommandInput, options?: __HttpHandlerOptions): Promise;
public logout(args: LogoutCommandInput, cb: (err: any, data?: LogoutCommandOutput) => void): void;
public logout(
args: LogoutCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: LogoutCommandOutput) => void
): void;
public logout(
args: LogoutCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: LogoutCommandOutput) => void),
cb?: (err: any, data?: LogoutCommandOutput) => void
): Promise | void {
const command = new LogoutCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
}