export type CreateApiApiAtlasV2GroupsGroupIdStreamsVpcPeeringConnectionsIdRejectArgs = {envelope?: boolean | undefined, groupId: string, id: string}; export type CreateApiApiAtlasV2GroupsGroupIdStreamsVpcPeeringConnectionsIdRejectOptions = {baseUrl?: string | undefined, ServiceAccounts?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reject One Incoming VPC Peering Connection * * POST /api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:reject * * Also accepts auth: DigestAuth */ export const createApiApiAtlasV2GroupsGroupIdStreamsVpcPeeringConnectionsIdReject = async (args: CreateApiApiAtlasV2GroupsGroupIdStreamsVpcPeeringConnectionsIdRejectArgs, options?: CreateApiApiAtlasV2GroupsGroupIdStreamsVpcPeeringConnectionsIdRejectOptions) => { const {baseUrl = "https://cloud.mongodb.com", fetch: fetchFn = fetch, ServiceAccounts} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.atlas.2023-02-01+json") if (args.envelope != null) query.append("envelope", String(args.envelope)) if (ServiceAccounts !== undefined) headers.set('authorization', `Bearer ${ServiceAccounts}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/atlas/v2/groups/${encodeURIComponent(String(args.groupId))}/streams/vpcPeeringConnections/${encodeURIComponent(String(args.id))}:reject${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };