asyncapi: 2.0.0
info:
  title: eBay Notifications
  version: 1.0.0
  description: This contract defines eBay notification for event subsciptions
channels:
  MARKETPLACE_ACCOUNT_DELETION:
    subscribe:
      message:
        $ref: '#/components/messages/message'
      bindings:
        http:
          type: request
          method: POST
          headers:
            type: object
            properties:
              Content-Type:
                type: string
                enum: ['application/json']
components:
  messages:
    message:
      headers:
        type: object
        properties:
          X-EBAY-SIGNATURE:
            description: ECC message signature
            type: string
      payload:
        type: object
        properties:
          metadata:
            $ref: '#/components/schemas/MetaData'
          notification:
            $ref: '#/components/schemas/Notification'
  schemas:
    MetaData:
      type: object
      properties:
        topic:
          type: string
          description: 'Topic subscribed to.'
        schemaVersion:
          type: string
          description: 'The schema for this topic.'
        deprecated:
          type: boolean
          description: 'If this is a deprecated schema or topic.'
          default: 'false'

    Notification:
      type: object
      properties:
        notificationId:
          type: string
          description: 'The notification Id.'
        eventDate:
          type: string
          description: 'The event date associated with this notification in UTC.'
        publishDate:
          type: string
          description: 'The message publish date in UTC.'
        publishAttemptCount:
          type: integer
          description: 'The number of attempts made to publish this message.'
        data:
         $ref: '#/components/schemas/MarketplaceAccountDeletionData'
    MarketplaceAccountDeletionData:
      type: object
      description: 'The Account Deletion payload.'
      properties:
        username:
          type: string
          description: 'The username for the user.'
        userId:
          type: string
          description: 'The immutable public userId for the user'
        eiasToken:
          type: string
          description: 'The legacy eiasToken specific to the user'
