export type CreateApiV2DistributorsAccountsIdPartnerAccessTokenArgs = {id: string}; export type CreateApiV2DistributorsAccountsIdPartnerAccessTokenOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v2/distributors/accounts/{id}/partner-access-token */ export const createApiV2DistributorsAccountsIdPartnerAccessToken = async (args: CreateApiV2DistributorsAccountsIdPartnerAccessTokenArgs, options?: CreateApiV2DistributorsAccountsIdPartnerAccessTokenOptions) => { const {baseUrl = "https://api.cloudally.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v2/distributors/accounts/${encodeURIComponent(String(args.id))}/partner-access-token${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 res.blob() };