export type ErrorDetails = {errorCode?: string | undefined, message?: string | undefined}; export type Jurisdiction = {allowSystemCreatedSeal?: string | undefined, allowUserUploadedSeal?: string | undefined, commissionIdInSeal?: string | undefined, county?: string | undefined, countyInSeal?: string | undefined, enabled?: string | undefined, jurisdictionId?: string | undefined, name?: string | undefined, notaryPublicInSeal?: string | undefined, stateNameInSeal?: string | undefined}; export type NotaryJurisdiction = {commissionExpiration?: string | undefined, commissionId?: string | undefined, county?: string | undefined, errorDetails?: ErrorDetails | undefined, jurisdiction?: Jurisdiction | undefined, registeredName?: string | undefined, sealType?: string | undefined}; export type CreateApiV21CurrentUserNotaryJurisdictionsArgs = {body: NotaryJurisdiction}; export type CreateApiV21CurrentUserNotaryJurisdictionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates a jurisdiction object. * * POST /v2.1/current_user/notary/jurisdictions */ export const createApiV21CurrentUserNotaryJurisdictions = async (args: CreateApiV21CurrentUserNotaryJurisdictionsArgs, options?: CreateApiV21CurrentUserNotaryJurisdictionsOptions) => { const {baseUrl = "https://www.docusign.net/restapi", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v2.1/current_user/notary/jurisdictions${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 res.blob() };