#%RAML 1.0 Library
#
# Legalhold related audit events
# cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.created.v1.0
# cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.updated.v1.0
# cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.deleted.v1.0
# cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.enabled.v1.0
# cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.disabled.v1.0
# cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.executed.v1.0
#

uses:
  cti: ../../../.ramlx/cti.raml
  base: ../em/audit.raml

types:
  LegalholdAuditData:
    description: Basic information about legal hold in email archiving.
    additionalProperties: false
    properties:
      search_query_name:
        type: string
        description: Search query name for the legal hold saved by user.
      archive_name:
        type: string
        description: Archive name where legal hold is applied.

  LegalholdExecutedAuditData:
    additionalProperties: false
    properties:
      search_query_names:
        type: array
        items: string
        description: List of search query names under legal hold.
      email_count:
        type: integer
        description: Number of emails under legal hold.
      legal_holds:
        type: array
        items: string
        description: List of legal holds for search query names.

  LegalholdCreatedEvent:
    type: base.AuditEvent
    (cti.cti): cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.created.v1.0
    description: Legal hold created.

    cti-traits:
      topic_id: cti.a.p.em.topic.v1.0~a.p.audit.v1.0

    properties:
      data:
        type: base.AuditEventData
        additionalProperties: false
        properties:
          audit_data: LegalholdAuditData

  LegalholdUpdatedEvent:
    type: base.AuditEvent
    (cti.cti): cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.updated.v1.0
    description: Legal hold updated.

    cti-traits:
      topic_id: cti.a.p.em.topic.v1.0~a.p.audit.v1.0

    properties:
      data:
        type: base.AuditEventData
        additionalProperties: false
        properties:
          audit_data: LegalholdAuditData

  LegalholdDeletedEvent:
    type: base.AuditEvent
    (cti.cti): cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.deleted.v1.0
    description: Legal hold deleted.

    cti-traits:
      topic_id: cti.a.p.em.topic.v1.0~a.p.audit.v1.0

    properties:
      data:
        type: base.AuditEventData
        additionalProperties: false
        properties:
          audit_data: LegalholdAuditData

  LegalholdEnabledEvent:
    type: base.AuditEvent
    (cti.cti): cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.enabled.v1.0
    description: Legal hold enabled.

    cti-traits:
      topic_id: cti.a.p.em.topic.v1.0~a.p.audit.v1.0

    properties:
      data:
        type: base.AuditEventData
        additionalProperties: false
        properties:
          audit_data: LegalholdAuditData

  LegalholdDisabledEvent:
    type: base.AuditEvent
    (cti.cti): cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.disabled.v1.0
    description: Legal hold disabled.

    cti-traits:
      topic_id: cti.a.p.em.topic.v1.0~a.p.audit.v1.0

    properties:
      data:
        type: base.AuditEventData
        additionalProperties: false
        properties:
          audit_data: LegalholdAuditData

  LegalholdExecutedEvent:
    type: base.AuditEvent
    (cti.cti): cti.a.p.em.event.v1.0~a.p.audit.v1.0~a.p.legalhold.executed.v1.0
    description: Legal hold executed.

    cti-traits:
      topic_id: cti.a.p.em.topic.v1.0~a.p.audit.v1.0

    properties:
      data:
        type: base.AuditEventData
        additionalProperties: false
        properties:
          audit_data: LegalholdExecutedAuditData
