export type EndEntityRevocationRestRequest = {reason_code?: number | undefined, delete?: false | undefined}; export type UpdateApiV1EndentityEndentityNameRevokeArgs = {endentity_name: string, body: EndEntityRevocationRestRequest}; export type UpdateApiV1EndentityEndentityNameRevokeOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Revokes all end entity certificates * * PUT /v1/endentity/{endentity_name}/revoke */ export const updateApiV1EndentityEndentityNameRevoke = async (args: UpdateApiV1EndentityEndentityNameRevokeArgs, options: UpdateApiV1EndentityEndentityNameRevokeOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/endentity/${encodeURIComponent(String(args.endentity_name))}/revoke${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 undefined };