export type ServiceChannelServicesWebApiModelsRequestChecklistsChecklistResponsesUpdateAttachmentRequest = {ChecklistResponsePictureId?: number | undefined, DocumentName?: string | undefined, DocumentPath?: string | undefined}; export type ServiceChannelServicesWebApiModelsRequestChecklistsChecklistResponsesUpdateBulkChecklistResponseRequestItem = {OverrideAttachments?: boolean | undefined, Attachments?: Array | undefined, CheckListQuestionId: number, ChecklistQuestionOptionIds?: Array | undefined, CheckListQuestionOptionID: number, Answer?: string | undefined, FreeTextAnswer?: string | undefined, EntityId: number, EntityTypeId?: number | undefined, ProviderId?: number | undefined, Attempt?: number | undefined, TechnicianId?: number | undefined, AuthUserId?: number | undefined}; export type ServiceChannelServicesWebApiModelsRequestChecklistsChecklistResponsesUpdateBulkChecklistResponseRequest = {ChecklistResponseIds?: Array | undefined, ChecklistResponseRequest?: ServiceChannelServicesWebApiModelsRequestChecklistsChecklistResponsesUpdateBulkChecklistResponseRequestItem | undefined}; export type UpdateApiChecklistsChecklistResponseBulkArgs = {body: ServiceChannelServicesWebApiModelsRequestChecklistsChecklistResponsesUpdateBulkChecklistResponseRequest}; export type UpdateApiChecklistsChecklistResponseBulkOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a responses to a checklist question in bulk * * PUT /checklists/ChecklistResponse/bulk */ export const updateApiChecklistsChecklistResponseBulk = async (args: UpdateApiChecklistsChecklistResponseBulkArgs, options?: UpdateApiChecklistsChecklistResponseBulkOptions) => { const {baseUrl = "https://sb2api.servicechannel.com/v3", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/checklists/ChecklistResponse/bulk${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 };