export type EndpointMtlsConfigIn = {identity: string}; export type UpdateApiApiV1AppAppIdEndpointEndpointIdMtlsArgs = {app_id: string, endpoint_id: string, body: EndpointMtlsConfigIn}; export type UpdateApiApiV1AppAppIdEndpointEndpointIdMtlsOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set Endpoint Mtls Config * * PUT /api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls */ export const updateApiApiV1AppAppIdEndpointEndpointIdMtls = async (args: UpdateApiApiV1AppAppIdEndpointEndpointIdMtlsArgs, options?: UpdateApiApiV1AppAppIdEndpointEndpointIdMtlsOptions) => { const {baseUrl = "https://api.eu.svix.com", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/app/${encodeURIComponent(String(args.app_id))}/endpoint/${encodeURIComponent(String(args.endpoint_id))}/mtls${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 };