export type UpdateApiApplicationsApplicationIdRoleConnectionsMetadataArgs = {'Content-Type'?: string | undefined, application_id: string}; export type UpdateApiApplicationsApplicationIdRoleConnectionsMetadataOptions = {baseUrl: string, apikeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * bulk overwrite application role connection metadata * * PUT /applications/{application_id}/role-connections/metadata */ export const updateApiApplicationsApplicationIdRoleConnectionsMetadata = async (args: UpdateApiApplicationsApplicationIdRoleConnectionsMetadataArgs, options: UpdateApiApplicationsApplicationIdRoleConnectionsMetadataOptions) => { const {baseUrl, fetch: fetchFn = fetch, apikeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (apikeyAuth !== undefined) headers.set('authorization', `apikey ${apikeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/applications/${encodeURIComponent(String(args.application_id))}/role-connections/metadata${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };