export type CreateApiConfigTenantLocatorDeploymentsCloneTestArgs = {tenantLocator: string, tenantName?: string | undefined, tenantDescription?: string | undefined}; export type CreateApiConfigTenantLocatorDeploymentsCloneTestOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /config/{tenantLocator}/deployments/cloneTest */ export const createApiConfigTenantLocatorDeploymentsCloneTest = async (args: CreateApiConfigTenantLocatorDeploymentsCloneTestArgs, options: CreateApiConfigTenantLocatorDeploymentsCloneTestOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.tenantName != null) query.append("tenantName", String(args.tenantName)) if (args.tenantDescription != null) query.append("tenantDescription", String(args.tenantDescription)) const url = `${baseUrl.replace(/\/+$/, '')}/config/${encodeURIComponent(String(args.tenantLocator))}/deployments/cloneTest${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() };