export type CreateApiV2CustomersCustomerIdDomainsDomainTransferOutRejectArgs = {'X-Request-Id'?: string | undefined, customerId: string, domain: string, reason?: ('EVIDENCE_OF_FRAUD' | 'URDP_ACTION' | 'COURT_ORDER' | 'DISPUTE_OVER_IDENTITY' | 'NO_PAYMENT_FOR_PREVIOUS_REGISTRATION_PERIOD' | 'WRITTEN_OBJECTION' | 'TRANSFERRED_WITHIN_SIXTY_DAYS') | undefined}; export type CreateApiV2CustomersCustomerIdDomainsDomainTransferOutRejectOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Reject transfer out * * POST /v2/customers/{customerId}/domains/{domain}/transferOutReject */ export const createApiV2CustomersCustomerIdDomainsDomainTransferOutReject = async (args: CreateApiV2CustomersCustomerIdDomainsDomainTransferOutRejectArgs, options: CreateApiV2CustomersCustomerIdDomainsDomainTransferOutRejectOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Request-Id'] != null) headers.set("X-Request-Id", String(args['X-Request-Id'])) if (args.reason != null) query.append("reason", String(args.reason)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/customers/${encodeURIComponent(String(args.customerId))}/domains/${encodeURIComponent(String(args.domain))}/transferOutReject${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 undefined };