export type GetApiV21AccountsAccountIdEnvelopesTransferRulesArgs = {accountId: string, count?: string | undefined, start_position?: string | undefined}; export type GetApiV21AccountsAccountIdEnvelopesTransferRulesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets envelope transfer rules. * * GET /v2.1/accounts/{accountId}/envelopes/transfer_rules */ export const getApiV21AccountsAccountIdEnvelopesTransferRules = async (args: GetApiV21AccountsAccountIdEnvelopesTransferRulesArgs, options?: GetApiV21AccountsAccountIdEnvelopesTransferRulesOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.count != null) query.append("count", String(args.count)) if (args.start_position != null) query.append("start_position", String(args.start_position)) const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/accounts/${encodeURIComponent(String(args.accountId))}/envelopes/transfer_rules${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };