/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { tenantsCreate } from "../funcs/tenantsCreate.js"; import { tenantsDelete } from "../funcs/tenantsDelete.js"; import { tenantsDeleteApiKey } from "../funcs/tenantsDeleteApiKey.js"; import { tenantsGet } from "../funcs/tenantsGet.js"; import { tenantsList } from "../funcs/tenantsList.js"; import { tenantsListApiKeys } from "../funcs/tenantsListApiKeys.js"; import { tenantsRotateApiKey } from "../funcs/tenantsRotateApiKey.js"; import { tenantsUpdate } from "../funcs/tenantsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Tenants extends ClientSDK { /** * List all tenants * * @remarks * Retrieves a list of all tenants in the system */ async list( request: operations.GetApiLeadScraperMicroserviceApiV1OrganizationTenantsOrganizationIdRequest, options?: RequestOptions, ): Promise< operations.GetApiLeadScraperMicroserviceApiV1OrganizationTenantsOrganizationIdResponseBody > { return unwrapAsync(tenantsList( this, request, options, )); } /** * Delete a tenant * * @remarks * Permanently deletes a tenant and all associated resources */ async delete( request: operations.DeleteApiLeadScraperMicroserviceApiV1OrganizationTenantsOrganizationIdTenantIdRequest, options?: RequestOptions, ): Promise< operations.DeleteApiLeadScraperMicroserviceApiV1OrganizationTenantsOrganizationIdTenantIdResponseBody > { return unwrapAsync(tenantsDelete( this, request, options, )); } /** * Update tenant details * * @remarks * Updates the configuration of a specific tenant */ async update( request: operations.PutApiLeadScraperMicroserviceApiV1OrganizationsTenantsRequestBody, options?: RequestOptions, ): Promise< operations.PutApiLeadScraperMicroserviceApiV1OrganizationsTenantsResponseBody > { return unwrapAsync(tenantsUpdate( this, request, options, )); } /** * List tenant API keys * * @remarks * Retrieves all API keys for a specific tenant */ async listApiKeys( request: operations.GetApiLeadScraperMicroserviceApiV1OrganizationsTenantsApiKeysListRequest, options?: RequestOptions, ): Promise< operations.GetApiLeadScraperMicroserviceApiV1OrganizationsTenantsApiKeysListResponseBody > { return unwrapAsync(tenantsListApiKeys( this, request, options, )); } /** * Rotate tenant API key * * @remarks * Rotates a tenant API key while maintaining its configuration */ async rotateApiKey( request: operations.PostApiLeadScraperMicroserviceApiV1OrganizationsTenantsApiKeysRotateRequestBody, options?: RequestOptions, ): Promise< operations.PostApiLeadScraperMicroserviceApiV1OrganizationsTenantsApiKeysRotateResponseBody > { return unwrapAsync(tenantsRotateApiKey( this, request, options, )); } /** * Delete tenant API key * * @remarks * Permanently deletes a tenant API key */ async deleteApiKey( request: operations.DeleteApiLeadScraperMicroserviceApiV1OrganizationsTenantsApiKeysKeyIdRequest, options?: RequestOptions, ): Promise< operations.DeleteApiLeadScraperMicroserviceApiV1OrganizationsTenantsApiKeysKeyIdResponseBody > { return unwrapAsync(tenantsDeleteApiKey( this, request, options, )); } /** * Get tenant details * * @remarks * Retrieves details of a specific tenant */ async get( request: operations.GetApiLeadScraperMicroserviceApiV1OrganizationsTenantsOrganizationIdTenantIdRequest, options?: RequestOptions, ): Promise< operations.GetApiLeadScraperMicroserviceApiV1OrganizationsTenantsOrganizationIdTenantIdResponseBody > { return unwrapAsync(tenantsGet( this, request, options, )); } /** * Create a new tenant * * @remarks * Creates a new tenant in the system */ async create( request: operations.PostApiLeadScraperMicroserviceApiV1OrganizationsOrganizationIdTenantsRequest, options?: RequestOptions, ): Promise< operations.PostApiLeadScraperMicroserviceApiV1OrganizationsOrganizationIdTenantsResponseBody > { return unwrapAsync(tenantsCreate( this, request, options, )); } }