diff --git a/pkg/component/marketplace/models.go b/pkg/component/marketplace/models.go index 39aa38b..66924ee 100644 --- a/pkg/component/marketplace/models.go +++ b/pkg/component/marketplace/models.go @@ -8,24 +8,33 @@ import ( // UsageEventReq a type to represent the usage metering event request type UsageEventReq struct { - ResourceId string `json:"resourceId"` // unique identifier of the resource against which usage is emitted. - Quantity float32 `json:"quantity"` // how many units were consumed for the date and hour specified in effectiveStartTime, must be greater than 0, can be integer or float value - Dimension string `json:"dimension"` // custom dimension identifier - StartTime time.Time `json:"startTime"` // time in UTC when the usage event occurred, from now and until 24 hours back - Plan string `json:"plan"` // id of the plan purchased for the offer + ResourceId string `json:"resourceUri"` // unique identifier of the resource against which usage is emitted. + Quantity float32 `json:"quantity"` // how many units were consumed for the date and hour specified in effectiveStartTime, must be greater than 0, can be integer or float value + Dimension string `json:"dimension"` // custom dimension identifier + StartTime time.Time `json:"effectiveStartTime"` // time in UTC when the usage event occurred, from now and until 24 hours back + Plan string `json:"planId"` // id of the plan purchased for the offer } // UsageEventRes a type to represent the usage metering event response type UsageEventRes struct { autorest.Response `json:"-"` - UsageEventId string `json:"usageEventId"` // unique identifier associated with the usage event in Microsoft records - Status string `json:"status"` // this is the only value in case of single usage event - MessageTime time.Time `json:"messageTime"` // time in UTC this event was accepted - ResourceId string `json:"resourceId"` // unique identifier of the resource against which usage is emitted. For SaaS it's the subscriptionId. - Quantity float32 `json:"quantity"` // amount of emitted units as recorded by Microsoft - Dimension string `json:"dimension"` // custom dimension identifier - EffectiveStartTime time.Time `json:"effectiveStartTime"` // time in UTC when the usage event occurred, as sent by the ISV - PlanId string `json:"planId"` // id of the plan purchased for the offer + UsageEventId string `json:"usageEventId"` // unique identifier associated with the usage event in Microsoft records + Status string `json:"status"` // this is the only value in case of single usage event + MessageTime time.Time `json:"messageTime"` // time in UTC this event was accepted + ResourceId string `json:"resourceId"` // unique identifier of the resource against which usage is emitted. For SaaS it's the subscriptionId. + Quantity float32 `json:"quantity"` // amount of emitted units as recorded by Microsoft + Dimension string `json:"dimension"` // custom dimension identifier + EffectiveStartTime time.Time `json:"effectiveStartTime"` // time in UTC when the usage event occurred, as sent by the ISV + PlanId string `json:"planId"` // id of the plan purchased for the offer + Error UsageEventErrorDetail `json:"error"` +} + +// UsageEventErrorDetail represents a detail error mensage. +type UsageEventErrorDetail struct { + Message string `json:"message"` + Target string `json:"target"` + Code string `json:"code"` + Details []UsageEventErrorDetail `json:"details,omitempty"` } // UsageEventBatchReq a type to represent the usage metering batch events request