export type ItsRegistrationRequestMessage = {canonicalId?: string | undefined, canonicalPublicKey?: string | undefined, certificateProfileName?: string | undefined, endEntityProfileName?: string | undefined, caName?: string | undefined, region?: string | undefined, validityPeriod?: string | undefined, assuranceLevel?: string | undefined}; export type CreateApiEtsiV1EndentityRegisterItsArgs = {body: ItsRegistrationRequestMessage}; export type CreateApiEtsiV1EndentityRegisterItsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /etsi/v1/endentity/register-its */ export const createApiEtsiV1EndentityRegisterIts = async (args: CreateApiEtsiV1EndentityRegisterItsArgs, options: CreateApiEtsiV1EndentityRegisterItsOptions) => { 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/register-its${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };