export type DeleteApiV1GatewayEndpointsEndpointIdArgs = {endpoint_id: string}; export type DeleteApiV1GatewayEndpointsEndpointIdOptions = {baseUrl: string, OAuth2AuthorizationCodeBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Gateway Endpoint * * DELETE /v1/gateway/endpoints/{endpoint_id}/ */ export const deleteApiV1GatewayEndpointsEndpointId = async (args: DeleteApiV1GatewayEndpointsEndpointIdArgs, options: DeleteApiV1GatewayEndpointsEndpointIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth2AuthorizationCodeBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2AuthorizationCodeBearer !== undefined) headers.set('authorization', `Bearer ${OAuth2AuthorizationCodeBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/gateway/endpoints/${encodeURIComponent(String(args.endpoint_id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };