@@ -224,7 +224,9 @@ type Alert struct {
224224 // The current status of the alert. This field is only present for credit balance
225225 // alerts.
226226 BalanceAlertStatus []AlertBalanceAlertStatus `json:"balance_alert_status,nullable"`
227- JSON alertJSON `json:"-"`
227+ // Minified license type for alert serialization.
228+ LicenseType AlertLicenseType `json:"license_type,nullable"`
229+ JSON alertJSON `json:"-"`
228230}
229231
230232// alertJSON contains the JSON metadata for the struct [Alert]
@@ -240,6 +242,7 @@ type alertJSON struct {
240242 Thresholds apijson.Field
241243 Type apijson.Field
242244 BalanceAlertStatus apijson.Field
245+ LicenseType apijson.Field
243246 raw string
244247 ExtraFields map [string ]apijson.Field
245248}
@@ -307,16 +310,17 @@ func (r alertPlanJSON) RawJSON() string {
307310type AlertType string
308311
309312const (
310- AlertTypeCreditBalanceDepleted AlertType = "credit_balance_depleted"
311- AlertTypeCreditBalanceDropped AlertType = "credit_balance_dropped"
312- AlertTypeCreditBalanceRecovered AlertType = "credit_balance_recovered"
313- AlertTypeUsageExceeded AlertType = "usage_exceeded"
314- AlertTypeCostExceeded AlertType = "cost_exceeded"
313+ AlertTypeCreditBalanceDepleted AlertType = "credit_balance_depleted"
314+ AlertTypeCreditBalanceDropped AlertType = "credit_balance_dropped"
315+ AlertTypeCreditBalanceRecovered AlertType = "credit_balance_recovered"
316+ AlertTypeUsageExceeded AlertType = "usage_exceeded"
317+ AlertTypeCostExceeded AlertType = "cost_exceeded"
318+ AlertTypeLicenseBalanceThresholdReached AlertType = "license_balance_threshold_reached"
315319)
316320
317321func (r AlertType ) IsKnown () bool {
318322 switch r {
319- case AlertTypeCreditBalanceDepleted , AlertTypeCreditBalanceDropped , AlertTypeCreditBalanceRecovered , AlertTypeUsageExceeded , AlertTypeCostExceeded :
323+ case AlertTypeCreditBalanceDepleted , AlertTypeCreditBalanceDropped , AlertTypeCreditBalanceRecovered , AlertTypeUsageExceeded , AlertTypeCostExceeded , AlertTypeLicenseBalanceThresholdReached :
320324 return true
321325 }
322326 return false
@@ -348,6 +352,28 @@ func (r alertBalanceAlertStatusJSON) RawJSON() string {
348352 return r .raw
349353}
350354
355+ // Minified license type for alert serialization.
356+ type AlertLicenseType struct {
357+ ID string `json:"id,required"`
358+ JSON alertLicenseTypeJSON `json:"-"`
359+ }
360+
361+ // alertLicenseTypeJSON contains the JSON metadata for the struct
362+ // [AlertLicenseType]
363+ type alertLicenseTypeJSON struct {
364+ ID apijson.Field
365+ raw string
366+ ExtraFields map [string ]apijson.Field
367+ }
368+
369+ func (r * AlertLicenseType ) UnmarshalJSON (data []byte ) (err error ) {
370+ return apijson .UnmarshalRoot (data , r )
371+ }
372+
373+ func (r alertLicenseTypeJSON ) RawJSON () string {
374+ return r .raw
375+ }
376+
351377// Thresholds are used to define the conditions under which an alert will be
352378// triggered.
353379type Threshold struct {
0 commit comments