export type PatchApiV2CertificateAuthorityRetireTenantIssuerArgs = {body: Record}; export type PatchApiV2CertificateAuthorityRetireTenantIssuerOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retire the intermediate tenant certificate * * PATCH /v2/CertificateAuthority/RetireTenantIssuer */ export const patchApiV2CertificateAuthorityRetireTenantIssuer = async (args: PatchApiV2CertificateAuthorityRetireTenantIssuerArgs, options?: PatchApiV2CertificateAuthorityRetireTenantIssuerOptions) => { const {baseUrl = "https://api.byndid.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/CertificateAuthority/RetireTenantIssuer${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };