export type UpdateMemberPermissionsRequest = {permissionGroupIds?: (Array | null) | undefined, isAdmin?: (boolean | null) | undefined, isBillingManager?: (boolean | null) | undefined, removeFromPermissionGroupsWhereIdNotSet?: boolean | undefined}; export type CreateApiV1OrganizationsOrganizationIdMembersUserIdArgs = {organizationId: string, userId: string, body: UpdateMemberPermissionsRequest}; export type CreateApiV1OrganizationsOrganizationIdMembersUserIdOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Update Member Permissions * * POST /v1/organizations/{organizationId}/members/{userId} */ export const createApiV1OrganizationsOrganizationIdMembersUserId = async (args: CreateApiV1OrganizationsOrganizationIdMembersUserIdArgs, options?: CreateApiV1OrganizationsOrganizationIdMembersUserIdOptions) => { const {baseUrl = "https://api.configcat.com", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/organizations/${encodeURIComponent(String(args.organizationId))}/members/${encodeURIComponent(String(args.userId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };