export type DeleteApiPublicSelfServeV1ClusterClusterServiceAccountServiceAccountNameArgs = {cluster: string, 'service-account-name': string}; export type DeleteApiPublicSelfServeV1ClusterClusterServiceAccountServiceAccountNameOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a ServiceAccount * * DELETE /public/self-serve/v1/cluster/{cluster}/service-account/{service-account-name} */ export const deleteApiPublicSelfServeV1ClusterClusterServiceAccountServiceAccountName = async (args: DeleteApiPublicSelfServeV1ClusterClusterServiceAccountServiceAccountNameArgs, options: DeleteApiPublicSelfServeV1ClusterClusterServiceAccountServiceAccountNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/self-serve/v1/cluster/${encodeURIComponent(String(args.cluster))}/service-account/${encodeURIComponent(String(args['service-account-name']))}${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 };