export type ItsEditRequestMessage = {region?: string | undefined, validityPeriod?: string | undefined, assuranceLevel?: string | undefined}; export type UpdateApiEtsiV1EndentityItsNameEditArgs = {its_name: string, body: ItsEditRequestMessage}; export type UpdateApiEtsiV1EndentityItsNameEditOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PUT /etsi/v1/endentity/{its_name}/edit */ export const updateApiEtsiV1EndentityItsNameEdit = async (args: UpdateApiEtsiV1EndentityItsNameEditArgs, options: UpdateApiEtsiV1EndentityItsNameEditOptions) => { 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))}/edit${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 };