export type CreateApiEtsiV1CertificateEcacertificateidValidateArgs = {ecacertificateid: string}; export type CreateApiEtsiV1CertificateEcacertificateidValidateOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /etsi/v1/certificate/{ecacertificateid}/validate */ export const createApiEtsiV1CertificateEcacertificateidValidate = async (args: CreateApiEtsiV1CertificateEcacertificateidValidateArgs, options: CreateApiEtsiV1CertificateEcacertificateidValidateOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/etsi/v1/certificate/${encodeURIComponent(String(args.ecacertificateid))}/validate${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) 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 };