export type ServiceChannelServicesMessagingAssetsAssetType = {Id?: number | undefined, IsActive?: boolean | undefined, HasEquipment?: boolean | undefined, SubscriberId?: number | undefined, Parent?: ServiceChannelServicesMessagingAssetsAssetType | undefined, Name?: string | undefined, PrimaryTrade?: string | undefined, TradeId?: number | undefined, ParentId?: number | undefined, RefrigerantPurposeId?: number | undefined, RefrigerantPurposeName?: string | undefined, AdditionalTrades?: Array | undefined, AdditionalTradesIds?: Array | undefined, IsCircuit?: boolean | undefined, UserId?: number | undefined, AssetTypeGroupId?: number | undefined, PrimaryAssetTypeId?: number | undefined, BrandIds?: Array | undefined}; export type UpdateApiAssetTypesAssetTypeIdArgs = {assetTypeId: number, body: ServiceChannelServicesMessagingAssetsAssetType}; export type UpdateApiAssetTypesAssetTypeIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /AssetTypes/{assetTypeId} */ export const updateApiAssetTypesAssetTypeId = async (args: UpdateApiAssetTypesAssetTypeIdArgs, options?: UpdateApiAssetTypesAssetTypeIdOptions) => { const {baseUrl = "https://sb2api.servicechannel.com/v3", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/AssetTypes/${encodeURIComponent(String(args.assetTypeId))}${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 };