export type CreateApiV1TrustCenterAccessRequestApprovedArgs = {body: {trustCenter: {slugId: string}, accessRequest: {id: string}, viewer: {id: string}}}; export type CreateApiV1TrustCenterAccessRequestApprovedOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Trust Center access request approved * * POST /v1.trust-center.access-request.approved */ export const createApiV1TrustCenterAccessRequestApproved = async (args: CreateApiV1TrustCenterAccessRequestApprovedArgs, options?: CreateApiV1TrustCenterAccessRequestApprovedOptions) => { 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.trust-center.access-request.approved${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 };