export type AssetStatus = 0 | 1 | 2 | 4 | 8 | 15; export type AssetScope = 1 | 2 | 3; export type AssetType = 1 | 2 | 3; export type BillingCycleType = 0 | 1 | 2 | 3 | 4 | 5 | 6; export type SubscriptionLite = {id?: number | undefined, name?: (string | null) | undefined, publisherSubscriptionId?: (string | null) | undefined, resellerCustomerName?: (string | null) | undefined}; export type ObjectReference = {id?: number | undefined, name?: (string | null) | undefined}; export type AssetTags = {assetId?: number | undefined, costCenter?: (string | null) | undefined, department?: (string | null) | undefined, project?: (string | null) | undefined, custom?: (string | null) | undefined, owner?: (string | null) | undefined}; export type Asset = {id?: number | undefined, status?: AssetStatus | undefined, externalOrderId?: (string | null) | undefined, quantity?: number | undefined, externalProductId?: (string | null) | undefined, externalSkuId?: (string | null) | undefined, name?: (string | null) | undefined, startDate?: string | undefined, expirationDate?: (string | null) | undefined, resellerCustomerId?: number | undefined, scope?: AssetScope | undefined, assetType?: AssetType | undefined, billingCycle?: BillingCycleType | undefined, publisherId?: number | undefined, programId?: number | undefined, reservationId?: (string | null) | undefined, reservationUsedInSubscriptionId?: (number | null) | undefined, reservationUsedInSubscription?: SubscriptionLite | undefined, purchaseCurrency?: (string | null) | undefined, purchasePrice?: number | undefined, salesCurrency?: (string | null) | undefined, salesPrice?: number | undefined, createdDate?: string | undefined, modifiedDate?: string | undefined, changedBy?: (string | null) | undefined, reservedInstanceArtifactResourceId?: (string | null) | undefined, purchaseDate?: (string | null) | undefined, invoiceProfile?: ObjectReference | undefined, tags?: AssetTags | undefined, autoRenewEnabled?: (boolean | null) | undefined, productVariantId?: (number | null) | undefined}; export type UpdateApiApiV1AssetsAssetIdArgs = {assetId: number, body: Asset}; export type UpdateApiApiV1AssetsAssetIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /api/v1/Assets/{assetId} */ export const updateApiApiV1AssetsAssetId = async (args: UpdateApiApiV1AssetsAssetIdArgs, options: UpdateApiApiV1AssetsAssetIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/Assets/${encodeURIComponent(String(args.assetId))}${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 };