export type UpdateApiApiV1ShippingMethodsIdArgs = {id: string, body: {isActive?: boolean | undefined, name?: string | undefined, project?: ({id: string} | null) | undefined, carrier?: ({credentials?: ({basic: {username: string, password: string}} | {bearer: {token: string}} | {oauthClientCredentials: {tokenUrl: string, username: string, password: string, audience?: string | undefined}}) | undefined, serviceUrl?: string | undefined, id?: string | undefined, product?: ({id?: string | undefined}) | undefined, shipmentType?: ('outbound' | 'return') | undefined}) | undefined, printers?: ({label?: {id: string} | undefined, document?: {id: string} | undefined}) | undefined, parcel?: ({defaultDimensions?: ({length?: ({value?: number | undefined, unit?: 'cm' | undefined}) | undefined, width?: ({value?: number | undefined, unit?: 'cm' | undefined}) | undefined, height?: ({value?: number | undefined, unit?: 'cm' | undefined}) | undefined}) | undefined, minimumWeight?: ({value?: number | undefined, unit?: 'kg' | undefined}) | undefined}) | undefined, sender?: ({name?: string | undefined, address?: string | undefined, city?: string | undefined, state?: string | undefined, zip?: string | undefined, country?: string | undefined, email?: string | undefined, phone?: string | undefined, contactPerson?: string | undefined}) | undefined}}; export type UpdateApiApiV1ShippingMethodsIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update shipping method * * PUT /api/v1/shippingMethods/{id} */ export const updateApiApiV1ShippingMethodsId = async (args: UpdateApiApiV1ShippingMethodsIdArgs, options?: UpdateApiApiV1ShippingMethodsIdOptions) => { const {baseUrl = "https://xentral.xentral.biz", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/shippingMethods/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 undefined };