export type ApiKeyKey = string; export type CertificateKey = string; export type DeleteApiApiKeysApiKeyCertificatesCertificateKeyArgs = {apiKey: ApiKeyKey, certificateKey: CertificateKey}; export type DeleteApiApiKeysApiKeyCertificatesCertificateKeyOptions = {baseUrl?: string | undefined, ApiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Archive API Key certificate [EXPERIMENTAL] * * DELETE /apiKeys/{apiKey}/certificates/{certificateKey} * * Also accepts auth: BearerToken */ export const deleteApiApiKeysApiKeyCertificatesCertificateKey = async (args: DeleteApiApiKeysApiKeyCertificatesCertificateKeyArgs, options?: DeleteApiApiKeysApiKeyCertificatesCertificateKeyOptions) => { const {baseUrl = "https://eu-west-1.api.silverflow.com/v1", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${ApiKey.username}:${ApiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/apiKeys/${encodeURIComponent(String(args.apiKey))}/certificates/${encodeURIComponent(String(args.certificateKey))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };