export type UpdateApiAccountV2UsersUserUuidMembershipsCompanyUuidCurrentArgs = {companyUuid: string, userUuid: string}; export type UpdateApiAccountV2UsersUserUuidMembershipsCompanyUuidCurrentOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update last used company membership * * PUT /account/v2/users/{userUuid}/memberships/{companyUuid}/current */ export const updateApiAccountV2UsersUserUuidMembershipsCompanyUuidCurrent = async (args: UpdateApiAccountV2UsersUserUuidMembershipsCompanyUuidCurrentArgs, options?: UpdateApiAccountV2UsersUserUuidMembershipsCompanyUuidCurrentOptions) => { const {baseUrl = "https://marketplace.appdirect.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/account/v2/users/${encodeURIComponent(String(args.userUuid))}/memberships/${encodeURIComponent(String(args.companyUuid))}/current${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 undefined };