export type FileFormatSettingsCreateForm = {format: string, settings: {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined, type?: ('i18next_json' | 'nestjs_i18n') | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined} | {contentSegmentation?: boolean | undefined, srxStorageId?: number | undefined}}; export type CreateApiProjectsProjectIdFileFormatSettingsArgs = {projectId: number, body: FileFormatSettingsCreateForm}; export type CreateApiProjectsProjectIdFileFormatSettingsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add Project File Format Settings * * POST /projects/{projectId}/file-format-settings */ export const createApiProjectsProjectIdFileFormatSettings = async (args: CreateApiProjectsProjectIdFileFormatSettingsArgs, options?: CreateApiProjectsProjectIdFileFormatSettingsOptions) => { const {baseUrl = "https://api.crowdin.com/api/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.projectId))}/file-format-settings${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 };