export type OrganizationUpdateRequest = {name: string, organization_type_id: number, product_id: number, mfa_enabled?: boolean | undefined, contract_status_id?: number | undefined, representative_id: number, representative_type: 'brand' | 'property' | 'agency', representatives: Array<{representative_id: number, representative_type: 'brand' | 'property' | 'agency', is_main: 0 | 1}>, users?: Array | undefined, teams?: Array | undefined, agencies?: Array | undefined, companies?: Array | undefined, market_access?: string | undefined, property_type_access?: string | undefined, organization_limit_access_type_id?: (number | null) | undefined, subcategory_access?: string | undefined}; export type UpdateApiApiOrganizationIdArgs = {id: number, body: OrganizationUpdateRequest}; export type UpdateApiApiOrganizationIdOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update organization * * PUT /api/organization/{id} */ export const updateApiApiOrganizationId = async (args: UpdateApiApiOrganizationIdArgs, options: UpdateApiApiOrganizationIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/organization/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };