openapi: 3.1.0
info:
  title: Unified Events For Subscription Management
  version: 1.0.0
webhooks:
  Expiring Subscriptions:
    post:
      requestBody:
        description: >-
          __Triggered daily when a Subscription is expiring in 1, 30, 60 and 90
          days__<br><br>__`com.hpe.greenlake.subscriptions.v1.expiring-subscriptions`__
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloudEvent'
components:
  schemas:
    ExpiringSubscriptionEvent:
      type: object
      properties:
        key:
          type: string
        expiryDate:
          type: string
        sku:
          type: string
        licenseTier:
          type: string
        quantity:
          type: integer
          format: int64
        username:
          type: string
        subscriptionEndInSecs:
          type: integer
          format: int64
        subscriptionType:
          type: string
        productType:
          type: string
        platformCustomerId:
          type: string
        devices:
          type: array
          items:
            $ref: '#/components/schemas/Device'
    Device:
      type: object
      properties:
        serialNumber:
          type: string
        partNumber:
          type: string
        deviceModel:
          type: string
        macAddress:
          type: string
    CloudEvent:
      type: object
      required:
        - specversion
        - id
        - source
        - type
        - subject
        - data
      properties:
        specversion:
          type: string
        id:
          type: string
          format: uuid
        source:
          type: string
        type:
          type: string
        time:
          type: string
          format: date-time
        subject:
          type: string
        dataschema:
          type: string
        datacontenttype:
          type: string
        data:
          type: object
          $ref: '#/components/schemas/ExpiringSubscriptionEvent'
