export type DateISO = string; export type DmCurrency = 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BTC' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLF' | 'CLP' | 'CNH' | 'CNY' | 'COP' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GGP' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'IMP' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JEP' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STD' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XCD' | 'XCG' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'YER' | 'ZAR' | 'ZMW' | 'ZWG' | 'ZWL'; export type MonetaryAmountDto = {currency: DmCurrency, amount: number}; export type DateRangeDto = {startDate: DateISO, endDate: DateISO | null}; export type UserBadgeDto = {id: string, name: string, avatarUrl: string | null, deactivatedAt: DateISO | null}; export type SharedCustomAttributeTypeDto = {viewType: 'customText', text: string | null} | {viewType: 'customNumber', number: number | null} | {viewType: 'customCheckbox', checked: boolean | null} | {viewType: 'customDate', date: DateISO | null} | {viewType: 'customTimestamp', timestamp: DateISO | null} | {viewType: 'customRating', rating: number | null} | {viewType: 'customSelect', select: string | null} | {viewType: 'customMultiSelect', multiSelect: Array} | {viewType: 'customCurrency', monetaryAmount: MonetaryAmountDto | null} | {viewType: 'customDateRange', dateRange: DateRangeDto | null} | {viewType: 'customDuration', duration: number | null} | {viewType: 'customUrl', url: string | null} | {viewType: 'customEntity', type: 'user', id: string | null, entity?: (UserBadgeDto | null) | undefined} | {viewType: 'customMultiEntity', type: 'user', ids: Array, entities?: Array | undefined}; export type UpdateAttributeValueDto = {attributeDefinitionId: string, value: SharedCustomAttributeTypeDto}; export type UpdateAttributeValuesDto = {attributes: Array}; export type UpdateApiCustomAttributesApplicationsIdValuesBulkArgs = {id: string, body: UpdateAttributeValuesDto}; export type UpdateApiCustomAttributesApplicationsIdValuesBulkOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update custom attribute values for an application * * PUT /custom-attributes/applications/{id}/values/_bulk */ export const updateApiCustomAttributesApplicationsIdValuesBulk = async (args: UpdateApiCustomAttributesApplicationsIdValuesBulkArgs, options: UpdateApiCustomAttributesApplicationsIdValuesBulkOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/custom-attributes/applications/${encodeURIComponent(String(args.id))}/values/_bulk${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 };