#%RAML 1.0 Library
#
# License usage type
#

uses:
  cti: ../../../.ramlx/cti.raml
  scalar: ../../../.ramlx/scalar.raml

annotationTypes:
  UsageTypes:
    type: Usage[]
    allowedTargets: [ Library ]

types:
  UsageTraits:
    additionalProperties: false
    properties:
      measurement_units:
        enum:
        - n/a
        - bytes
        - quantity
        - seconds

  Usage:
    (cti.cti): cti.a.p.lic.usage.v1.0
    (cti.final): false
    description: >
      An entity that is used for licensing usage tracking.

    facets:
      cti-traits: UsageTraits

    additionalProperties: false
    properties:
      usage_type:
        type: cti.CTI
        (cti.id): true
        description: Usage type name.

      usage_value:
        type: integer
        description: Countable usage value.

      tenant_id:
        type: scalar.uuid
        description: Tenant ID.

      feature_id?:
        type: cti.CTI
        (cti.reference): cti.a.p.lic.feature.v1.0
        description: Feature ID.

      resource_id?:
        type: string
        description: Resource ID.
