export type SurveyCountryRqst = {paisID?: number | undefined, listaAccounts?: (Array | null) | undefined, listaStores?: (Array | null) | undefined}; export type SurveyCountrysRqst = {surveyCountrys?: (Array | null) | undefined}; export type UpdateApiV1ApiSurveyAssignAudienceToSurveySurveyIdArgs = {surveyId: number, body: SurveyCountrysRqst}; export type UpdateApiV1ApiSurveyAssignAudienceToSurveySurveyIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/api/Survey/AssignAudienceToSurvey/{surveyId} */ export const updateApiV1ApiSurveyAssignAudienceToSurveySurveyId = async (args: UpdateApiV1ApiSurveyAssignAudienceToSurveySurveyIdArgs, options: UpdateApiV1ApiSurveyAssignAudienceToSurveySurveyIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/v1/api/Survey/AssignAudienceToSurvey/${encodeURIComponent(String(args.surveyId))}${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 };