export type EndEntityRevocationRestRequest = {reason_code?: number | undefined, delete?: false | undefined}; export type UpdateApiEtsiV1EndentityItsNameRevokeArgs = {its_name: string, body: EndEntityRevocationRestRequest}; export type UpdateApiEtsiV1EndentityItsNameRevokeOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /etsi/v1/endentity/{its_name}/revoke */ export const updateApiEtsiV1EndentityItsNameRevoke = async (args: UpdateApiEtsiV1EndentityItsNameRevokeArgs, options: UpdateApiEtsiV1EndentityItsNameRevokeOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/etsi/v1/endentity/${encodeURIComponent(String(args.its_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 (await res.json()) as unknown };