export type CreateApiV1VendorDecisionCreatedArgs = {body: {vendor: {id: string, decision: {status: 'APPROVED' | 'CONDITIONALLY_APPROVED' | 'NOT_APPROVED', lastUpdatedAt: string, comments?: string | undefined}}}}; export type CreateApiV1VendorDecisionCreatedOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Vendor decision created * * POST /v1.vendor.decision.created */ export const createApiV1VendorDecisionCreated = async (args: CreateApiV1VendorDecisionCreatedArgs, options?: CreateApiV1VendorDecisionCreatedOptions) => { const {baseUrl = "https://api.vanta.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1.vendor.decision.created${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 };