export type CreateApiApiV10AppIdCatalogGroupsCatalogItemIdDuplicateArgs = {appId: string, catalogItemId: string}; export type CreateApiApiV10AppIdCatalogGroupsCatalogItemIdDuplicateOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Duplicate Catalog Group * * POST /api/v1.0/{appId}/catalog/groups/{catalogItemId}/duplicate */ export const createApiApiV10AppIdCatalogGroupsCatalogItemIdDuplicate = async (args: CreateApiApiV10AppIdCatalogGroupsCatalogItemIdDuplicateArgs, options?: CreateApiApiV10AppIdCatalogGroupsCatalogItemIdDuplicateOptions) => { const {baseUrl = "https://api.flipdish.co", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1.0/${encodeURIComponent(String(args.appId))}/catalog/groups/${encodeURIComponent(String(args.catalogItemId))}/duplicate${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 };