/** This is spectacularly generated code by spectacular based on Qlik Cloud Services APIs */ import Auth from '../auth/auth.js'; import ListableResource from '../listable.js'; import type { Config } from '../types/types.js'; /** @param created - When the API key was created. @param createdByUser - The ID of the user who created the key. @param description - A description for the API key. @param expiry - When the API key will expire and no longer be a valid authentication token. @param id - The unique ID for the resource. @param lastUpdated - When the API key was last updated. @param status - The status of the API key. @param sub - The ID of the subject for the API key. @param subType - Type of the subject. @param tenantId - The tenant ID. @param auth - Auth object used to make requests */ export declare class ApiKey { auth: Auth; created?: string; createdByUser: string; description: string; expiry: string; id: string; lastUpdated?: string; status: 'active' | 'expired' | 'revoked' | string; sub: string; subType: 'user' | string; tenantId: string; [key: string]: any; constructor({ created, createdByUser, description, expiry, id, lastUpdated, status, sub, subType, tenantId, ...rest }: { created?: string; createdByUser: string; description: string; expiry: string; id: string; lastUpdated?: string; status: 'active' | 'expired' | 'revoked' | string; sub: string; subType: 'user' | string; tenantId: string; }, auth?: Auth); /** When the owner of the API key sends the request, the key will be removed. When a TenantAdmin sends the request, the key will be revoked. Deletes or revokes an API key. */ delete(): Promise; /** Updates an API key for a given ID. @param data - Properties that the user wants to update for the API key. */ patch(data: ApiKeysPatchSchema): Promise; } export type ApiKeyBody = { /** Text that describes the API key. */ description: string; /** The expiry of the API key, in ISO8601 duration format. */ expiry?: string; /** The ID of the subject for the API key. */ sub?: string; /** Type of the subject. */ subType?: string; [key: string]: any; }; export type ApiKeyConfigPatch = { /** The operation to be performed. */ op: 'replace' | string; /** The path for the given resource field to patch. */ path: '/api_keys_enabled' | '/max_api_key_expiry' | '/max_keys_per_user' | string; /** The value to be used for this operation. */ value: any; [key: string]: any; }; export type ApiKeyPatch = { /** The operation to be performed. */ op: 'replace' | string; /** The path for the given resource field to patch. */ path: '/description' | string; /** The value to be used for this operation. */ value: string; [key: string]: any; }; export type ApiKeysConfig = { /** Enables or disables API key functionality for the specified tenant. */ api_keys_enabled?: boolean; /** The maximum lifetime, in ISO8601 duration format, for which an API key can be issued for the specified tenant. @defaultValue "PT24H" */ max_api_key_expiry?: string; /** The maximum number of active API keys that any user can create for the specified tenant. @defaultValue 5 */ max_keys_per_user?: number; /** The expiry of the scim externalClient token in ISO8601 duration format. Used during the creation of an externalClient API key. @defaultValue "P365D" */ scim_externalClient_expiry?: string; [key: string]: any; }; export type ApiKeysConfigPatchSchema = Array; export type ApiKeysPatchSchema = Array; export type ApiKeyWithToken = { /** When the API key was created. */ created?: string; /** The id of the user who created the key. */ createdByUser: string; /** A description for the API key. */ description: string; /** When the API key will expire and no longer be a valid authentication token. */ expiry: string; /** The unique ID for the resource. */ id: string; /** When the API key was last updated. */ lastUpdated?: string; /** The status of the API key. */ status: 'active' | 'expired' | 'revoked' | string; /** The ID of the subject for the API key. */ sub: string; /** Type of the subject. */ subType: 'user' | string; /** The tenant ID. */ tenantId: string; /** The generated signed JWT. */ token: string; [key: string]: any; }; export declare class ApiKeys { auth: Auth; config: Config; constructor(config: Config | Auth); /** Gets the API keys configuration for a given tenant ID. @param tenantId - The tenant ID of the API keys configuration to be retrieved. */ getConfig(tenantId: string): Promise; /** Updates the API keys configuration for a given tenant ID. @param tenantId - The tenant ID of the API keys configuration to be retrieved. @param data - Configurations that the user wants to update for API keys. */ patchConfig(tenantId: string, data: ApiKeysConfigPatchSchema): Promise; /** Gets the API key for a given ID. @param id - The ID of the API key resource to be retrieved. */ get(id: string): Promise; /** Lists API keys for a given tenant ID. @param createdByUser - The user ID that created the API key. @param endingBefore - Get resources with IDs that are lower than the target resource ID. Cannot be used in conjunction with startingAfter. @param limit - Maximum number of API keys to retrieve. @param sort - The field to sort by, with +/- prefix indicating sort order @param startingAfter - Get resources with IDs that are higher than the target resource ID. Cannot be used in conjunction with endingBefore. @param status - The status of the API key. @param sub - The ID of the subject. */ getApiKeys(queryParams?: { createdByUser?: string; endingBefore?: string; limit?: number; sort?: 'createdByUser' | '+createdByUser' | '-createdByUser' | 'sub' | '+sub' | '-sub' | 'status' | '+status' | '-status' | 'description' | '+description' | '-description' | 'created' | '+created' | '-created'; startingAfter?: string; status?: 'active' | 'expired' | 'revoked'; sub?: string; }): Promise>; /** Creates an API key resource. @param data - Properties that the user wants to set for the API key. */ create(data: ApiKeyBody): Promise; }