openapi: 3.0.0
info:
  description: Aura configuration filter engine API definition.
  version: 10.0.0
  title: Aura Configuration Filter Engine API Swagger
  contact:
    email: auradev@tid.es
servers:
  - url: https://localhost:8999
paths:
  /aura-services/v2/routing-filters/summary/{filterType}:
    get:
      tags:
        - routingFilters
        - filterEngine
      description: Get all filters by type
      operationId: getFiltersSummaryByType
      security:
        - apiKeyHeader: []
      parameters:
        - name: filterType
          in: path
          required: true
          description: Type of filter.
          schema:
            type: string
        - name: correlator
          in: header
          description: Unique identifier of a request to be used as correlator in all systems
          required: false
          schema:
            type: string
            format: uuid
      responses:
        "200":
          $ref: "#/components/schemas/FilterUserIdSummaryResponse"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/InternalError"
        "500":
          $ref: "#/components/responses/InternalError"
  /aura-services/v2/routing-filters/entities/files:
    post:
      tags:
        - entities
        - filterEngine
      description: Set data KPI for entities for userId filter
      operationId: processEntity
      x-use-streaming: true
      security:
        - apiKeyHeader: []
      parameters:
        - name: entityId
          in: query
          description: Entity identifier. Unique string that identifies the entity.
          required: true
          schema:
            type: string
        - name: correlator
          in: header
          description: Unique identifier of a request to be used as correlator in all systems
          required: false
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          text/csv:
            schema:
              type: string
              format: binary
      responses:
        "200":
          $ref: "#/components/schemas/FilterUserIdSummaryResponse"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/InternalError"
        "500":
          $ref: "#/components/responses/InternalError"
  /aura-services/v2/routing-filters/{filterId}/items/{itemId}:
    get:
      tags:
        - filterEngine
      description: Get value of filterId for itemId
      operationId: getFilterItem
      security:
        - apiKeyHeader: []
      parameters:
        - name: correlator
          in: header
          description: Unique identifier of a request to be used as correlator in all systems
          required: false
          schema:
            type: string
            format: uuid
        - name: filterId
          in: path
          description: Unique identifier of a filter
          required: true
          schema:
            type: string
            format: uuid
        - name: itemId
          in: path
          description: Unique identifier of a item
          required: true
          schema:
            type: string
            format: uuid
        - name: date
          in: query
          description: Date to get the filters summary. Extended iso format ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ)
          required: false
          schema:
            type: string
      responses:
        "200":
          $ref: "#/components/responses/FilterItemResponse"
        "400":
          $ref: "#/components/responses/InvalidRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/InternalError"
        "500":
          $ref: "#/components/responses/InternalError"
components:
  responses:
    InvalidRequest:
      description: Incoming HTTP request format is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    Unauthorized:
      description: Incoming HTTP request authorization is not valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    NotFound:
      description: Incoming HTTP request is not found
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    InternalError:
      description: Incoming HTTP request produces an internal error
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/AuraError"
    FilterItemResponse:
      description: Incoming HTTP request format is valid
      headers:
        correlator:
          description: Correlation id for the different services
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/FilterItemResponse"
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    AuraError:
      type: object
      description: Error response
      properties:
        code:
          type: string
          description: Unique id of the error
        message:
          type: string
          description: Specific and descriptive text of the error
        errors:
          description: With validation error. Swagger error information
          type: array
          items:
            type: object
    FilterUserIdSummary:
      type: object
      description: Filter userId summary response
      properties:
        userId:
          type: string
          description: User identifier
        total:
          type: number
          description: Total summary
      required:
        - userId
        - total
    FilterUserIdSummaryObject:
      type: object
      description: Filter userId summary response
      properties:
        filterId:
          type: string
          description: Filter identifier
        actions:
          description: Actions to be taken
          type: array
          items:
            type: object
        users:
          type: array
          items:
            $ref: "#/components/schemas/FilterUserIdSummary"
      required:
        - filterId
        - actions
        - users
    FilterUserIdSummaryResponse:
      type: object
      description: UserId summary response
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/FilterUserIdSummaryObject"
      required:
        - data
    FilterItemResponse:
      type: object
      description: Filter item response
      required:
        - value
      properties:
        value:
          oneOf:
            - type: string
            - type: integer
          description: Value of filterId for itemId
        actions:
          description: Actions to be taken
          type: array
          items:
            type: object
            