export type PatchApiApiV2CompaniesIdRiskexposureArgs = {id: number, body: {NoOf_PII_PHI_PCI_Records?: (number | null) | undefined, UnitCostOf_PII_PHI_PCI_Records?: (number | null) | undefined, UnitCostOf_BlackKiteCalculation?: boolean | undefined, NoOfNon_PII_PHI_PCI_Records?: (number | null) | undefined, UnitCostOfNon_PII_PHI_PCI_Records?: (number | null) | undefined, HaveInternalAccess?: boolean | undefined, TimeToIdentifyAndContainInHours?: (number | null) | undefined, SimulationType?: ('Availability' | 'Confidentiality') | undefined}}; export type PatchApiApiV2CompaniesIdRiskexposureOptions = {baseUrl?: string | undefined, OAuthv2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates a monitored company's risk exposure. * * PATCH /api/v2/companies/{id}/riskexposure */ export const patchApiApiV2CompaniesIdRiskexposure = async (args: PatchApiApiV2CompaniesIdRiskexposureArgs, options?: PatchApiApiV2CompaniesIdRiskexposureOptions) => { const {baseUrl = "https://app.blackkitetech.com", fetch: fetchFn = fetch, OAuthv2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") if (OAuthv2 !== undefined) headers.set('authorization', `Bearer ${OAuthv2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/companies/${encodeURIComponent(String(args.id))}/riskexposure${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 res.text() };