OpenApi

View spec in html.

openapi: 3.0.0
info:
  version: 'v.2.2.3'
  title: 'Luna-Handlers'
  description: 'VisionLabs Luna Handlers API'

servers:
- description: SwaggerHub API Auto Mocking
  url: https://virtserver.swaggerhub.com/visionlabs/Luna3API/v.2.2.3


components:
  headers:
    application_json:
      schema:
        type: string
        enum:
        - application/json
      required: true
      description: content type is application/json

    luna_request_id:
      schema:
        type: string
        format: timestamp,uuid
        example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a
        pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}$
      description: request id. Helps to uniquely identify messages that correspond to particular requests, in system logs.
      required: true

    docs_content_type:
      schema:
        type: string
        enum:
          - application/x-yaml
          - text/html
      required: true
      description: Type of receiving data

    text_html:
      schema:
        type: string
        enum:
          - text/html
      required: true
      description: Content type is text/html

    application_json_or_msgpack_content:
      schema:
        type: string
        default: application/json
        enum:
          - application/json
          - application/msgpack
      description: The response content type header.  Depends on Accept header in the request.

    cache_handler_version:
      schema:
        type: string
        format: date-time
      description: If handler from cache is used, this field contains version of the handler.

    config_accept_content_type:
      schema:
        type: string
        enum:
          - application/json
          - text/plain
      required: false
      description: The content type of the response body.
  parameters:
    page:
      in: query
      name: page
      schema:
        type: integer
        minimum: 1
        default: 1
      description: a page number.

    luna_request_id:
      in: header
      schema:
        type: string
        format: timestamp,uuid
        example: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a
        pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
      description: |
        external request id. Helps to uniquely identify messages that correspond to particular requests, in system logs.
        If it was not set, system will set it in default format ("timestamp,UUID"). It will be returned with response.
      name: Luna-Request-Id

    page_size:
      in: query
      name: page_size
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
      description: the number of items on page.

    tags:
      in: query
      name: tags
      schema:
        type: array
        items:
          $ref: '#/components/schemas/tag'
        minItems: 0
      explode: false
      description: |
        A comma-separated list of tags. Each event from result will contain all of the given tags.
        Each tag can be at most 36 characters.
      example:
        - tag_1
        - tag_2

    time__lt:
      in: query
      name: time__lt
      schema:
        $ref: '#/components/schemas/time'
      description: upper bound for object create_time.
      example: "2018-08-11T09:11:41.674Z"

    time__gte:
      in: query
      name: time__gte
      schema:
        $ref: '#/components/schemas/time'
      description: lower included bound for object create_time.
      example: "2018-08-11T09:11:41.674Z"

    city:
      in: query
      name: city
      schema:
        $ref: '#/components/schemas/location_str'
      description: Event city
      example: "New-York"

    area:
      in: query
      name: area
      schema:
        $ref: '#/components/schemas/location_str'
      description: Event area
      example: "central park"

    district:
      in: query
      name: district
      schema:
        $ref: '#/components/schemas/location_str'
      description: Event district
      example: "mitino"

    street:
      in: query
      name: street
      schema:
        $ref: '#/components/schemas/location_str'
      description: Event street
      example: "arbat"

    house_number:
      in: query
      name: house_number
      schema:
        $ref: '#/components/schemas/location_str'
      description: Event house number
      example: "1/2str3"

    applicationJsonContent:
      in: header
      name: Content-Type
      schema:
        type: string
        enum:
        - application/json
      description: content type is application/json.

    multiface_policy:
      in: query
      name: multiface_policy
      schema:
        $ref: '#/components/schemas/multiface_policy'

    iso_multiface_policy:
      in: query
      name: multiface_policy
      schema:
        $ref: '#/components/schemas/iso_multiface_policy'

    detector_multiface_policy:
      in: query
      name: multiface_policy
      schema:
        $ref: '#/components/schemas/multiface_policy'
      description: |
        multiple face detection policy:

        - *`0`* - multiple face detection not allowed

        - *`1`* - multiple face detection allowed

        - *`2`* - get best face detection from the image

    detect_face:
      in: query
      name: detect_face
      schema:
        allOf:
          - default: 0
          - $ref: '#/components/schemas/detect_face'
      description: |
        whether to detect faces on the image.

    detect_body:
      in: query
      name: detect_body
      schema:
        allOf:
          - default: 0
          - $ref: '#/components/schemas/detect_body'
      description: |
        whether to detect human bodies on the image.

    estimate_body_warp:
      in: query
      name: estimate_body_warp
      schema:
        $ref: '#/components/schemas/estimate_head_pose'
      description: |
        whether to estimate human body warp on the image.

    estimate_face_warp:
      in: query
      name: estimate_face_warp
      schema:
        $ref: '#/components/schemas/estimate_head_pose'
      description: |
        whether to estimate human face warp on the image.

    estimate_head_pose:
      in: query
      name: estimate_head_pose
      schema:
        $ref: '#/components/schemas/estimate_head_pose'

    estimate_emotions:
      in: query
      name: estimate_emotions
      schema:
        $ref: '#/components/schemas/estimate_emotions'
      description: |
        whether to estimate emotions on the image.

    detect_landmarks68:
      in: query
      name: detect_landmarks68
      schema:
        $ref: '#/components/schemas/detect_landmarks68'

    estimate_landmarks5:
      in: query
      name: estimate_landmarks5
      schema:
        $ref: '#/components/schemas/detect_landmarks5'

    estimate_landmarks68:
      in: query
      name: estimate_landmarks68
      schema:
        $ref: '#/components/schemas/detect_landmarks68'

    extract_exif:
      in: query
      name: extract_exif
      schema:
        $ref: '#/components/schemas/extract_exif'
      description: |
        whether to extract EXIF meta information from input JPEG images.

        Exact output will vary since there are no mandatory requirements for both authoring software and digital cameras how to write the data.

        This function will only parse the tags and output their names and values as they are. Please refer to JEITA CP-3451 EXIF specification for details.

    estimate_quality:
      in: query
      name: estimate_quality
      schema:
        $ref: '#/components/schemas/estimate_quality'
      description: |
        whether to estimate input face image quality.

    estimate_gaze:
      in: query
      name: estimate_gaze
      schema:
        $ref: '#/components/schemas/estimate_gaze'

    estimate_eyes_attributes:
      in: query
      name: estimate_eyes_attributes
      schema:
        $ref: '#/components/schemas/estimate_eyes_attributes'

    estimate_mouth_attributes:
      in: query
      name: estimate_mouth_attributes
      schema:
        $ref: '#/components/schemas/estimate_mouth_attributes'
      description: |
        whether to estimate mouth attributes on the image.

    estimate_mask:
      in: query
      name: estimate_mask
      schema:
        $ref: '#/components/schemas/estimate_mask'
      description: |
        whether to estimate mask on the image.

    estimate_glasses:
      in: query
      name: estimate_glasses
      schema:
        $ref: '#/components/schemas/estimate_glasses'
      description: |
        whether to estimate glasses on the image.

    estimate_liveness:
      in: query
      name: estimate_liveness
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        whether to estimate liveness on the image.

        ⚠ **Good quality only on webcam or selfie photos**: otherwise the result may be incorrect.

        ⚠ **Liveness v.2 licensing feature is required to be enabled to perform liveness estimation.**

    pitch_threshold:
      in: query
      name: pitch_threshold
      schema:
        $ref: '#/components/schemas/pitch_threshold'
      description: |
        maximum deviation pitch angle from 0.

    roll_threshold:
      in: query
      name: roll_threshold
      schema:
        $ref: '#/components/schemas/roll_threshold'
      description: |
        maximum deviation roll angle from 0.

    yaw_threshold:
      in: query
      name: yaw_threshold
      schema:
        $ref: '#/components/schemas/yaw_threshold'

      description: |
        maximum deviation yaw angle from 0.

    mask_states:
      in: query
      name: mask_states
      schema:
        $ref: '#/components/schemas/mask_states'

      description: |
        filter by mask states.

        | masks      | value |
        |----------------|---|
        | missing        | 1 |
        | medical_mask   | 2 |
        | occluded       | 3 |

    liveness_states:
      in: query
      name: liveness_states
      schema:
        $ref: '#/components/schemas/liveness_states'

      description: |
        filter by liveness states.

        | liveness state | value |
        |----------------|-------|
        | spoof          |   0   |
        | real           |   1   |
        | unknown        |   2   |

    extract_descriptor:
      in: query
      name: extract_descriptor
      schema:
        $ref: '#/components/schemas/extract_descriptor'

    estimate_body_descriptor:
      in: query
      name: estimate_body_descriptor
      schema:
        $ref: '#/components/schemas/extract_descriptor'
      description: |
          whether to estimate human body descriptor(s).

    estimate_face_descriptor:
      in: query
      name: estimate_face_descriptor
      schema:
        $ref: '#/components/schemas/extract_descriptor'
      description: |
          whether to estimate face descriptor(s).

    aggregate_attributes:
      in: query
      name: aggregate_attributes
      schema:
        $ref: '#/components/schemas/aggregate_attributes'

      description: |
          whether to aggregate face descriptor(s).

          If true, all extracted attributes will be aggregated and stored as a single attribute.
          Otherwise, all attributes will be stored for each sample.

    extract_basic_attributes:
      in: query
      name: extract_basic_attributes
      schema:
        $ref: '#/components/schemas/extract_basic_attributes'
      description: |
        whether to extract basic attributes (gender, age, ethnicity).

    estimate_basic_attributes:
      in: query
      name: estimate_basic_attributes
      schema:
        $ref: '#/components/schemas/extract_basic_attributes'
      description: |
        whether to estimate face basic attributes (gender, age, ethnicity).

    score_threshold:
      in: query
      name: score_threshold
      schema:
        $ref: '#/components/schemas/score_threshold'

    warped_image:
      in: query
      name: warped_image
      schema:
        $ref: '#/components/schemas/warped_image'
      description: Whether input image is a warped or arbitrary image.

    luna_event_time:
      in: header
      name: Luna-Event-Time
      schema:
        $ref: '#/components/schemas/time'
      examples:
        with_time_zone:
          summary: time with timezone
          value: 2018-12-16T15:29:59.300275+03:00
        utc:
          summary: utc time
          value: 2018-12-16T15:29:59.300275Z
      description: |
        user defined event time. All events will be saved with this time as "create_time". Format of time is
        [rfc3339](https://www.ietf.org/rfc/rfc3339.txt). All other format is ignored.

    luna_event_end_time:
      in: header
      name: Luna-Event-End-Time
      schema:
        $ref: '#/components/schemas/time'
      examples:
        with_time_zone:
          summary: time with timezone
          value: 2018-12-16T15:29:59.300275+03:00
        utc:
          summary: utc time
          value: 2018-12-16T15:29:59.300275Z
      description: |
        user defined event end time. All events will be saved with this time as "end_time". Format of time is
        [rfc3339](https://www.ietf.org/rfc/rfc3339.txt). All other format is ignored.

    account_id:
      in: query
      name: account_id
      schema:
        $ref: '#/components/schemas/uuid'
      description: account id
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    account_id_required:
      in: query
      name: account_id
      schema:
        $ref: '#/components/schemas/uuid'
      description: account id
      required: true
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    force_upgrade:
      in: query
      name: force_upgrade
      schema:
        type: integer
        enum: [0, 1]
        default: 0
      description: whether to force update existing attribute's samples
      required: false

    is_dynamic:
      in: query
      name: is_dynamic
      schema:
        $ref: '#/components/schemas/is_dynamic'
      description: whether to get only dynamic (1) or non-dynamic (0) handlers
      required: false

    accept_docs_handler:
      in: header
      name: Accept
      schema:
        $ref: '#/components/schemas/accept_docs_handler'
      required: true
      description: acceptable type of receiving data

    longitude:
      in: query
      name: longitude
      schema:
        type: number
        minimum: -180
        maximum: 180
      description: |
        longitude in degrees, a part of composite geo position.
        Geo position is considered as properly specified if both *longitude* and *latitude* are set.
      example: 36.616

    latitude:
      in: query
      name: latitude
      schema:
        type: number
        minimum: -90
        maximum: 90
      description: |
        latitude in degrees, a part of composite geo position.
        Geo position is considered as properly specified if both *longitude* and *latitude* are set.
      example: 55.752

    image_type:
      in: query
      name: image_type
      schema:
        type: integer
        default: 0
        enum: [0,1,2]
        description: image type of input image.  0 - raw image, 1 - face warped image, 2 - body warped image

    iso_image_type:
      in: query
      name: image_type
      schema:
        type: integer
        default: 0
        enum: [0,1]
        description: image type of input image.  0 - raw image, 1 - face warped image

    ttl:
      in: query
      name: ttl
      schema:
        type: integer
        default: 300
        maximum: 86400
        minimum: 1
      description: lifetime for temporary attribute (seconds)

    source:
      in: query
      name: source
      schema:
        $ref: '#/components/schemas/source'
      description: Additional information, provided by user with event.
      example: "3rd Avenue"

    verifier_description:
      in: query
      name: description
      schema:
        type: string
      description: verifier description - verifiers with description similar to this parameter will be processed.

    json_or_msgpack_content:
      in: header
      name: Content-Type
      schema:
        type: string
        enum:
          - application/json
          - application/msgpack
      description: Format of a request body data

    face_ids:
      in: query
      name: face_ids
      schema:
        type: string
        format: list of uuid.
      description: list of face ids
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38'

    event_ids:
      in: query
      name: event_ids
      schema:
        type: string
        format: list of uuid.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38'
      description: a list of comma-separated event ids.

    external_ids:
      in: query
      name: external_ids
      schema:
        type: string
      example: 'abcd_1234,346a5645-ec89-4806-820a-dbcb6e0dc38'
      description: a list of comma-separated external ids.

    attribute_ids:
      in: query
      name: attribute_ids
      schema:
        type: string
        format: list of uuid
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc38'
      description: list of comma-separated attribute ids.

    track_id:
      in: query
      name: track_id
      schema:
        type: string
        pattern: '^[a-zA-Z0-9_\-](1, 36)$'
      description: event track id
      example: "useful_track_id_number_1"

    use_exif_info:
      in: query
      name: use_exif_info
      schema:
        type: integer
        enum: [0, 1]
        default: 1
      description: |
        whether to try to auto orient image based on exif data

        *Has no effect with tiff images (they're always auto oriented).*

        *Ignored with warped images (see `warped_image` or `image_type` parameter).*
      example: 1

    application_json_or_msgpack_accept:
      in: header
      name: Accept
      schema:
        type: string
        default: application/json
        enum:
          - application/json
          - application/msgpack
      description: The response content type header.

    include_luna_services:
      in: query
      name: include_luna_services
      schema:
        type: integer
        enum: [0, 1]
        default: 0
      description: whether to perform healthchecks for dependent luna services.

    wait_raw_event_saving:
      in: query
      name: wait_saving
      schema:
        type: integer
        enum: [0, 1]
        default: 1
      description: |
        whether to wait for raw event saving.

        If "0" is specified, the 202 status code will be expected in response to a successful request.
        This status code is returned after event are validated and added to the buffer.
        The system does not wait until the event are saved to the database.
        The event will be stored in the database after the response is sent.

        If "1" is specified, the 201 status code will be expected in response to a successful request.
        This status code is returned only after event are stored in the database.

    no_cache:
      in: query
      name: no_cache
      schema:
        type: integer
        enum: [0, 1]
        default: 0
      description: Flag to disable handler caching.

    accept_config_handler:
      in: header
      name: Accept
      schema:
        type: string
        enum:
          - application/json
          - text/plain
        description: One of application/json, text/plain
      required: false
      description: acceptable type of receiving data
  schemas:
    Error:
      type: object
      properties:
        error_code:
          type: integer
          description: error code.
        desc:
          type: string
          description: short error description.
        detail:
          type: string
          description: error details.
      required:
      - error_code
      - detail
      - desc
      example:
        error_code: 11009
        detail: internal server error
        desc: internal server error

    common_id:
      description: user-defined id.
      type: string
      maxLength: 36
      example: "3.1415926"

    uuid:
      type: string
      format: uuid
      pattern: '^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$'
      example: "557d54ec-29ad-4f3c-93b4-c9092ef12515"

    tag:
      type: string
      example: "good"
      maxLength: 36

    attribute_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - nullable: true
      - description: Attribute id. Will be null if not stored.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    sample_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - nullable: true
      - description: Sample id. Will be null if not stored.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    field_external_id:
      description: user-defined external id
      type: string
      default: ""
      maxLength: 36
      example: "b668c4a5-2191-some-important-words"

    face_external_id:
      description: face external id
      allOf:
      - $ref: '#/components/schemas/field_external_id'

    event_external_id:
      description: event external id
      allOf:
      - $ref: '#/components/schemas/field_external_id'

    filter_external_id:
      description: objects whose `external_id` values are not equal to the filter will be filtered
      type: string
      maxLength: 36
      example: "b668c4a5-2191-some-important-words"

    face_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: face id.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    list_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: list id.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    event_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: event id.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    handler_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: handler id.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    account_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: account id.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    face_avatar:
      type: string
      format: uri-reference
      default: ""
      maxLength: 256
      description: avatar for the face, references to a sample or a user-defined reference.

    input_url:
      type: string
      format: uri-reference
      description: url

    count:
      type: integer
      minimum: 0
      description: object count.
      example: 100

    int01:
      type: integer
      default: 0
      enum: [0,1]

    int02:
      type: integer
      default: 1
      enum: [0,1,2]

    int0100:
      type: integer
      minimum: 0
      maximum: 100

    int0180:
      type: integer
      minimum: 0
      maximum: 180

    number01:
      type: number
      minimum: 0
      maximum: 1

    sdk_descriptor:
      type: string
      format: byte
      description: sdk descriptor (descriptor version, signature, descriptor bytes)

    time:
      type: string
      format: date-time
      example: "2018-08-11T09:11:41.674Z"
      description: time in format RFC 3339

    location_str:
      type: string
      maxLength: 36

    longitude:
      type: number
      minimum: -180
      maximum: 180
      description: longitude in degrees
      example: 36.616

    latitude:
      type: number
      minimum: -90
      maximum: 90
      description: latitude in degrees
      example: 55.752

    geo_position:
      type: object
      description: geo position specified by geographic coordinates - longitude and latitude.
      properties:
        longitude:
          $ref: '#/components/schemas/longitude'
        latitude:
          $ref: '#/components/schemas/latitude'
      required: [longitude, latitude]

    house_number:
      allOf:
      - $ref: '#/components/schemas/location_str'
      - description: house number where event is incidented
    city:
      allOf:
      - $ref: '#/components/schemas/location_str'
      - description: city where event is incidented
    area:
      allOf:
      - $ref: '#/components/schemas/location_str'
      - description: area where event is incidented
    district:
      allOf:
      - $ref: '#/components/schemas/location_str'
      - description: district where event is incidented
    street:
      allOf:
      - $ref: '#/components/schemas/location_str'
      - description: street where event is incidented

    location:
      type: object
      description: information about a place where event is incidented
      properties:
        city:
          allOf:
          - $ref: '#/components/schemas/city'
          - nullable: true
        area:
          allOf:
          - $ref: '#/components/schemas/area'
          - nullable: true
        district:
          allOf:
          - $ref: '#/components/schemas/district'
          - nullable: true
        street:
          allOf:
          - $ref: '#/components/schemas/street'
          - nullable: true
        house_number:
          allOf:
          - $ref: '#/components/schemas/house_number'
          - nullable: true
        geo_position:
          allOf:
            - $ref: '#/components/schemas/geo_position'
            - nullable: true

    input_location:
      type: object
      description: information about a place where event is incidented
      properties:
        city:
          $ref: '#/components/schemas/city'
        area:
          $ref: '#/components/schemas/area'
        district:
          $ref: '#/components/schemas/district'
        street:
          $ref: '#/components/schemas/street'
        house_number:
          $ref: '#/components/schemas/house_number'
        geo_position:
          $ref: '#/components/schemas/geo_position'

    multiface_policy:
      allOf:
        - $ref: '#/components/schemas/int02'
        - type: integer
        - description: |
            multiple face detection policy:

            - *`0`* - do not process images with several detected faces.

              If *`detect_body`* is enabled, the system will attempt to detect a human body related to the detected face. If a human body is detected, its detection will be associated with the same event as the face.

              If there is no face detected in the image, no human body detections will be returned. Thus there will be no human body detection returned if *`detect_face`* is disabled.


            - *`1`* - process images with several detected faces and/or human bodies.

              If *`detect_body`* is enabled, all the detections of human bodies will be returned. Face detection and human body detection of the same person will be associated with the same event.

              The detections of human bodies are returned even if there were no faces found.


            - *`2`* - get the best face detection from the image. A single face of the best quality is detected in the image.

              If *`detect_body`* is enabled, the system will attempt to detect a human body related to the detected face. If a human body is detected, its detection will be associated with the same event as the face.

              If there is no face detected in the image, no human body detections will be returned. Thus there will be no human body detection returned if *`detect_face`* is disabled.

    iso_multiface_policy:
      default: 0
      allOf:
        - $ref: '#/components/schemas/multiface_policy'

    estimate_head_pose:
      allOf:
      - $ref: '#/components/schemas/int01'
      description: |
        whether to estimate head pose on the image.

        *Not supported with warped images (see `warped_image` or `image_type` parameter).*

    estimate_emotions:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to estimate emotions on the image.

    estimate_quality:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to estimate input face image quality.

    estimate_gaze:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to estimate eye gaze on the image.

          *Not supported with warped images (see `warped_image` or `image_type` parameter).*

    estimate_eyes_attributes:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to estimate eye attributes on the image.

          *Not supported with warped images (see `warped_image` or `image_type` parameter).*

    estimate_mouth_attributes:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to estimate mouth attributes on the image.

    estimate_mask:
      allOf:
      - $ref: '#/components/schemas/int01'
      - description: |
          whether to estimate mask on the image.

    estimate_glasses:
      allOf:
      - $ref: '#/components/schemas/int01'
      - description: |
          whether to estimate glasses on the image.

    detect_landmarks68:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to detect basic 68-point facial landmarks on the image.

          *Not supported with warped images (see `warped_image` or `image_type` parameter).*

    detect_landmarks5:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to detect basic 5-point facial landmarks on the image.

          *Not supported with warped images (see `warped_image` or `image_type` parameter).*

    extract_exif:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          whether to extract EXIF meta information from input images.

          Exact output will vary since there are no mandatory requirements to both authoring software and digital cameras how to write the data.

          This function will only parse the tags and output their names and values as is. Please refer to JEITA CP-3451 EXIF specification for details.

    pitch_threshold:
      allOf:
      - $ref: '#/components/schemas/int0180'
      - type: integer
      - description: |
          maximum deviation pitch angle from 0.

    roll_threshold:
      allOf:
      - $ref: '#/components/schemas/int0180'
      - type: integer
      - description: |
          maximum deviation roll angle from 0.

    yaw_threshold:
      allOf:
      - $ref: '#/components/schemas/int0180'
      - type: integer
      - description: |
          maximum deviation yaw angle from 0.

    mask_states:
      type: array
      items:
        type: integer
        enum: [1, 2, 3]
      minItems: 1
      description: |
        filter by mask states

        | masks      | value |
        |----------------|---|
        | missing        | 1 |
        | medical_mask   | 2 |
        | occluded       | 3 |

    estimate_liveness:
      type: object
      properties:
        estimate:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: whether to estimate liveness on the image
          default: 0
        liveness_threshold:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: liveness estimation real score threshold
          default: 0.5
        quality_threshold:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: liveness estimation image quality threshold
          default: 0.5
      description: |
          liveness estimation configuration.

          ⚠ **Liveness v.2 licensing feature is required to be enabled to perform liveness estimation.**

    liveness_states:
      type: array
      items:
        type: integer
        enum: [ 0, 1, 2 ]
      minItems: 1
      description: |
        filter by liveness states

        | liveness   | value |
        |----------------|---|
        | spoof          | 0 |
        | real           | 1 |
        | unknown        | 2 |

    detect_face:
      allOf:
        - default: 1
        - $ref: '#/components/schemas/int01'
        - description: |
            whether to detect faces from the image.

    detect_body:
      allOf:
        - default: 0
        - $ref: '#/components/schemas/int01'
        - description: |
            whether to detect bodies from the image.

    extract_basic_attributes:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
        description: |
          whether to extract basic attributes (gender, age, ethnicity).

    extract_descriptor:
      allOf:
      - default: 1
      - $ref: '#/components/schemas/int01'
      - description: |
          whether to extract face descriptor(s).

    extract_body_descriptor:
      allOf:
        - default: 0
        - $ref: '#/components/schemas/int01'
        - description: |
            whether to extract body descriptor(s).

    aggregate_attributes:
      allOf:

      - type: integer
        enum: [0, 1]
        description: |
          whether to aggregate attribute(s).

          If true, all extracted attributes will be aggregated and stored as a single attribute.
          Otherwise, all attributes will be stored for each sample.
        default: 0

    score_threshold:
      type: number
      minimum: 0
      maximum: 1
      example: 0.99
      default: 0
      description: |
        face descriptor quality score threshold. All the attributes with quality score below the threshold will be
        ignored (and not stored in the DB). The function will proceed as usual with all the remaining descriptors
        (if left).

    gender:
      allOf:
        - $ref: '#/components/schemas/int01'
        - description: gender, 0 - female, 1 - male

    age:
      allOf:
        - $ref: '#/components/schemas/int0100'
        - description: Age

    object_user_data:
      description: user data assosiated with object.
      type: string
      maxLength: 128
      example: "some data"
      default: ""

    face_user_data:
      description: face user data
      allOf:
        - $ref: '#/components/schemas/object_user_data'

    event_user_data:
      description: event user data
      allOf:
        - $ref: '#/components/schemas/object_user_data'

    user_data_filter:
      description: Objects whose `user_data` values are not contain the filter will be filtered.
      type: string
      maxLength: 128
      example: "some data"

    is_dynamic:
      description: dynamic handler flag (a handler without policies; use it to send policies while emiting each event)
      type: boolean
      default: false

    image_format_threshold:
      type: array
      items:
        type: string
        enum: [ JPEG, JPEG2000, PNG ]
      minItems: 1
      default: [ JPEG, JPEG2000, PNG ]
      description: list of allowed image formats

    estimate_flag:
      type: integer
      enum: [0, 1]
      default: 1
      description: whether to enable estimation

    check_base:
      type: object
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
      required: [estimate]

    image_format_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/image_format_threshold'
        - description: image format check

    image_format_check_required:
      allOf:
        - $ref: '#/components/schemas/image_format_check'
        - required:
            - estimate
            - threshold

    base_float_min_threshold:
      type: number
      nullable: false
      description: exclusive lower bound of the allowed range
      example: 0.0

    base_float_max_threshold:
      type: number
      nullable: false
      description: exclusive upper bound of the allowed range
      example: 0.0

    base_int_min_threshold:
      type: integer
      nullable: false
      description: exclusive lower bound of the allowed range
      example: 0

    base_int_max_threshold:
      type: integer
      nullable: false
      description: exclusive upper bound of the allowed range
      example: 0

    base_float_threshold:
      type: object
      description: allowed range of the estimation value

    check_threshold_inclusive_int_positive:
      type: object
      description: allowed range of the estimation value
      properties:
        min:
          allOf:
            - description: inclusive lower bound of the allowed range
            - $ref: '#/components/schemas/base_int_min_threshold'
            - minimum: 0
        max:
          allOf:
            - description: inclusive upper bound of the allowed range
            - $ref: '#/components/schemas/base_int_max_threshold'
            - nullable: true
            - minimum: 0

    check_threshold_float_0_1:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - $ref: '#/components/schemas/base_float_min_threshold'
                - minimum: 0.0
                - maximum: 1.0
            max:
              allOf:
                - $ref: '#/components/schemas/base_float_max_threshold'
                - minimum: 0.0
                - maximum: 1.0

    check_threshold_float_180_180:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - $ref: '#/components/schemas/base_float_min_threshold'
                - minimum: -180.0
                - maximum: 180.0
            max:
              allOf:
                - $ref: '#/components/schemas/base_float_max_threshold'
                - minimum: -180.0
                - maximum: 180.0

    check_threshold_float_positive:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - $ref: '#/components/schemas/base_float_min_threshold'
                - description: inclusive lower bound of the allowed range
                - minimum: 0.0
            max:
              allOf:
                - $ref: '#/components/schemas/base_float_max_threshold'
                - description: inclusive upper bound of the allowed range
                - minimum: 0.0
                - nullable: true

    illumination_quality_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.5
            max: 1.0
        - example:
            min: 0.3
            max: 0.9

    illumination_quality_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/illumination_quality_threshold'
        - description: image quality check for uniformity of illumination

    illumination_quality_check_required:
      allOf:
        - $ref: '#/components/schemas/illumination_quality_check'
        - required:
            - estimate
            - threshold

    specularity_quality_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.3
            max: 1.0
        - example:
            min: 0.3
            max: 0.9

    specularity_quality_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/specularity_quality_threshold'
        - description: image quality check for specularity

    specularity_quality_check_required:
      allOf:
        - $ref: '#/components/schemas/specularity_quality_check'
        - required:
            - estimate
            - threshold

    blurriness_quality_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.61
            max: 1.0
        - example:
            min: 0.3
            max: 0.9

    blurriness_quality_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/blurriness_quality_threshold'
        - description: image quality check for blurriness

    blurriness_quality_check_required:
      allOf:
        - $ref: '#/components/schemas/blurriness_quality_check'
        - required:
            - estimate
            - threshold

    dark_quality_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.5
            max: 1.0
        - example:
            min: 0.3
            max: 0.9

    dark_quality_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/dark_quality_threshold'
        - description: image quality check for underexposure

    dark_quality_check_required:
      allOf:
        - $ref: '#/components/schemas/dark_quality_check'
        - required:
            - estimate
            - threshold

    light_quality_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.57
            max: 1.0
        - example:
            min: 0.3
            max: 0.9

    light_quality_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/light_quality_threshold'
        - description: image quality check for overexposure

    light_quality_check_required:
      allOf:
        - $ref: '#/components/schemas/light_quality_check'
        - required:
            - estimate
            - threshold

    head_angles_threshold:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - description: inclusive lower bound of the allowed range
                - $ref: '#/components/schemas/base_float_min_threshold'
                - minimum: -180.0
                - maximum: 180.0
            max:
              allOf:
                - description: inclusive upper bound of the allowed range
                - $ref: '#/components/schemas/base_float_max_threshold'
                - minimum: -180.0
                - maximum: 180.0

    head_yaw_threshold:
      allOf:
        - $ref: '#/components/schemas/head_angles_threshold'
        - default:
            min: -5.0
            max: 5.0
        - example:
            min: 0.3
            max: 0.9

    head_yaw_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_yaw_threshold'
        - description: head yaw check

    head_yaw_check_required:
      allOf:
        - $ref: '#/components/schemas/head_yaw_check'
        - required:
            - estimate
            - threshold

    head_pitch_threshold:
      allOf:
        - $ref: '#/components/schemas/head_angles_threshold'
        - default:
            min: -5.0
            max: 5.0
        - example:
            min: 0.3
            max: 0.9

    head_pitch_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_pitch_threshold'
        - description: head pitch check

    head_pitch_check_required:
      allOf:
        - $ref: '#/components/schemas/head_pitch_check'
        - required:
            - estimate
            - threshold

    head_roll_threshold:
      allOf:
        - $ref: '#/components/schemas/head_angles_threshold'
        - default:
            min: -8.0
            max: 8.0
        - example:
            min: 0.3
            max: 0.9

    head_roll_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_roll_threshold'
        - description: head roll check

    head_roll_check_required:
      allOf:
        - $ref: '#/components/schemas/head_roll_check'
        - required:
            - estimate
            - threshold

    gaze_yaw_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_180_180'
        - default:
            min: -5.0
            max: 5.0
        - example:
            min: 0.3
            max: 0.9

    gaze_yaw_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/gaze_yaw_threshold'
        - description: gaze yaw check

    gaze_yaw_check_required:
      allOf:
        - $ref: '#/components/schemas/gaze_yaw_check'
        - required:
            - estimate
            - threshold

    gaze_pitch_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_180_180'
        - default:
            min: -5.0
            max: 5.0
        - example:
            min: 0.3
            max: 0.9

    gaze_pitch_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/gaze_pitch_threshold'
        - description: gaze pitch check

    gaze_pitch_check_required:
      allOf:
        - $ref: '#/components/schemas/gaze_pitch_check'
        - required:
            - estimate
            - threshold

    mouth_threshold:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - $ref: '#/components/schemas/base_float_min_threshold'
                - minimum: -1.0
                - maximum: 1.0
            max:
              allOf:
                - description: inclusive upper bound of the allowed range
                - $ref: '#/components/schemas/base_float_max_threshold'
                - minimum: -1.0
                - maximum: 1.0

    mouth_smiling_threshold:
      allOf:
        - $ref: '#/components/schemas/mouth_threshold'
        - default:
            min: 0.0
            max: 0.5
        - example:
            min: 0.3
            max: 0.9

    mouth_smiling_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/mouth_smiling_threshold'
        - description: mouth smiling check

    mouth_smiling_check_required:
      allOf:
        - $ref: '#/components/schemas/mouth_smiling_check'
        - required:
            - estimate
            - threshold

    mouth_occluded_threshold:
      allOf:
        - $ref: '#/components/schemas/mouth_threshold'
        - default:
            min: 0.0
            max: 0.3
        - example:
            min: 0.3
            max: 0.9

    mouth_occluded_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/mouth_occluded_threshold'
        - description: mouth occluded check

    mouth_occluded_check_required:
      allOf:
        - $ref: '#/components/schemas/mouth_occluded_check'
        - required:
            - estimate
            - threshold

    mouth_open_threshold:
      allOf:
        - $ref: '#/components/schemas/mouth_threshold'
        - default:
            min: 0.0
            max: 0.44
        - example:
            min: 0.3
            max: 0.9

    mouth_open_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/mouth_open_threshold'
        - description: mouth open check

    mouth_open_check_required:
      allOf:
        - $ref: '#/components/schemas/mouth_open_check'
        - required:
            - estimate
            - threshold

    glasses_threshold:
      type: array
      items:
        type: string
        enum: [ "no_glasses", "eyeglasses", "sunglasses" ]
      minItems: 1
      default: ["no_glasses", "eyeglasses"]
      description: list of image formats allowed by standard

    glasses_threshold_required:
      allOf:
        - $ref: '#/components/schemas/glasses_threshold'
        - required:
            - estimate
            - threshold

    glasses_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/glasses_threshold'
        - description: glasses check

    glasses_check_required:
      allOf:
        - $ref: '#/components/schemas/glasses_check'
        - required:
            - estimate
            - threshold

    eye_threshold:
      type: array
      items:
        type: string
        enum: [ "open", "occluded", "closed" ]
      minItems: 1
      default: ["open"]
      description: list of image formats allowed by standard

    eye_threshold_required:
      allOf:
        - $ref: '#/components/schemas/eye_threshold'
        - required:
            - estimate
            - threshold

    left_eye_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/eye_threshold'
        - description: left eye check

    left_eye_check_required:
      allOf:
        - $ref: '#/components/schemas/left_eye_check'
        - required:
            - estimate
            - threshold

    right_eye_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/eye_threshold'
        - description: right eye check

    right_eye_check_required:
      allOf:
        - $ref: '#/components/schemas/right_eye_check'
        - required:
            - estimate
            - threshold

    head_horizontal_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.45
            max: 0.55

    head_horizontal_center_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_horizontal_threshold'
        - description: check for horizontal position of face center point relative to image | not available for warped images

    head_horizontal_center_check_required:
      allOf:
        - $ref: '#/components/schemas/head_horizontal_center_check'
        - required:
            - estimate
            - threshold

    head_vertical_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_0_1'
        - default:
            min: 0.3
            max: 0.5

    head_vertical_center_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_vertical_threshold'
        - description: check for vertical position of face center point relative to image | not available for warped images

    head_vertical_center_check_required:
      allOf:
        - $ref: '#/components/schemas/head_vertical_center_check'
        - required:
            - estimate
            - threshold

    head_width_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_positive'
        - default:
            min: 0.5
            max: 0.75

    head_width_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_width_threshold'
        - description: check for horizontal head size relative to image size | not available for warped images

    head_width_check_required:
      allOf:
        - $ref: '#/components/schemas/head_width_check'
        - required:
            - estimate
            - threshold

    head_height_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_positive'
        - default:
            min: 0.6
            max: 0.9

    head_height_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/head_height_threshold'
        - description: check for vertical head size relative to image size | not available for warped images

    head_height_check_required:
      allOf:
        - $ref: '#/components/schemas/head_height_check'
        - required:
            - estimate
            - threshold

    eye_distance_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_positive'
        - default:
            min: 90.0
        - example:
            min: 91.1
            max: 92.2

    eye_distance_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/eye_distance_threshold'
        - description: eye distance check | not available for warped images

    eye_distance_check_required:
      allOf:
        - $ref: '#/components/schemas/eye_distance_check'
        - required:
            - estimate
            - threshold

    image_width_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 180
            max: 1920

    image_width_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/image_width_threshold'
        - description: image width check

    image_width_check_required:
      allOf:
        - $ref: '#/components/schemas/image_width_check'
        - required:
            - estimate
            - threshold

    image_height_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 180
            max: 1080

    image_height_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/image_height_threshold'
        - description: image height check

    image_height_check_required:
      allOf:
        - $ref: '#/components/schemas/image_height_check'
        - required:
            - estimate
            - threshold

    aspect_ratio_threshold:
      allOf:
        - $ref: '#/components/schemas/check_threshold_float_positive'
        - default:
            min: 0.74
            max: 0.8

    aspect_ratio_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/aspect_ratio_threshold'
        - description: image aspect ratio check

    aspect_ratio_check_required:
      allOf:
        - $ref: '#/components/schemas/aspect_ratio_check'
        - required:
            - estimate
            - threshold

    face_width_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 180

    face_width_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/face_width_threshold'
        - description: face width check | not available for warped images

    face_width_check_required:
      allOf:
        - $ref: '#/components/schemas/face_height_check'
        - required:
            - estimate
            - threshold

    face_height_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 180

    face_height_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/face_height_threshold'
        - description: face height check | not available for warped images

    face_height_check_required:
      allOf:
        - $ref: '#/components/schemas/face_height_check'
        - required:
            - estimate
            - threshold

    indent_left_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 20

    indent_left_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/indent_left_threshold'
        - description: check for indent from the left image border to the left face border | not available for warped images

    indent_left_check_required:
      allOf:
        - $ref: '#/components/schemas/indent_left_check'
        - required:
            - estimate
            - threshold

    indent_right_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 20

    indent_right_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/indent_right_threshold'
        - description: check for indent from the right image border to the right face border | not available for warped images

    indent_right_check_required:
      allOf:
        - $ref: '#/components/schemas/indent_right_check'
        - required:
            - estimate
            - threshold

    indent_upper_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 20

    indent_upper_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/indent_upper_threshold'
        - description: check for indent from the upper image border to the upper face border | not available for warped images

    indent_upper_check_required:
      allOf:
        - $ref: '#/components/schemas/indent_upper_check'
        - required:
            - estimate
            - threshold

    indent_lower_threshold:
      allOf:
        - description: allowed range of the estimation value (in pixels)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 20

    indent_lower_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/indent_lower_threshold'
        - description: check for indent from the lower image border to the lower face border | not available for warped images

    indent_lower_check_required:
      allOf:
        - $ref: '#/components/schemas/indent_lower_check'
        - required:
            - estimate
            - threshold

    image_size_threshold:
      allOf:
        - description: allowed range of the estimation value (in bytes)
        - $ref: '#/components/schemas/check_threshold_inclusive_int_positive'
        - default:
            min: 5120
            max: 2097152

    image_size_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/image_size_threshold'
        - description: image size check

    image_size_check_required:
      allOf:
        - $ref: '#/components/schemas/image_size_check'
        - required:
            - estimate
            - threshold

    illumination_uniformity_threshold:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - minimum: 0.0
                - maximum: 1.0
                - description: inclusive lower bound of the allowed range
                - $ref: '#/components/schemas/base_float_min_threshold'
            max:
              allOf:
                - minimum: 0.0
                - maximum: 1.0
                - description: inclusive lower bound of the allowed range
                - $ref: '#/components/schemas/base_float_max_threshold'
        - default:
            min: 0.5
            max: 1.0

    illumination_uniformity_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/illumination_uniformity_threshold'
        - description: illumination uniformity check | not available for warped images

    illumination_uniformity_check_required:
      allOf:
        - $ref: '#/components/schemas/illumination_uniformity_check'
        - required:
            - estimate
            - threshold

    dynamic_range_threshold:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - minimum: 0.0
                - maximum: 1.0
                - description: inclusive lower bound of the allowed range
                - $ref: '#/components/schemas/base_float_min_threshold'
            max:
              allOf:
                - minimum: 0.0
                - maximum: 1.0
                - description: inclusive lower bound of the allowed range
                - $ref: '#/components/schemas/base_float_max_threshold'
        - default:
            min: 0.5
            max: 1.0

    dynamic_range_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/dynamic_range_threshold'
        - description: dynamic range of facial skin tone (eliminate extremely light or dark skin tone) | not available for warped images

    dynamic_range_check_required:
      allOf:
        - $ref: '#/components/schemas/dynamic_range_check'
        - required:
            - estimate
            - threshold

    smile:
      type: string
      enum: ["none", "smile_lips", "smile_teeth"]

    smile_threshold:
      type: array
      items:
        $ref: '#/components/schemas/smile'
      description: list of successful values
      minItems: 1

    smile_properties_check:
      type: object
      description: smile_properties check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: array
          items:
            $ref: '#/components/schemas/smile'
          description: list of successful values
          minItems: 1
          default: ["none"]
      required: [estimate]

    smile_properties_check_required:
      allOf:
        - $ref: '#/components/schemas/smile_properties_check'
        - required:
            - estimate
            - threshold

    smile_properties:
      type: object
      properties:
        name:
          type: string
          enum: ["smile_properties"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/smile'
            - nullable: true
              description: smile_properties estimated value
        threshold_value:
          $ref: '#/components/schemas/smile_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]
      description: smile_properties check

    smile_properties_iso:
      title: smile_properties
      type: object
      properties:
        name:
          type: string
          enum: ["smile_properties"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/smile'
            - nullable: true
              description: smile_properties estimated value
        threshold_value:
          type: array
          items:
            enum: ["none"]
          description: list of values to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]
      description: smile_properties check

    headwear:
      type: string
      enum: ["none", "baseball_cap", "beanie", "peaked_cap", "shawl", "hat_with_earflaps", "helmet", "hood", "hat", "other"]

    headwear_threshold:
      type: array
      items:
        $ref: '#/components/schemas/headwear'
      description: list of values to consider successful
      minItems: 1

    headwear_type_check:
      type: object
      description: headwear_type check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: array
          items:
            $ref: '#/components/schemas/headwear'
          description: list of values to consider successful
          minItems: 1
          default: ["none"]
      required: [estimate]

    headwear_type_check_required:
      allOf:
        - $ref: '#/components/schemas/headwear_type_check'
        - required:
            - estimate
            - threshold

    headwear_type:
      description: headwear_type check
      type: object
      properties:
        name:
          type: string
          enum: ["headwear_type"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/headwear'
            - nullable: true
              description: estimated value for headwear_type
        threshold_value:
          $ref: '#/components/schemas/headwear_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    headwear_type_iso:
      title: headwear_type
      description: headwear_type check
      type: object
      properties:
        name:
          type: string
          enum: ["headwear_type"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/headwear'
            - nullable: true
              description: estimated value for headwear_type
        threshold_value:
          type: array
          items:
            enum: ["none"]
          description: list of values to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    bool_threshold:
      type: integer
      enum: [ 0, 1 ]
      description: value to consider successful

    radial_distortion_check:
      type: object
      description: radial_distortion check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: integer
          enum: [ 0, 1 ]
          default: 0
          description: value to consider successful
      required: [estimate]

    radial_distortion_check_required:
      allOf:
        - $ref: '#/components/schemas/radial_distortion_check'
        - required:
            - estimate
            - threshold

    radial_distortion:
      description: radial_distortion check
      type: object
      properties:
        name:
          type: string
          enum: ["radial_distortion"]
          description: unique estimation name
        object_value:
          nullable: true
          type: integer
          enum: [ 0, 1 ]
          description: estimated value, 1 - the detection has a radial distortion, 0 - there is no radial distortion
        threshold_value:
          $ref: '#/components/schemas/bool_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    radial_distortion_iso:
      title: radial_distortion
      description: radial_distortion check
      type: object
      properties:
        name:
          type: string
          enum: ["radial_distortion"]
          description: unique estimation name
        object_value:
          nullable: true
          type: integer
          enum: [ 0, 1 ]
          description: estimated value, 1 - the detection has a radial distortion, 0 - there is no radial distortion
        threshold_value:
          type: integer
          enum: [0]
          description: value to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    red_eyes_check:
      type: object
      description: red_eyes check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: integer
          enum: [ 0, 1 ]
          default: 0
          description: value to consider successful
      required: [estimate]

    red_eyes_check_required:
      allOf:
        - $ref: '#/components/schemas/red_eyes_check'
        - required:
            - estimate
            - threshold

    red_eyes:
      type: object
      description: red_eyes check
      properties:
        name:
          type: string
          enum: ["red_eyes"]
          description: unique estimation name
        object_value:
          nullable: true
          type: integer
          enum: [ 0, 1 ]
          description: estimated value, 1 - the detection has a red-eye effect, 0 - there is no red-eye effect
        threshold_value:
          $ref: '#/components/schemas/bool_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    red_eyes_iso:
      title: red_eyes
      type: object
      description: red_eyes check
      properties:
        name:
          type: string
          enum: ["red_eyes"]
          description: unique estimation name
        object_value:
          nullable: true
          type: integer
          enum: [ 0, 1 ]
          description: estimated value, 1 - the detection has a red-eye effect, 0 - there is no red-eye effect
        threshold_value:
          type: integer
          enum: [0]
          description: value to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    natural_light_check:
      type: object
      description: natural_light check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: integer
          enum: [ 0, 1 ]
          default: 1
          description: value to consider successful
      required: [estimate]

    natural_light_check_required:
      allOf:
        - $ref: '#/components/schemas/natural_light_check'
        - required:
            - estimate
            - threshold

    natural_light:
      type: object
      properties:
        name:
          type: string
          enum: ["natural_light"]
          description: unique estimation name
        object_value:
          nullable: true
          type: integer
          enum: [ 0, 1 ]
          description: estimated value, 1 - detected face has a natural light, 0 - face lighting is not natural
        threshold_value:
          $ref: '#/components/schemas/bool_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]
      description: natural_light estimation

    natural_light_iso:
      title: natural_light
      type: object
      properties:
        name:
          type: string
          enum: ["natural_light"]
          description: unique estimation name
        object_value:
          nullable: true
          type: integer
          enum: [ 0, 1 ]
          description: estimated value, 1 - detected face has a natural light, 0 - face lighting is not natural
        threshold_value:
          type: integer
          enum: [1]
          description: value to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]
      description: natural_light estimation

    eyebrow:
      type: string
      enum: ["squinting", "frowning", "raised", "neutral"]

    eyebrows_threshold:
      type: array
      items:
        $ref: '#/components/schemas/eyebrow'
      description: list of values to consider successful
      minItems: 1

    eyebrows_state_check:
      type: object
      description: eyebrows_type check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: array
          items:
            $ref: '#/components/schemas/eyebrow'
          description: list of values to consider successful
          minItems: 1
          default: ["neutral"]
      required: [estimate]

    eyebrows_state_check_required:
      allOf:
        - $ref: '#/components/schemas/eyebrows_state_check'
        - required:
            - estimate
            - threshold

    eyebrows_state:
      description: eyebrows_state check
      type: object
      properties:
        name:
          type: string
          enum: ["eyebrows_state"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/eyebrow'
            - nullable: true
              description: eyebrows_state estimated value
        threshold_value:
          $ref: '#/components/schemas/eyebrows_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    eyebrows_state_iso:
      title: eyebrows_state
      description: eyebrows_state check
      type: object
      properties:
        name:
          type: string
          enum: ["eyebrows_state"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/eyebrow'
            - nullable: true
              description: eyebrows_state estimated value
        threshold_value:
          type: array
          items:
            type: string
            enum: ["neutral"]
          description: list of values to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    face_color:
      type: string
      enum: ["color", "grayscale", "infrared"]

    face_color_type_threshold:
      type: array
      items:
        $ref: '#/components/schemas/face_color'
      description: list of values to consider successful
      minItems: 1

    face_color_type_check:
      type: object
      description: face_color_type check configuration
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: array
          items:
            $ref: '#/components/schemas/face_color'
          description: list of values to consider successful
          minItems: 1
          default: ["color"]
      required: [estimate]

    face_color_type_check_required:
      allOf:
        - $ref: '#/components/schemas/face_color_type_check'
        - required:
            - estimate
            - threshold

    face_color_type:
      type: object
      description: face_color_type check
      properties:
        name:
          type: string
          enum: ["face_color_type"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/face_color'
            - nullable: true
              description: face_color_type estimated value
        threshold_value:
          $ref: '#/components/schemas/face_color_type_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    face_color_type_iso:
      title: face_color_type
      description: face_color_type check
      type: object
      properties:
        name:
          type: string
          enum: ["face_color_type"]
          description: unique estimation name
        object_value:
          allOf:
            - $ref: '#/components/schemas/face_color'
            - nullable: true
              description: face_color_type estimated value
        threshold_value:
          type: array
          items:
            type: string
            enum: ["grayscale", "color"]
          description: list of values to consider successful
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    face_quality_checks:
      type: object
      description: face quality checks and filters
      properties:
        image_format:
          $ref: '#/components/schemas/image_format_check'
        illumination_quality:
          $ref: '#/components/schemas/illumination_quality_check'
        specularity_quality:
          $ref: '#/components/schemas/specularity_quality_check'
        blurriness_quality:
          $ref: '#/components/schemas/blurriness_quality_check'
        dark_quality:
          $ref: '#/components/schemas/dark_quality_check'
        light_quality:
          $ref: '#/components/schemas/light_quality_check'
        head_yaw:
          $ref: '#/components/schemas/head_yaw_check'
        head_pitch:
          $ref: '#/components/schemas/head_pitch_check'
        head_roll:
          $ref: '#/components/schemas/head_roll_check'
        gaze_yaw:
          $ref: '#/components/schemas/gaze_yaw_check'
        gaze_pitch:
          $ref: '#/components/schemas/gaze_pitch_check'
        mouth_smiling:
          $ref: '#/components/schemas/mouth_smiling_check'
        mouth_occluded:
          $ref: '#/components/schemas/mouth_occluded_check'
        mouth_open:
          $ref: '#/components/schemas/mouth_open_check'
        glasses:
          $ref: '#/components/schemas/glasses_check'
        left_eye:
          $ref: '#/components/schemas/left_eye_check'
        right_eye:
          $ref: '#/components/schemas/right_eye_check'
        head_horizontal_center:
          $ref: '#/components/schemas/head_horizontal_center_check'
        head_vertical_center:
          $ref: '#/components/schemas/head_vertical_center_check'
        head_width:
          $ref: '#/components/schemas/head_width_check'
        head_height:
          $ref: '#/components/schemas/head_height_check'
        eye_distance:
          $ref: '#/components/schemas/eye_distance_check'
        image_width:
          $ref: '#/components/schemas/image_width_check'
        image_height:
          $ref: '#/components/schemas/image_height_check'
        aspect_ratio:
          $ref: '#/components/schemas/aspect_ratio_check'
        face_width:
          $ref: '#/components/schemas/face_width_check'
        face_height:
          $ref: '#/components/schemas/face_height_check'
        indent_left:
          $ref: '#/components/schemas/indent_left_check'
        indent_right:
          $ref: '#/components/schemas/indent_right_check'
        indent_upper:
          $ref: '#/components/schemas/indent_upper_check'
        indent_lower:
          $ref: '#/components/schemas/indent_lower_check'
        image_size:
          $ref: '#/components/schemas/image_size_check'
        eyebrows_state:
          $ref: '#/components/schemas/eyebrows_state_check'
        headwear_type:
          $ref: '#/components/schemas/headwear_type_check'
        smile_properties:
          $ref: '#/components/schemas/smile_properties_check'
        face_color_type:
          $ref: '#/components/schemas/face_color_type_check'
        natural_light:
          $ref: '#/components/schemas/natural_light_check'
        red_eyes:
          $ref: '#/components/schemas/red_eyes_check'
        radial_distortion:
          $ref: '#/components/schemas/radial_distortion_check'
        illumination_uniformity:
          $ref: '#/components/schemas/illumination_uniformity_check'
        dynamic_range:
          $ref: '#/components/schemas/dynamic_range_check'

    face_quality_checks_required:
      type: object
      description: face quality checks and filters
      properties:
        image_format:
          $ref: '#/components/schemas/image_format_check_required'
        illumination_quality:
          $ref: '#/components/schemas/illumination_quality_check_required'
        specularity_quality:
          $ref: '#/components/schemas/specularity_quality_check_required'
        blurriness_quality:
          $ref: '#/components/schemas/blurriness_quality_check_required'
        dark_quality:
          $ref: '#/components/schemas/dark_quality_check_required'
        light_quality:
          $ref: '#/components/schemas/light_quality_check_required'
        head_yaw:
          $ref: '#/components/schemas/head_yaw_check_required'
        head_pitch:
          $ref: '#/components/schemas/head_pitch_check_required'
        head_roll:
          $ref: '#/components/schemas/head_roll_check_required'
        gaze_yaw:
          $ref: '#/components/schemas/gaze_yaw_check_required'
        gaze_pitch:
          $ref: '#/components/schemas/gaze_pitch_check_required'
        mouth_smiling:
          $ref: '#/components/schemas/mouth_smiling_check_required'
        mouth_occluded:
          $ref: '#/components/schemas/mouth_occluded_check_required'
        mouth_open:
          $ref: '#/components/schemas/mouth_open_check_required'
        glasses:
          $ref: '#/components/schemas/glasses_check_required'
        left_eye:
          $ref: '#/components/schemas/left_eye_check_required'
        right_eye:
          $ref: '#/components/schemas/right_eye_check_required'
        head_horizontal_center:
          $ref: '#/components/schemas/head_horizontal_center_check_required'
        head_vertical_center:
          $ref: '#/components/schemas/head_vertical_center_check_required'
        head_width:
          $ref: '#/components/schemas/head_width_check_required'
        head_height:
          $ref: '#/components/schemas/head_height_check_required'
        eye_distance:
          $ref: '#/components/schemas/eye_distance_check_required'
        image_width:
          $ref: '#/components/schemas/image_width_check_required'
        image_height:
          $ref: '#/components/schemas/image_height_check_required'
        aspect_ratio:
          $ref: '#/components/schemas/aspect_ratio_check_required'
        face_width:
          $ref: '#/components/schemas/face_width_check_required'
        face_height:
          $ref: '#/components/schemas/face_height_check_required'
        indent_left:
          $ref: '#/components/schemas/indent_left_check_required'
        indent_right:
          $ref: '#/components/schemas/indent_right_check_required'
        indent_upper:
          $ref: '#/components/schemas/indent_upper_check_required'
        indent_lower:
          $ref: '#/components/schemas/indent_lower_check_required'
        image_size:
          $ref: '#/components/schemas/image_size_check_required'
        eyebrows_state:
          $ref: '#/components/schemas/eyebrows_state_check_required'
        headwear_type:
          $ref: '#/components/schemas/headwear_type_check_required'
        smile_properties:
          $ref: '#/components/schemas/smile_properties_check_required'
        face_color_type:
          $ref: '#/components/schemas/face_color_type_check_required'
        natural_light:
          $ref: '#/components/schemas/natural_light_check_required'
        red_eyes:
          $ref: '#/components/schemas/red_eyes_check_required'
        radial_distortion:
          $ref: '#/components/schemas/radial_distortion_check_required'
        illumination_uniformity:
          $ref: '#/components/schemas/illumination_uniformity_check_required'
        dynamic_range:
          $ref: '#/components/schemas/dynamic_range_check_required'
      required: [image_format, illumination_quality, specularity_quality, blurriness_quality, dark_quality,
                 light_quality, head_yaw, head_pitch, head_roll, gaze_yaw, gaze_pitch, mouth_smiling, mouth_occluded,
                 mouth_open, glasses, left_eye, right_eye, head_horizontal_center, head_vertical_center, head_width,
                 head_height, eye_distance, image_width, image_height, aspect_ratio, face_width, face_height,
                 eyebrows_state, headwear_type, smile_properties, face_color_type, natural_light, red_eyes, radial_distortion,
                 indent_left, indent_right, indent_lower, indent_upper, image_size, illumination_uniformity, dynamic_range]

    face_quality:
      type: object
      description: |
        face quality estimations checks

        It enables you to perform various face quality checks by manually specifying thresholds.

        ⚠ **ISO licensing feature is required to be enabled to perform face quality estimation.**
      properties:
        estimate:
          type: integer
          enum: [0, 1]
          default: 0
          description: whether to estimate face quality
        filter:
          type: integer
          enum: [0, 1]
          default: 0

          description: |
            whether to enable face quality filtering

            If one of the `face_quality` checks for the detection fails, then the results and the reason for filtering will be returned. No further policies will be performed for this detection.
        checks:
          $ref: '#/components/schemas/face_quality_checks'

    detect_policy:
      type: object
      properties:
        detect_face:
          $ref: '#/components/schemas/detect_face'

        detect_body:
          $ref: '#/components/schemas/detect_body'

        multiface_policy:
          $ref: '#/components/schemas/multiface_policy'

        estimate_head_pose:
          $ref: '#/components/schemas/estimate_head_pose'

        estimate_emotions:
          $ref: '#/components/schemas/estimate_emotions'

        estimate_mask:
          $ref: '#/components/schemas/estimate_mask'

        estimate_quality:
          $ref: '#/components/schemas/estimate_quality'

        estimate_gaze:
          $ref: '#/components/schemas/estimate_gaze'

        estimate_eyes_attributes:
          $ref: '#/components/schemas/estimate_eyes_attributes'

        estimate_mouth_attributes:
          $ref: '#/components/schemas/estimate_mouth_attributes'

        detect_landmarks68:
          $ref: '#/components/schemas/detect_landmarks68'

        extract_exif:
          $ref: '#/components/schemas/extract_exif'

        yaw_threshold:
          allOf:
            - $ref: '#/components/schemas/yaw_threshold'
            - nullable: true

        roll_threshold:
          allOf:
            - $ref: '#/components/schemas/roll_threshold'
            - nullable: true

        pitch_threshold:
          allOf:
            - $ref: '#/components/schemas/pitch_threshold'
            - nullable: true

        mask_states:
          allOf:
            - $ref: '#/components/schemas/mask_states'
            - nullable: true

        estimate_liveness:
          $ref: '#/components/schemas/estimate_liveness'

        liveness_states:
          allOf:
            - $ref: '#/components/schemas/liveness_states'
            - nullable: true

        face_quality:
          $ref: '#/components/schemas/face_quality'

      description:  |
        policy determinates parameters for face and/or body detection.

        > **NOTE** If *`detect_face`* parameter is set to 0, all face detection targets & filters
        (i.e. *`estimate_head_pose`*, *`estimate_emotions`*, *`estimate_quality`*, *`estimate_gaze`*, *`estimate_eyes_attributes`*,
        *`estimate_mouth_attributes`*, *`detect_landmarks68`*, *`yaw_threshold`*, *`roll_threshold`*, *`pitch_threshold`*, *`mask_states`*,
        *`estimate_liveness`*, *`liveness_states`*, *`face_quality`*)
        will be ignored.

    face_quality_required:
      allOf:
        - $ref: '#/components/schemas/face_quality'
        - properties:
            checks:
              $ref: '#/components/schemas/face_quality_checks_required'
        - required:
          - estimate
          - filter
          - checks

    detect_policy_required:
      allOf:
        - $ref: '#/components/schemas/detect_policy'
        - properties:
            face_quality:
              $ref: '#/components/schemas/face_quality_required'
        - required:
          - detect_face
          - detect_body
          - multiface_policy
          - estimate_head_pose
          - estimate_emotions
          - estimate_mask
          - estimate_quality
          - estimate_gaze
          - estimate_eyes_attributes
          - estimate_mouth_attributes
          - detect_landmarks68
          - extract_exif
          - yaw_threshold
          - pitch_threshold
          - roll_threshold
          - mask_states
          - estimate_liveness
          - liveness_states
          - face_quality

    extract_policy:
      type: object
      properties:
        extract_basic_attributes:
          $ref: '#/components/schemas/extract_basic_attributes'

        extract_face_descriptor:
          $ref: '#/components/schemas/extract_descriptor'

        fd_score_threshold:
          $ref: '#/components/schemas/score_threshold'

        extract_body_descriptor:
          $ref: '#/components/schemas/extract_body_descriptor'
      description: policy determinates parameters for attributes extraction.

    extract_policy_required:
      allOf:
        - $ref: '#/components/schemas/extract_policy'
        - required: [extract_basic_attributes, extract_face_descriptor, fd_score_threshold, extract_body_descriptor]

    gender_filter:
      type: integer
      enum: [0, 1]
      description: Gender. 1 - male, 0 - female.
      example: 1

    age_lt_filter:
      allOf:
        - description: lower excluded bound for reference age.
        - example: 30
        - $ref: '#/components/schemas/age'

    age_gte_filter:
      allOf:
        - description: upper included bound for reference age.
        - example: 30
        - $ref: '#/components/schemas/age'

    liveness_filter:
      type: array
      description: array of allowed liveness statuses
      items:
        type: integer
        description: "liveness value: 0 - spoof, 1 - real, 2 - unknown"
        enum: [0, 1, 2]

    ethnicities_enum:
      type: array
      items:
        type: integer
        enum: [1, 2, 3, 4]
      minItems: 1
      description: |
        reference ethnicity

        | ethnicity   | value |
        |-----------------|---|
        | AfricanAmerican | 1 |
        | Indian          | 2 |
        | Asian           | 3 |
        | Caucasian       | 4 |

    emotions_enum:
      description: |
        predominant emotions.

        | emotions    | value |
        |-----------------|---|
        | anger           | 1 |
        | disgust         | 2 |
        | fear            | 3 |
        | happiness       | 4 |
        | neutral         | 5 |
        | sadness         | 6 |
        | surprise        | 7 |

      type: array
      items:
        $ref: '#/components/schemas/emotion'

    masks_enum:
      description: |
        predominant masks.

        | masks      | value |
        |----------------|---|
        | missing        | 1 |
        | medical_mask   | 2 |
        | occluded       | 3 |

      type: array
      items:
        $ref: '#/components/schemas/mask'

    label:
      type: string
      description: label for matching candidates
      example: "good guys"
      maxLength: 36

    match_filter:
      type: object
      properties:
        label:
          allOf:
          - $ref: '#/components/schemas/label'
          description: label for matching candidates | must be equal to one of the matching policy labels
        similarity__lte:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: upper included bound for best match by the list.
        similarity__gte:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: lower included bound for best match by the list.
      required: [label]

    match_origin_faces:
      type: string
      enum: ["faces"]
      description: resource candidates type. Faces or events.

    match_origin_events:
      type: string
      enum: ["events"]
      description: resource candidates type. Faces or events.

    face_ids:
      type: array
      items:
        $ref: '#/components/schemas/face_id'
      description: list of face ids
      minItems: 1
      maxItems: 1000

    face_id__gte:
      allOf:
        - $ref: '#/components/schemas/uuid'
      description: face id lower included boundary

    face_id__lt:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: face id upper excluded boundary

    external_ids:
      type: array
      items:
        $ref: '#/components/schemas/filter_external_id'
      description: list of face external ids
      minItems: 1
      maxItems: 1000

    now_delta_time_filter:
      type: string
      pattern: '^now-(\d+)[smhdwMy]$'
      example: "now-2d"

    create_time__gte:
      allOf:
        - $ref: '#/components/schemas/time'
      description: create time lower included boundary

    create_time_now__gte:
      allOf:
        - $ref: '#/components/schemas/now_delta_time_filter'
      description: |
            create time lower included boundary in format `now-time`, where time must be present as follows:

            | The parameter value | Description  |
            |---------------------|--------------|
            | `1m`                | one minute   |
            | `2h`                | two hours    |
            | `7d`                | seven days   |
            | `5w`                | five weeks   |
            | `3M`                | three months |
            | `10y`               | ten years    |

    end_time__gte:
      allOf:
        - $ref: '#/components/schemas/time'
      description: the end time lower included boundary

    end_time_now__gte:
      allOf:
        - $ref: '#/components/schemas/now_delta_time_filter'
      description: |
        the end time lower included boundary in format `now-time`, where time must be present as follows:

        | The parameter value | Description  |
        |---------------------|--------------|
        | `1m`                | one minute   |
        | `2h`                | two hours    |
        | `7d`                | seven days   |
        | `5w`                | five weeks   |
        | `3M`                | three months |
        | `10y`               | ten years    |

    create_time__lt:
      allOf:
        - $ref: '#/components/schemas/time'
      description: create time upper exluded boundary

    create_time_now__lt:
      allOf:
        - $ref: '#/components/schemas/now_delta_time_filter'
      description: |
            create time upper exluded boundary in format `now-time`, where time must be present as follows

            | The parameter value | Description  |
            |---------------------|--------------|
            | `1m`                | one minute   |
            | `2h`                | two hours    |
            | `7d`                | seven days   |
            | `5w`                | five weeks   |
            | `3M`                | three months |
            | `10y`               | ten years    |

    end_time__lt:
      allOf:
        - $ref: '#/components/schemas/time'
      description: the end time upper exluded boundary

    end_time_now__lt:
      allOf:
        - $ref: '#/components/schemas/now_delta_time_filter'
      description: |
        the end time upper exluded boundary in format `now-time`, where time must be present as follows

        | The parameter value | Description  |
        |---------------------|--------------|
        | `1m`                | one minute   |
        | `2h`                | two hours    |
        | `7d`                | seven days   |
        | `5w`                | five weeks   |
        | `3M`                | three months |
        | `10y`               | ten years    |

    candidate_face_filters_without_time_filters:
      type: object
      description: candidate face filters
      properties:
        origin:
          $ref: '#/components/schemas/match_origin_faces'
        face_ids:
          $ref: '#/components/schemas/face_ids'
        account_id:
          $ref: '#/components/schemas/account_id'
        external_ids:
          $ref: '#/components/schemas/external_ids'
        user_data:
          $ref: '#/components/schemas/user_data_filter'
        face_id__gte:
          $ref: '#/components/schemas/face_id__gte'
        face_id__lt:
          $ref: '#/components/schemas/face_id__lt'
        list_id:
          $ref: '#/components/schemas/list_id'
      required: [ origin ]
      minProperties: 1

    candidate_face_filters:
      allOf:
      - $ref: '#/components/schemas/candidate_face_filters_without_time_filters'
      - properties:
          create_time__gte:
            $ref: '#/components/schemas/create_time__gte'
          create_time__lt:
            $ref: '#/components/schemas/create_time__lt'

    tags:
      description: list of tags.
      type: array
      items:
        type: string
        maxLength: 36
      example: ['tag1', 'tag2']

    areas:
      description: List of areas. Each event from result will contain one of the given areas in location.
      type: array
      items:
        $ref: '#/components/schemas/location_str'
      example: ['area1', 'area2']
      minItems: 1
      maxItems: 1000

    cities:
      type: array
      items:
        $ref: '#/components/schemas/location_str'
      description: List of cities. Each event from result will contain one of the given cities in location.
      example: ["moscow", "New-York"]
      minItems: 1
      maxItems: 1000

    districts:
      type: array
      items:
        $ref: '#/components/schemas/location_str'
      description: List of districts. Each event from result will contain one of the given districts in location.
      example: ["mitino", "central park"]
      minItems: 1
      maxItems: 1000

    streets:
      type: array
      items:
        $ref: '#/components/schemas/location_str'
      description: List of streets. Each event from result will contain one of the given streets in location.
      example: ["arbat, schepkina"]
      minItems: 1
      maxItems: 1000

    house_numbers:
      type: array
      items:
        $ref: '#/components/schemas/location_str'
      description: List of house numbers. Each event from result will contain one of the given house numbers in location.
      example: ["1", "1/2str3"]
      minItems: 1
      maxItems: 1000

    age__lt:
      allOf:
        - $ref: '#/components/schemas/age'
          description: age upper excluded bound.

    age__gte:
      allOf:
        - $ref: '#/components/schemas/age'
          description: age lower included bound.

    source:
      type: string
      maxLength: 128
      description: some additional information that user provided with event.
      example: "3rd Avenue"

    sources:
      type: array
      items:
        $ref: '#/components/schemas/source'
      description: list of sources. Each event from result will contain one of the given sources in location.
      example: ['cam1', 'cam2']
      minItems: 1
      maxItems: 1000

    event_ids:
      type: array
      items:
        $ref: '#/components/schemas/event_id'
      description: list of event ids associated with face
      minItems: 1
      maxItems: 1000

    event_id__gte:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: event id lower included boundary

    event_id__lt:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: event id upper excluded boundary

    top_matching_candidates_label:
      description: top matching candidates label.
      type: string
      maxLength: 36
      example: good guys

    top_similar_object_ids:
      type: array
      items:
        $ref: '#/components/schemas/uuid'
      description: list of top similar object ids.
      minItems: 1
      maxItems: 1000

    top_similar_external_ids:
      type: array
      items:
        $ref: '#/components/schemas/field_external_id'
      description: list of top similar external ids.
      minItems: 1
      maxItems: 1000

    similarity:
      $ref: '#/components/schemas/number01'

    top_similar_object_similarity__gte:
      allOf:
      - $ref: '#/components/schemas/similarity'
      description: top similar object similarity lower included bound.

    top_similar_object_similarity__lt:
      allOf:
      - $ref: '#/components/schemas/similarity'
      description: top similar object similarity upper excluded bound.

    emotion:
      type: integer
      enum: [1,2,3,4,5,6,7]

    liveness_state:
      type: integer
      enum: [ 0, 1, 2 ]

    mask:
      type: integer
      enum: [1, 2, 3]

    handler_ids:
      type: array
      items:
        $ref: '#/components/schemas/handler_id'
      description: list of handler ids.
      minItems: 1
      maxItems: 1000

    ethnic_group:
      type: integer
      enum: [1,2,3,4]

    ethnic_groups:
      type: array
      items:
        $ref: '#/components/schemas/ethnic_group'
      description: |
        list of ethnic group. Each event from result will contain one of the given ethnic groups.

        | ethnicity   | value |
        |-----------------|---|
        | AfricanAmerican | 1 |
        | Indian          | 2 |
        | Asian           | 3 |
        | Caucasian       | 4 |

    geo_position_bbox:
      type: object
      description: |
          geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.
          WARNING: boxes with a vertex or border on the International Date Line (IDL) or the North or South pole are
          not fully supported due to features of database spatial index - filter result may be unexpected.
      properties:
        origin_longitude:
          allOf:
            - $ref: '#/components/schemas/longitude'
            - description: origin longitude in degrees
        origin_latitude:
          allOf:
            - $ref: '#/components/schemas/latitude'
            - description: origin latitude in degrees
        longitude_delta:
          description: |
              longitude delta in degrees. Box edges more than 180 degrees long are not allowed.
              Boundaries of valid range are **exclusive**. NOTE: highly recommended for citywide use only.
          type: number
          minimum: 0
          maximum: 90
          default: 0.01
          example: 0.01
        latitude_delta:
          description: |
              latitude delta in degrees. Box edges more than 180 degrees long are not allowed.
              Boundaries of valid range are **exclusive**. NOTE: highly recommended for citywide use only.
          type: number
          minimum: 0
          maximum: 90
          default: 0.01
          example: 0.01
      required: [origin_longitude, origin_latitude]

    candidate_event_filters_without_time_filters:
      type: object
      description: candidate event filters
      properties:
        origin:
          $ref: '#/components/schemas/match_origin_events'
        event_ids:
          $ref: '#/components/schemas/event_ids'
        account_id:
          $ref: '#/components/schemas/account_id'
        event_id__gte:
          $ref: '#/components/schemas/event_id__gte'
        event_id__lt:
          $ref: '#/components/schemas/event_id__lt'
        handler_ids:
          $ref: '#/components/schemas/handler_ids'
        external_ids:
          $ref: '#/components/schemas/external_ids'
        top_matching_candidates_label:
          $ref: '#/components/schemas/top_matching_candidates_label'
        top_similar_object_ids:
          $ref: '#/components/schemas/top_similar_object_ids'
        top_similar_external_ids:
          $ref: '#/components/schemas/top_similar_external_ids'
        top_similar_object_similarity__gte:
          $ref: '#/components/schemas/top_similar_object_similarity__gte'
        top_similar_object_similarity__lt:
          $ref: '#/components/schemas/top_similar_object_similarity__lt'
        age__gte:
          $ref: '#/components/schemas/age__gte'
        age__lt:
          $ref: '#/components/schemas/age__lt'
        gender:
          $ref: '#/components/schemas/gender'
        emotions:
          $ref: '#/components/schemas/emotions_enum'
        liveness:
          $ref: '#/components/schemas/liveness_states'
        masks:
          $ref: '#/components/schemas/masks_enum'
        ethnic_groups:
          $ref: '#/components/schemas/ethnic_groups'
        face_ids:
          $ref: '#/components/schemas/face_ids'
        user_data:
          $ref: '#/components/schemas/user_data_filter'
        sources:
          $ref: '#/components/schemas/sources'
        tags:
          $ref: '#/components/schemas/tags'
        cities:
          $ref: '#/components/schemas/cities'
        areas:
          $ref: '#/components/schemas/areas'
        districts:
          $ref: '#/components/schemas/districts'
        streets:
          $ref: '#/components/schemas/streets'
        house_numbers:
          $ref: '#/components/schemas/house_numbers'
        geo_position:
          $ref: '#/components/schemas/geo_position_bbox'
        track_ids:
          $ref: '#/components/schemas/track_ids'
      required: [origin]
      minProperties: 1

    candidate_event_filters:
      allOf:
      - $ref: '#/components/schemas/candidate_event_filters_without_time_filters'
      - properties:
          create_time__gte:
            $ref: '#/components/schemas/create_time__gte'
          create_time__lt:
            $ref: '#/components/schemas/create_time__lt'
          end_time__gte:
            $ref: '#/components/schemas/end_time__gte'
          end_time__lt:
            $ref: '#/components/schemas/end_time__lt'

    matching_threshold:
      allOf:
      - $ref: '#/components/schemas/number01'
      description: matching similarity threshold

    matching_limit:
      type: integer
      minimum: 1
      maximum: 100
      default: 3
      description: count of match result for candidate list

    detect_time:
      allOf:
        - $ref: "#/components/schemas/time"
        - description: detection time
      example: "2018-08-11T09:11:41.674Z"

    image_origin:
      type: string
      maxLength: 256
      description: the image url - source of the detection
      nullable: true
      example: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    image_origin_not_nullable:
      allOf:
      - $ref: "#/components/schemas/image_origin"
      description: |
        The specified URL will be used as `image_origin` for created events independently of `image_origin_policy`.
      nullable: false

    face_matching_targets:
      type: array
      items:
        type: string
        enum: ["face_id", "account_id", "event_id", "user_data", "create_time", "external_id", "avatar", "lists"]

    event_matching_targets:
      type: array
      items:
        type: string
        enum: ["event_id", "account_id", "create_time", "end_time", "external_id", "handler_id", "source", "top_match",
               "match_result", "face_detections", "body_detections", "face_id", "attach_result", "gender", "age",
               "emotion", "ethnic_group", "tags", "user_data", "location", "mask", "liveness", "track_id"]

    matching_targets:
      description: |
        List of face/event fields.
        If set, each face/event from result will contain only specified fields, otherwise, faces/events with all fields will be returned.
        If targets do not specified, all targets will return.
      oneOf:
        - $ref: '#/components/schemas/face_matching_targets'
        - $ref: '#/components/schemas/event_matching_targets'

    handler_match_policy_without_candidates:
      type: array
      items:
        type: object
        properties:
          label:
            allOf:
            - $ref: '#/components/schemas/label'
            default: ""
          filters:
            $ref: '#/components/schemas/emit_events_match_filters'
          limit:
            $ref: '#/components/schemas/matching_limit'
          targets:
            $ref: '#/components/schemas/matching_targets'
          threshold:
            $ref: '#/components/schemas/matching_threshold'
        required: [candidates]
      minItems: 0
      maxItems: 30
      description: |
        Match attributes policy. This policy will be used for each event which descriptor was extracted successfully and which satisfies the filters.

    handler_match_policy:
      allOf:
      - $ref: '#/components/schemas/handler_match_policy_without_candidates'
      - items:
          properties:
            candidates:
              description: matching candidate filters
              oneOf:
                - $ref: '#/components/schemas/candidate_face_filters'
                - $ref: '#/components/schemas/candidate_event_filters'

    candidate_face_filters_for_request:
      allOf:
      - $ref: '#/components/schemas/candidate_face_filters_without_time_filters'
      - properties:
          create_time__gte:
            description: create time lower included boundary
            oneOf:
              - $ref: '#/components/schemas/create_time__gte'
              - $ref: '#/components/schemas/create_time_now__gte'
          create_time__lt:
            description: create time upper excluded boundary
            oneOf:
              - $ref: '#/components/schemas/create_time__lt'
              - $ref: '#/components/schemas/create_time_now__lt'

    candidate_event_filters_for_request:
      allOf:
      - $ref: '#/components/schemas/candidate_event_filters_without_time_filters'
      - properties:
          create_time__gte:
            description: create time lower included boundary
            oneOf:
              - $ref: '#/components/schemas/create_time__gte'
              - $ref: '#/components/schemas/create_time_now__gte'
          create_time__lt:
            description: create time upper excluded boundary
            oneOf:
              - $ref: '#/components/schemas/create_time__lt'
              - $ref: '#/components/schemas/create_time_now__lt'
          end_time__gte:
            description: end time lower included boundary
            oneOf:
              - $ref: '#/components/schemas/end_time__gte'
              - $ref: '#/components/schemas/end_time_now__gte'
          end_time__lt:
            description: end time upper excluded boundary
            oneOf:
              - $ref: '#/components/schemas/end_time__lt'
              - $ref: '#/components/schemas/end_time_now__lt'

    handler_match_policy_for_request:
      allOf:
      - $ref: '#/components/schemas/handler_match_policy_without_candidates'
      - items:
          properties:
            candidates:
              description: matching candidate filters
              oneOf:
                - $ref: '#/components/schemas/candidate_face_filters_for_request'
                - $ref: '#/components/schemas/candidate_event_filters_for_request'

    link_to_lists_policy:
      type: array
      items:
        type: object
        properties:
          list_id:
            $ref: '#/components/schemas/list_id'
          filters:
            allOf:
            - $ref: '#/components/schemas/emit_events_full_filters'
            - description: filters determine whether to link stored face to the list.
        required: [list_id]
      minItems: 0
      maxItems: 30
      description: a set of luna lists with filters for attaching stored faces.

    link_to_lists_policy_required:
      # must be same as link_to_lists_policy
      type: array
      items:
        type: object
        properties:
          list_id:
            $ref: '#/components/schemas/list_id'
          filters:
            allOf:
            - $ref: '#/components/schemas/emit_events_full_filters'
            - description: filters determine whether to link created face to the list.
        required: [list_id, filters]
      minItems: 0
      maxItems: 30
      description: a set of luna lists for linking of created faces.

    face_storage_policy:
      type: object
      description: Whether to store a face and link it to lists.
      properties:
        store_face:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store a face.
          default: 0
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store a face. Only the faces corresponding to the specified filters will be stored.
        set_sample_as_avatar:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to set a sample as an avatar for stored faces.
          default: 1
        link_to_lists_policy:
          $ref: '#/components/schemas/link_to_lists_policy'

    face_storage_policy_required:
      # must be same as face_storage_policy
      type: object
      description: Whether to store a face and link it to lists.
      properties:
        store_face:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store a face.
          default: 0
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store a face. Only the faces corresponding to the specified filters will be stored.
        set_sample_as_avatar:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to set a sample as an avatar for stored faces.
          default: 1
        link_to_lists_policy:
          $ref: '#/components/schemas/link_to_lists_policy_required'
      required: [store_face, set_sample_as_avatar, filters, link_to_lists_policy]

    face_sample_storage_policy:
      type: object
      description: Face sample storing policy.
      properties:
        store_sample:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store a face sample.
          default: 1
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store a face sample or not. Only the samples corresponding to the specified filters will be stored.

    face_sample_storage_policy_required:
      # must be same as face_sample_storage_policy
      allOf:
        - $ref: '#/components/schemas/face_sample_storage_policy'
        - required: [store_sample, filters]

    body_sample_storage_policy:
      type: object
      description: Human body sample storing policy.
      properties:
        store_sample:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store a human body sample.
          default: 1
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store a human body sample or not. Only the samples corresponding to the specified filters will be stored.

    body_sample_storage_policy_required:
      # must be same as face_sample_storage_policy
      allOf:
        - $ref: '#/components/schemas/body_sample_storage_policy'
        - required: [store_sample, filters]

    image_origin_storage_policy:
      type: object
      description: Image origin policy.
      properties:
        store_image:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store an origin image of the detection.
          default: 0
        use_external_references:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: |
            Whether to use external reference as image origin url. External references are urls, sample ids and
            saved samples. This setting is needed for origin images duplicate prevention. If an external url is
            to large (more than 256 symbols) service will store the image to image-store.
          default: 1
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store an origin image or not. Only the images corresponding to the specified filters will be stored.

    image_origin_storage_policy_required:
      # must be same as image_origin_storage_policy
      allOf:
        - $ref: '#/components/schemas/image_origin_storage_policy'
        - required: [store_image, filters]

    attribute_storage_policy:
      type: object
      description: Attribute storing policy.
      properties:
        store_attribute:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store an attribute.
          default: 0
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store an attribute or not. Only the attributes corresponding to the specified filters will be stored.
        ttl:
          type: integer
          minimum: 0
          maximum: 86400
          default: 300
          description: Attribute storage duration (sec). Attribute will be removed after this time runs out.

    attribute_storage_policy_required:
      # must be same as attribute_storage_policy
      allOf:
        - $ref: '#/components/schemas/attribute_storage_policy'
        - required: [store_attribute, filters, ttl]

    event_storage_policy:
      type: object
      description: Event storing policy.
      properties:
        store_event:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to store an event.
          default: 1
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to store an event or not. Only the events corresponding to the specified filters will be stored.
        wait_saving:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: |
            Whether to wait for events saving to the Events service before sending the response. The request will be
            executed faster if this feature is disabled, but it is not guaranteed that the events will be saved to
            the Events database.
          default: 1

    event_storage_policy_required:
      # must be same as event_storage_policy
      allOf:
        - $ref: '#/components/schemas/event_storage_policy'
        - required: [store_event, filters, wait_saving]

    notification_sending_policy:
      type: object
      description: Notification sending policy
      properties:
        send_notification:
          allOf:
          - $ref: '#/components/schemas/int01'
          description: Whether to send a notification
          default: 1
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: Filters determine whether to send a notification or not. Only the notifications corresponding to the specified filters will be sent.

    notification_sending_policy_required:
      # must be same as notification_sending_policy
      allOf:
        - $ref: '#/components/schemas/notification_sending_policy'
        - required: [ send_notification, filters ]

    conditional_tag_policy:
      type: object
      properties:
        tag:
          $ref: '#/components/schemas/tag'
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_full_filters'
          - description: filters determine whether to add the tag to event.
      required: [tag]

    conditional_tags_policy:
      type: array
      items:
        $ref: '#/components/schemas/conditional_tag_policy'
      minItems: 0
      maxItems: 30
      description: a set of event tags for adding to event by conditions.

    conditional_tags_policy_required:
      type: array
      items:
        allOf:
          - $ref: '#/components/schemas/conditional_tag_policy'
          - required: [tag, filters]
      minItems: 0
      maxItems: 30
      description: a set of event tags for adding to event by conditions.

    int_version:
      type: integer
      minimum: 0

    version:
      type: object
      properties:
        api:
          allOf:
            - $ref: '#/components/schemas/int_version'
          description: an api version of service.
        major:
          allOf:
            - $ref: '#/components/schemas/int_version'
          description: a major version of service.
        minor:
          allOf:
            - $ref: '#/components/schemas/int_version'
          description: a minor version of service.
        patch:
          allOf:
            - $ref: '#/components/schemas/int_version'
          description: a patch version of service.
      required:
        - api
        - major
        - minor
        - patch


    base_face:
      type: object
      description: face object
      properties:
        face_id:
          $ref: '#/components/schemas/face_id'
        event_id:
          allOf:
          - $ref: '#/components/schemas/event_id'
          - description: event id associated with the face creation.
          - nullable: true
        user_data:
          $ref: '#/components/schemas/face_user_data'
        external_id:
          $ref: '#/components/schemas/face_external_id'
        avatar:
          $ref: '#/components/schemas/face_avatar'
        lists:
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          minItems: 0
          description: list of luna lists, which contain the face.
      example:
        face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
        account_id: d5c0a8c6-5509-4e5b-8a01-e2ab426542d6
        event_id: f9687459-986b-406d-9c1f-0d6289be5256
        user_data: fox1991
        external_id: 2xQ2gprbMUePw1s9gw9fvA==
        avatar: '/6/samples/faces/429b0e78-4616-426a-b57f-02baa72d638d'
        lists: ["429b0e78-4616-426a-b57f-02baa72d638d", '6d037c33-31ec-4d73-b3b3-ec80b09446c2']

    input_event_face:
      description: face structure of input event
      allOf:
        - $ref: '#/components/schemas/base_face'
        - properties:
            url:
              type: string
              description: face location url
              format: uri-reference
        - required: []
        - example:
            face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
            event_id: f9687459-986b-406d-9c1f-0d6289be5256
            user_data: fox1991
            external_id: 2xQ2gprbMUePw1s9gw9fvA==
            avatar: 'https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg'
            lists: ["429b0e78-4616-426a-b57f-02baa72d638d", '6d037c33-31ec-4d73-b3b3-ec80b09446c2']
            url: "http://127.0.0.1:5030/3/faces/426542d6-5509-4e5b-8a01-e2abd5c0a8c6"

    event_face:
      description: handler generated face
      allOf:
        - $ref: '#/components/schemas/base_face'
        - properties:
            url:
              type: string
              description: created face location url
              format: uri-reference
        - example:
            face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
            event_id: f9687459-986b-406d-9c1f-0d6289be5256
            user_data: fox1991
            external_id: 2xQ2gprbMUePw1s9gw9fvA==
            avatar: 'https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg'
            lists: ["429b0e78-4616-426a-b57f-02baa72d638d", '6d037c33-31ec-4d73-b3b3-ec80b09446c2']
            url: "http://127.0.0.1:5030/3/faces/426542d6-5509-4e5b-8a01-e2abd5c0a8c6"

    face:
      description: face
      allOf:
        - $ref: '#/components/schemas/base_face'
        - properties:
            account_id:
              $ref: '#/components/schemas/account_id'
        - example:
            account_id: 12345459-bfbf-406d-9c1f-0d6289aaaaa
            face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
            event_id: f9687459-986b-406d-9c1f-0d6289be5256
            user_data: fox1991
            external_id: 2xQ2gprbMUePw1s9gw9fvA==
            avatar: 'https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg'
            lists: ["429b0e78-4616-426a-b57f-02baa72d638d", '6d037c33-31ec-4d73-b3b3-ec80b09446c2']

    emit_events_match_filters:
      type: object
      description: filters for matching are based on the results of the extraction.
      properties:
        gender:
          $ref: '#/components/schemas/gender_filter'
        ethnicities:
          $ref: '#/components/schemas/ethnicities_enum'
        age__lt:
          $ref: '#/components/schemas/age_lt_filter'
        age__gte:
          $ref: '#/components/schemas/age_gte_filter'
        liveness:
          $ref: '#/components/schemas/liveness_filter'

    emit_events_full_filters:
      allOf:
        - $ref: '#/components/schemas/emit_events_match_filters'
        - description: filters for matching are based on the results of the extraction.
        - properties:
            match:
              type: array
              items:
                $ref: '#/components/schemas/match_filter'
              minItems: 0
              description: a list of policies based on match results.
              maxItems: 30

    storage_policy:
      description: Objects storage policy.
      properties:
        face_sample_policy:
          $ref: '#/components/schemas/face_sample_storage_policy'
        body_sample_policy:
          $ref: '#/components/schemas/body_sample_storage_policy'
        image_origin_policy:
          $ref: '#/components/schemas/image_origin_storage_policy'
        attribute_policy:
          $ref: '#/components/schemas/attribute_storage_policy'
        face_policy:
          $ref: '#/components/schemas/face_storage_policy'
        event_policy:
          $ref: '#/components/schemas/event_storage_policy'
        notification_policy:
          $ref: '#/components/schemas/notification_sending_policy'

    storage_policy_required:
      # must be same as storage_policy
      type: object
      properties:
        face_sample_policy:
          $ref: '#/components/schemas/face_sample_storage_policy_required'
        body_sample_policy:
          $ref: '#/components/schemas/body_sample_storage_policy_required'
        image_origin_policy:
          $ref: '#/components/schemas/image_origin_storage_policy_required'
        attribute_policy:
          $ref: '#/components/schemas/attribute_storage_policy_required'
        face_policy:
          $ref: '#/components/schemas/face_storage_policy_required'
        event_policy:
          $ref: '#/components/schemas/event_storage_policy_required'
        notification_policy:
          $ref: '#/components/schemas/notification_sending_policy_required'
      required: [face_sample_policy, body_sample_policy, image_origin_policy, attribute_policy, face_policy, event_policy, notification_policy]

    Policies:
      type: object
      description: a set of rules, that determines input images processing
      properties:
        detect_policy:
          allOf:
          - $ref: '#/components/schemas/detect_policy'
          - description: face detection policy.
        extract_policy:
          allOf:
          - $ref: '#/components/schemas/extract_policy'
          - description: extract attributes policy.
        match_policy:
          $ref: '#/components/schemas/handler_match_policy_for_request'
        storage_policy:
          $ref: '#/components/schemas/storage_policy'
        conditional_tags_policy:
          $ref: '#/components/schemas/conditional_tags_policy'

    PoliciesWithRequired:
      type: object
      description: a set of rules, which determine input images processing. Empty policies refer to dynamic handler.
      properties:
        detect_policy:
          allOf:
            - $ref: '#/components/schemas/detect_policy_required'
            - type: object
              description: face detection policy.
        extract_policy:
          allOf:
            - $ref: '#/components/schemas/extract_policy_required'
            - description: extract attributes policy.
        match_policy:
          $ref: '#/components/schemas/handler_match_policy'
        storage_policy:
          $ref: '#/components/schemas/storage_policy_required'
        conditional_tags_policy:
          $ref: '#/components/schemas/conditional_tags_policy_required'
      required: [detect_policy, extract_policy, match_policy, storage_policy, conditional_tags_policy]

    handlers_validator:
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        policies:
          $ref: '#/components/schemas/Policies'
      required: [account_id, policies]

    New_Handler:
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        description:
          type: string
          maxLength: 128
          description: user description.
          example: second avenue
        policies:
          $ref: '#/components/schemas/Policies'
        is_dynamic:
          $ref: '#/components/schemas/is_dynamic'
      required: [account_id]

    HandlerInResponse:
      type: object
      properties:
        handler_id:
          $ref: '#/components/schemas/handler_id'
        account_id:
          $ref: '#/components/schemas/account_id'
        description:
          type: string
          maxLength: 128
          description: user description.
        policies:
          allOf:
          - $ref: '#/components/schemas/PoliciesWithRequired'
          - nullable: true
        create_time:
          type: string
          format: date-time
          readOnly: true
          description: the handler creation time.
        last_update_time:
          type: string
          format: date-time
          readOnly: true
          description: the handler last update time.
        is_dynamic:
          $ref: '#/components/schemas/is_dynamic'
      required: [handler_id, account_id, description, create_time, last_update_time, policies, is_dynamic]

    event_detection_samples:
      type: object
      properties:
        filename:
          $ref: '#/components/schemas/filename'
        samples:
          type: object
          description: |
            body & face related samples that refer to the one person.
            If one of **body** or **face** field is *null*, it means that either the corresponding detection is disabled
            (see *detect_face*, *detect_body* parameters in [handler detect policy](#operation/createHandler)),
            or the detection has been filtered. Both **body** and **face** fields can not be *null* at the same time.
          properties:
            body:
              allOf:
                - $ref: '#/components/schemas/body_detection_sample'
                - nullable: true
            face:
              allOf:
                - $ref: '#/components/schemas/face_detection_sample_with_quality'
                - nullable: true
          required: [ body, face ]
        detect_time:
          $ref: "#/components/schemas/detect_time"
        image_origin:
          $ref: "#/components/schemas/image_origin"
      required: [filename, samples, detect_time, image_origin]

    input_event_detection_samples:
      type: object
      description: user detected samples
      properties:
        filename:
          default: ""
          allOf:
          - $ref: '#/components/schemas/filename'
        samples:
          type: object
          description: |
            body & face related samples that refer to the one person.
          properties:
            body:
              allOf:
                - $ref: '#/components/schemas/input_event_body_detection_sample'
                - nullable: true
            face:
              allOf:
                - $ref: '#/components/schemas/input_event_face_detection_sample'
                - nullable: true
        detect_time:
          $ref: "#/components/schemas/detect_time"
        image_origin:
          $ref: "#/components/schemas/image_origin"

      required: [samples]

    EventAggregateEstimations:
      type: object
      description: aggregated attributes estimated from samples.
      properties:
        face:
          type: object
          description: face aggregated estimations.
          properties:
            attributes:
              type: object
              description: estimated attributes.
              properties:
                liveness:
                  $ref: "#/components/schemas/liveness"
                emotions:
                  $ref: "#/components/schemas/emotions"
                mask:
                  $ref: "#/components/schemas/masks"
          required: [attributes]
      required: [face]

    EventFromHandler:
      type: object
      description: event format from handler.
      properties:
        face_attributes:
          allOf:
          - description: extracted face attributes from samples.
          - $ref: '#/components/schemas/attribute'
          - nullable: true
        body_attributes:
          allOf:
            - description: extracted body attributes from samples.
            - $ref: '#/components/schemas/BodyAttribute'
            - nullable: true
        aggregate_estimations:
          $ref: '#/components/schemas/EventAggregateEstimations'
        source:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/source'
        tags:
          $ref: '#/components/schemas/Tags'
        external_id:
          $ref: '#/components/schemas/event_external_id'
        user_data:
          $ref: '#/components/schemas/event_user_data'
        face:
          nullable: true
          allOf:
          - $ref: '#/components/schemas/event_face'
        event_id:
          allOf:
          - $ref: '#/components/schemas/event_id'
          - description: Event id.
        url:
          type: string
          format: uri-reference
          example: /0/events/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
          description: location of event, null if event was not stored
          nullable: true
        matches:
          allOf:
          - nullable: true
          - items:
              anyOf:
                - allOf:
                  - properties:
                      candidates:
                        items:
                          properties:
                            face:
                              properties:
                                create_time:
                                  type: string
                                  format: date-time
                                  readOnly: true
                                  description: the face creation time.
                  - $ref: '#/components/schemas/match_candidates_faces'
                - $ref: '#/components/schemas/match_candidates_events'
          - $ref: '#/components/schemas/matches'
        location:
          $ref: '#/components/schemas/location'
        detections:
          description: list of body & face related detections
          type: array
          items:
            $ref: '#/components/schemas/event_detection_samples'
        track_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/track_id'
      required: [matches, url, event_id, face, tags, source, face_attributes, body_attributes, aggregate_estimations, location, user_data, external_id, detections, track_id]

    Tags:
      description: tag array.
      type: array
      items:
        $ref: '#/components/schemas/tag'
      example: ['tag1', 'tag2']

    emotions_estimations:
      type: object
      properties:
        anger:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: anger probability.
        disgust:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: disgust probability.
        fear:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: fear probability.
        happiness:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: happiness probability.
        neutral:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: neutral face probability.
        sadness:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: sadness probability.
        surprise:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: surprise probability.
      required: [surprise, sadness, neutral, happiness, fear, disgust, anger]
      description: emotion classifier response.

    emotions:
      type: object
      properties:
        estimations:
          allOf:
          - $ref: '#/components/schemas/emotions_estimations'
          - description: emotion classifier response.
        predominant_emotion:
          type: string
          description: name of predominant emotion.
          enum: [surprise, sadness, neutral, happiness, fear, disgust, anger]
      required: [estimations, predominant_emotion]

    landmark:
      type: array
      items:
        type: integer
      description: |
        key point coordinates. First element is `x` coordinate, second is `y`.
      minItems: 2
      maxItems: 2
      example: [12, 13]

    landmarks5:
      type: array
      items:
        $ref: '#/components/schemas/landmark'
      description: array of 5 landmarks.
      minItems: 5
      maxItems: 5
      example:
      - - 23
        - 72
      - - 82
        - 71
      - - 42
        - 114
      - - 29
        - 140
      - - 79
        - 138

    landmarks68:
      description: array of 68 landmarks.
      type: array
      items:
        $ref: '#/components/schemas/landmark'
      minItems: 68
      maxItems: 68

    landmarks32:
      description: array of 32 landmarks.
      type: array
      items:
        $ref: '#/components/schemas/landmark'
      minItems: 32
      maxItems: 32

    mouth_attributes:
      description: mouth attributes.
      type: object
      properties:
        score:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: mouth detection confidence.
        smile:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: smile probability.
        opened:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: opened mouth probability.
        occluded:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: occlusion probability.
      required: [score, smile, occluded, opened]

    eye_attributes:
      description: eye attributes.
      type: object
      properties:
        state:
          type: string
          enum: [open, closed, occluded]
          description: eye state.
        iris_landmarks:
          allOf:
          - $ref: '#/components/schemas/landmarks32'
          - description: iris landmarks.
      required: [state, iris_landmarks]

    eyes_attributes:
      description: eyes attributes.
      type: object
      properties:
        left_eye:
          allOf:
          - $ref: '#/components/schemas/eye_attributes'
          - description: left eye attributes.
        right_eye:
          allOf:
          - $ref: '#/components/schemas/eye_attributes'
          - description: right eye attributes.
      required: [left_eye, right_eye]

    head_pose:
      description: head pose.
      type: object
      properties:
        yaw:
          type: number
          description: yaw angle in degrees.
        pitch:
          type: number
          description: pitch angle in degrees.
        roll:
          type: number
          description: roll angle in degrees.
      required: [yaw, pitch, roll]

    gaze_direction:
      type: object
      properties:
        yaw:
          type: number
          description: yaw angle in degrees.
        pitch:
          type: number
          description: pitch angle in degrees.
      required: [yaw, pitch]

    attributes:
      description: face attributes.
      type: object
      properties:
        mouth_attributes:
          allOf:
          - $ref: '#/components/schemas/mouth_attributes'
          - description: optional mouth attributes.
        eyes_attributes:
          allOf:
          - $ref: '#/components/schemas/eyes_attributes'
          - description: optional eye attributes.
        emotions:
          allOf:
          - $ref: '#/components/schemas/emotions'
          - description: face emotions estimation.
        mask:
          $ref: '#/components/schemas/masks'
        head_pose:
          allOf:
          - $ref: '#/components/schemas/head_pose'
          - description: head pose estimation.
        gaze:
          allOf:
          - $ref: '#/components/schemas/gaze_direction'
          - description: gaze direction estimation.
        liveness:
          $ref: '#/components/schemas/liveness'
      example:
        mouth_attributes:
          occluded: 0.0
          opened: 0.0
          score: 1.0
          smile: 0.0
        emotions:
          estimations:
            anger: 0.00894705578684807
            disgust: 0.00000965219624049496
            fear: 0.00121302821207792
            happiness: 0.00129503419157118
            neutral: 0.986027479171753
            sadness: 0.00187553185969591
            surprise: 0.000632198702078313
          predominant_emotion: "neutral"
        mask:
          estimations:
            medical_mask: 0.7108324766
            missing: 0.0700698048
            occluded: 0.2190976739
          predominant_mask: "medical_mask"
        head_pose:
          pitch: 18.6827487945557
          roll: -10.3542232513428
          yaw: 15.4102487564087
        gaze:
          pitch: 9.26744079589844
          yaw: -19.4657287597656
        liveness:
          prediction: "spoof"
          estimations:
            score: 0.5108324766
            quality: 0.7190976739

    rect:
      description: bounding rectangle.
      type: object
      properties:
        height:
          type: integer
          description: rectangle height.
          example: 200
        width:
          type: integer
          description: rectangle width.
          example: 100
        x:
          type: integer
          description: top left corner "x" coordinate.
          example: 17
        y:
          type: integer
          description: top left corner "y" coordinate.
          example: 10
      required: [height, width, x, y]
      example:
        height: 240
        width: 209
        x: 170
        y: 198

    quality:
      description: |
        image quality. Estimation of image visual properties.
      type: object
      properties:
        dark:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: low value means under-exposured face area (i.e. due to backlight, poor lighting, sensor underexposure).
        light:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: low value means over-exposured face area (i.e. overbright lighting, sensor overexposure).
        illumination:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: low value means illumination nonuniformity.
        specularity:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: low value means low specularity.
        blurriness:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: low value means blurred image (e.g. due to depth of field or motion blur). High value means sharp image.
      required: [blurriness, specularity, illumination, light, dark]
      example:
        light: 0.87
        dark: 0.13
        illumination: 0.1
        specularity: 0.1
        blurriness: 0.2

    warped_image:
      type: integer
      description: |
        Whether input image is a warped or arbitrary image.
        The warped image has the following properties: |
        * it's size is always 250x250 pixels.
        * it's always in RGB color format.
        * it always contains just a single face.
        * the face is always centered and rotated so that imaginary line between the eyes is horizontal.

      maximum: 1
      minimum: 0

    detection_filter_reason:
      type: object
      properties:
        filter_name:
          type: string
          enum: ['pitch_threshold', 'roll_threshold', 'yaw_threshold', 'score_threshold', 'mask_states', 'liveness_states',
                 'image_format', 'illumination_quality', 'specularity_quality', 'blurriness_quality', 'dark_quality',
                 'light_quality', 'head_yaw', 'head_pitch', 'head_roll', 'gaze_yaw', 'gaze_pitch', 'mouth_smiling',
                 'mouth_occluded', 'mouth_open', 'glasses', 'left_eye', 'right_eye', 'head_horizontal_center',
                 'head_vertical_center', 'head_width', 'head_height', 'eye_distance', 'image_width', 'image_height',
                 'aspect_ratio', 'face_width', 'face_height', 'indent_left', 'indent_right', 'indent_upper',
                 'eyebrows_state', 'smile_properties', 'headwear_type', 'natural_light', 'radial_distortion', 'red_eyes',
                 'face_color_type', 'indent_lower', 'image_size', 'illumination_uniformity', 'dynamic_range']
          description: |
            Filter name. For resource */detector* available values are: 'pitch_threshold', 'roll_threshold',
            'yaw_threshold', For resources */handlers/{handler_id}/events* and */verifiers/{verifier_id}/verifications* all values are available.
        object_value:
          anyOf:
            - type: integer
              description: estimate value
            - type: number
              description: estimate value
            - type: string
              description: estimate value
        threshold_value:
          oneOf:
          - type: number
            description: threshold value
          - type: array
            items:
              type: integer
            minItems: 1
            description: threshold values
          - type: array
            items:
              type: string
            minItems: 1
            description: threshold values
          - type: object
            description: threshold values
            properties:
              min:
                type: number
                description: minimum allowed value
              max:
                type: number
                description: maximum allowed value

      required:
      - filter_name
      - object_value
      - threshold_value

    extractor_filter:
      type: object
      properties:
        is_filtered:
          type: boolean
          description: true if sample is filtered by a threshold otherwise false
        filter_reasons:
          type: array
          items:
            type: object
            properties:
              filter_name:
                type: string
                enum: ['score_threshold']
                description: filter name
              object_value:
                type: number
                description: estimate value
              threshold_value:
                type: number
                description: threshold value
            required:
            - filter_name
            - object_value
            - threshold_value
      description: extractor filters

    image_format_estimation:
      type: object
      description: image format estimation
      properties:
        result:
          $ref: '#/components/schemas/check_result'
        value:
          type: number
          description: estimate value

    face_quality_checks_reply:
      type: array
      description: face quality container with all estimates
      items:
        oneOf:
          - $ref: '#/components/schemas/check_image_format'
          - $ref: '#/components/schemas/check_image_quality'
          - $ref: '#/components/schemas/check_glasses_state'
          - $ref: '#/components/schemas/check_eyes_state'
          - $ref: '#/components/schemas/check_gaze_direction'
          - $ref: '#/components/schemas/check_mouth_state'
          - $ref: '#/components/schemas/check_head_rotation'
          - $ref: '#/components/schemas/check_head_position'
          - $ref: '#/components/schemas/check_head_proportions'
          - $ref: '#/components/schemas/check_eye_distance'
          - $ref: '#/components/schemas/check_image_properties'
          - $ref: '#/components/schemas/check_aspect_ratio'
          - $ref: '#/components/schemas/check_face_properties'
          - $ref: '#/components/schemas/eyebrows_state'
          - $ref: '#/components/schemas/headwear_type'
          - $ref: '#/components/schemas/smile_properties'
          - $ref: '#/components/schemas/natural_light'
          - $ref: '#/components/schemas/radial_distortion'
          - $ref: '#/components/schemas/red_eyes'
          - $ref: '#/components/schemas/face_color_type'
          - $ref: '#/components/schemas/check_face_illumination_uniformity'
      minItems: 0
      maxItems: 41
      uniqueItems: true
      example:
        [
          {
            "name": image_format,
            "object_value": JPEG,
            "threshold_value": [ JPEG, JPEG2000, PNG ],
            "result": 1
          },
          {
            "name": illumination_quality,
            "object_value": 0.6005162000656128,
            "threshold_value": { "min": 0.3, "max": 1 },
            "result": 1
          },
          {
            "name": specularity_quality,
            "object_value": 0.7662366628646851,
            "threshold_value": { "min": 0.3, "max": 1 },
            "result": 1
          },
          {
            "name": blurriness_quality,
            "object_value": 0.9429352283477783,
            "threshold_value": { "min": 0.61, "max": 1 },
            "result": 1
          },
          {
            "name": dark_quality,
            "object_value": 0.9020983576774597,
            "threshold_value": { "min": 0.5, "max": 1 },
            "result": 1
          },
          {
            "name": light_quality,
            "object_value": 0.7881984114646912,
            "threshold_value": { "min": 0.57, "max": 1 },
            "result": 1
          },
          {
            "name": head_yaw,
            "object_value": 2.818983316421509,
            "threshold_value": { "min": -5.0, "max": 5.0 },
            "result": 1
          },
          {
            "name": head_pitch,
            "object_value": 3.816443920135498,
            "threshold_value": { "min": -5.0, "max": 5.0 },
            "result": 1
          },
          {
            "name": head_roll,
            "object_value": 5.434040069580078,
            "threshold_value": { "min": -8.0, "max": 8.0 },
            "result": 1
          },
          {
            "name": gaze_yaw,
            "object_value": -3.773012399673462,
            "threshold_value": { "min": -5.0, "max": 5.0 },
            "result": 1
          },
          {
            "name": gaze_pitch,
            "object_value": 0.7140519022941589,
            "threshold_value": { "min": -5.0, "max": 5.0 },
            "result": 1
          },
          {
            "name": mouth_smiling,
            "object_value": 0.000290759839117527,
            "threshold_value": { "min": 0, "max": 0.5 },
            "result": 1
          },
          {
            "name": mouth_occluded,
            "object_value": 9.619363845558837e-05,
            "threshold_value": { "min": 0, "max": 0.5 },
            "result": 1
          },
          {
            "name": mouth_open,
            "object_value": 0.6226108074188232,
            "threshold_value": { "min": 0, "max": 0.5 },
            "result": 1
          },
          {
            "name": glasses,
            "object_value": no_glasses,
            "threshold_value": [ no_glasses, eyeglasses ],
            "result": 1
          },
          {
            "name": left_eye,
            "object_value": open,
            "threshold_value": [ open ],
            "result": 1
          },
          {
            "name": right_eye,
            "object_value": open,
            "threshold_value": [ open ],
            "result": 1
          },
          {
            "name": head_horizontal_center,
            "object_value": 0.51,
            "threshold_value": { "min": 0.45, "max": 0.55 },
            "result": 1
          },
          {
            "name": head_vertical_center,
            "object_value": 0.51,
            "threshold_value": { "min": 0.3, "max": 0.5 },
            "result": 1
          },
          {
            "name": head_width,
            "object_value": 0.61,
            "threshold_value": { "min": 0.5, "max": 0.75 },
            "result": 1
          },
          {
            "name": head_height,
            "object_value": 0.71,
            "threshold_value": { "min": 0.6, "max": 0.9 },
            "result": 1
          },
          {
            "name":eye_distance,
            "object_value": 110,
            "threshold_value": { "min": 90, "max": null },
            "result": 1
          },
          {
            "name": image_width,
            "object_value": 1000,
            "threshold_value": { "min": 200, "max": 1100 },
            "result": 1
          },
          {
            "name": image_height,
            "object_value": 2000,
            "threshold_value": { "min": 200, "max": 1100 },
            "result": 1
          },
          {
            "name": aspect_ratio,
            "object_value": 0.5,
            "threshold_value": { "min": 0.1, "max": 1.0 },
            "result": 1
          },
          {
            "name": face_width,
            "object_value": 500,
            "threshold_value": { "min": 400, "max": 600 },
            "result": 1
          },
          {
            "name": face_height,
            "object_value": 500,
            "threshold_value": { "min": 400, "max": 600 },
            "result": 1
          },
          {
            "name": indent_left,
            "object_value": 100,
            "threshold_value": { "min": 10, "max": 500 },
            "result": 1
          },
          {
            "name": indent_right,
            "object_value": 100,
            "threshold_value": { "min": 10, "max": 500 },
            "result": 1
          },
          {
            "name": indent_upper,
            "object_value": 100,
            "threshold_value": { "min": 10, "max": 500 },
            "result": 1
          },
          {
            "name": indent_lower,
            "object_value": 100,
            "threshold_value": { "min": 10, "max": 500 },
            "result": 1
          },
          {
            "name": image_size,
            "object_value": 100500,
            "threshold_value": { "min": 10, "max": 100600 },
            "result": 1
          },
          {
            "name": eyebrows_state,
            "object_value": "neutral",
            "threshold_value": ["neutral"],
            "result": 1
          },
          {
            "name": smile_properties,
            "object_value": "smile_lips",
            "threshold_value": ["none"],
            "result": 0
          },
          {
            "name": headwear_type,
            "object_value": "hat",
            "threshold_value": ["none"],
            "result": 0
          },
          {
            "name": natural_light,
            "object_value": 1,
            "threshold_value": 1,
            "result": 1
          },
          {
            "name": radial_distortion,
            "object_value": 0,
            "threshold_value": 0,
            "result": 1
          },
          {
            "name": red_eyes,
            "object_value": 0,
            "threshold_value": 0,
            "result": 1
          },
          {
            "name": face_color_type,
            "object_value": "color",
            "threshold_value": ["color"],
            "result": 1
          },
          {
            "name": illumination_uniformity,
            "object_value": 0.4305162000656128,
            "threshold_value": { "min": 0.5, "max": 1.0 },
            "result": 1
          },
          {
            "name": dynamic_range,
            "object_value": 0.7605162000656128,
            "threshold_value": { "min": 0.5, "max": 1.0 },
            "result": 1
          }
        ]

    face_quality_checks_estimations:
      type: object
      description: face quality estimations checks
      properties:
        status:
          type: integer
          enum: [ 0, 1 ]
          description: check status for all estimates
        checks:
          $ref: '#/components/schemas/face_quality_checks_reply'
      required: [ status, checks ]

    face_detection:
      type: object
      description: face detection
      properties:
        attributes:
          allOf:
          - $ref: '#/components/schemas/attributes'
          - description: face attributes estimation.
        quality:
          allOf:
          - $ref: '#/components/schemas/quality'
          - description: image quality estimation for this face detection region.
        rect:
          allOf:
          - $ref: '#/components/schemas/rect'
          - description: face detection bounding box.
        landmarks5:
          allOf:
          - $ref: '#/components/schemas/landmarks5'
          - description: facial landmarks.
        landmarks68:
          allOf:
          - $ref: '#/components/schemas/landmarks68'
          - description: facial landmarks.

    face_detection_with_quality:
      allOf:
        - $ref: '#/components/schemas/face_detection'
        - properties:
            face_quality:
              allOf:
              - $ref: '#/components/schemas/face_quality_checks_estimations'
              description: face quality checks estimations

    event_face_detection:
      type: object
      description: saved with event face detection
      properties:
        rect:
          allOf:
            - $ref: '#/components/schemas/rect'
            - description: face detection bounding box.

    body_detection:
      type: object
      description: body detection
      properties:
        rect:
          allOf:
          - $ref: '#/components/schemas/rect'
          - description: body detection bounding box.

    event_body_detection:
      type: object
      description: saved with event body detection
      properties:
        rect:
          allOf:
            - $ref: '#/components/schemas/rect'
            - description: body detection bounding box.
    exif:
      description: |
        select image EXIF tags.
        See [CIPA DC-008-2016]( http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf) for details.
        Tag to string conversions is handled by libEXIF.
      type: object
      properties:
        make:
          type: string
          description: make tag (IFD0 0x010f).
        model:
          type: string
          description: model tag (IFD0 0x0110).
        gps:
          type: object
          description: gps tag (IFD 0x8825).
          properties:
            latitude:
              type: string
              description: GPS latitude (IFD GPS 0x0002).
            longitude:
              type: string
              description: GPS longitude (IFD GPS 0x0004).
          required: [latitude, longitude]
        artist:
          type: string
          description: artist tag (IFD0 0x013b).
        software:
          type: string
          description: software tag (IFD0 0x0131).
        flash:
          type: string
          description: flash tag (IFD_EXIF 0x9209)
        orientation:
          type: integer
          description: orientation (IFD0 0x0112).
      example:
        software: "Adobe Photoshop CS5 Macintosh"

    face_detection_sample:
      type: object
      description: face detection sample
      properties:
        sample_id:
          $ref: '#/components/schemas/sample_id'
        detection:
          $ref: '#/components/schemas/face_detection'
        url:
          type: string
          nullable: true
          format: uri-reference
          example: /0/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
          description: location of the sample, null if sample was not stored
      required:
      - detection
      - sample_id
      - url

    face_detection_sample_with_quality:
      allOf:
        - properties:
            detection:
              $ref: '#/components/schemas/face_detection_with_quality'
        - $ref: '#/components/schemas/face_detection_sample'

    input_event_face_detection_sample:
      type: object
      description: face detection sample
      properties:
        sample_id:
          nullable: true
          allOf:
          - $ref: '#/components/schemas/sample_id'
        detection:
          $ref: '#/components/schemas/face_detection_with_quality'
        url:
          description: |
            user saved face sample location. If user does not set it and sample id is not null it will
            be generated automatically.
          example:
            http://127.0.0.1:5020/2/buckets/123/images/45838c8b-04a1-4230-bda0-b5f77609b695
          allOf:
            - $ref: '#/components/schemas/input_url'
      required:
      - detection
      - sample_id

    body_detection_sample:
      type: object
      description: body detection sample
      properties:
        sample_id:
          $ref: '#/components/schemas/sample_id'
        detection:
          $ref: '#/components/schemas/body_detection'
        url:
          type: string
          nullable: true
          format: uri-reference
          example: /0/samples/bodies/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
          description: location of the sample, null if sample was not stored
      required:
        - detection
        - sample_id
        - url

    input_event_body_detection_sample:
      type: object
      description: face detection sample
      properties:
        sample_id:
          nullable: true
          allOf:
          - $ref: '#/components/schemas/sample_id'
        detection:
          $ref: '#/components/schemas/body_detection'
        url:
          description: |
            user saved body sample location. If user does not set it and sample id is not null it will
            be generated automatically.
          example:
            http://127.0.0.1:5020/2/buckets/123/images/45838c8b-04a1-4230-bda0-b5f77609b695
          allOf:
            - $ref: '#/components/schemas/input_url'
      required:
      - detection
      - sample_id

    filename:
      type: string
      example: "penelope.jpeg"
      description: |
        source image file name (preserved only for multipart-form-data requests, otherwise "Raw Image")

    image_error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
        filename:
          $ref: '#/components/schemas/filename'
      required:
        - error
        - filename
      example:
        error:
          desc: Failed to decode image data
          detail: Failed to decode image image data.
          error_code: 3001
        filename: n.jpg

    image_status:
      type: integer
      enum: [0, 1]
      description: image status. 0 - processing image is failed, 1 - success image processed

    verification_status:
      type: boolean
      description: |
        status of verification. `true` - the service assumes that a reference and candidates are same person.

    detector_filtered_detections:
      type: object
      properties:
        face_detections:
          type: array
          items:
            type: object
            description: filtered detection
            properties:
              filter_reasons:
                type: array
                items:
                  $ref: '#/components/schemas/detection_filter_reason'
                minItems: 1
              detection:
                $ref: '#/components/schemas/face_detection'
            required: [filter_reasons, detection]
      required: [face_detections]

    verifier_filtered_detections:
      type: object
      properties:
        face_detections:
          type: array
          items:
            type: object
            description: filtered detection
            properties:
              filter_reasons:
                type: array
                items:
                  $ref: '#/components/schemas/detection_filter_reason'
                minItems: 1
              detection:
                type: object
                properties:
                  filename:
                    $ref: '#/components/schemas/filename'
                  sample:
                    type: object
                    properties:
                      detection:
                        $ref: '#/components/schemas/face_detection_with_quality'
                    required: [detection]
                required: [filename, sample]
            required: [filter_reasons, detection]
      required: [face_detections]

    processed_image:
      type: object
      description: |
        processed image. Status 1 means that the image was processed without errors. Status 0 means
        that the image was processed with errors, information about error is contained in field `error`
        (error `Success` means that image was processed without errors with status `1`).
      properties:
        filename:
          allOf:
            - $ref: '#/components/schemas/filename'
          description: source image file name
        status:
          $ref: '#/components/schemas/image_status'
        error:
          allOf:
            - $ref: '#/components/schemas/Error'
            - example:
                error_code: 11027
                desc: External request failed
                detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
        exif:
          $ref: '#/components/schemas/exif'
      required: [filename, status, error]

    detector_samples:
      type: object
      properties:
        face:
          allOf:
          - $ref: '#/components/schemas/face_detection_sample'
          - description: face detection
      description: only face sample now

    detector_detections:
      type: object
      description: |
        all detections on image which are separated on samples (entity for followig a descriptor extraction) and
        filtered detections (it is debug information).
      properties:
        samples:
          type: array
          items:
            $ref: '#/components/schemas/detector_samples'
          description: detections list which satisfy filters criteria
        filtered_detections:
          $ref: '#/components/schemas/detector_filtered_detections'
      required: [samples, filtered_detections]

    detected_image:
      allOf:
      - $ref: '#/components/schemas/processed_image'
      - type: object
        properties:
          detections:
            $ref: '#/components/schemas/detector_detections'
        required: [detections]
      - description: processed image from detector

    detected_images:
      type: object
      description: processed images from detector
      properties:
        images:
          type: array
          items:
            $ref: '#/components/schemas/detected_image'
          description: proceeded images list
      required: [images]

    handler_processed_images:
      type: array
      description: processed images from a handler
      items:
        $ref: '#/components/schemas/processed_image'

    event_filtered_detections:
      type: object
      properties:
        face_detections:
          type: array
          items:
            type: object
            properties:
              filter_reasons:
                type: array
                items:
                  $ref: '#/components/schemas/detection_filter_reason'
                minItems: 1
              detection:
                type: object
                properties:
                  filename:
                    $ref: '#/components/schemas/filename'
                  sample:
                    type: object
                    properties:
                      detection:
                        $ref: '#/components/schemas/face_detection_with_quality'
                    required: [detection]
                required: [filename, sample]
            required: [filter_reasons, detection]
      required: [face_detections]

    emit_event_reply:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EventFromHandler'
        images:
          $ref: '#/components/schemas/handler_processed_images'
        filtered_detections:
          $ref: '#/components/schemas/event_filtered_detections'
      required: ["events", "images", "filtered_detections"]

    ethnicities_estimations:
      type: object
      description: ethnicity classifier response.
      properties:
        asian:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: Asian ethnicity probability.
        indian:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: Indian ethnicity probability.
        caucasian:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: Caucasian ethnicity probability.
        african_american:
          type: number
          format: double
          maximum: 1
          minimum: 0
          description: African American ethnicity probability.
      required: [african_american, caucasian, indian, asian]

    ethnicities:
      description: estimated ethnicities.
      type: object
      properties:
        estimations:
          allOf:
          - $ref: '#/components/schemas/ethnicities_estimations'
          - description: ethnicity classifier response.
        predominant_ethnicity:
          type: string
          description: name of predominant ethnicity.
      required: [estimations, predominant_ethnicity]
      example:
        estimations:
          african_american: 1.92238889737406e-12
          asian: 0.954671621322632
          caucasian: 0.045328326523304
          indian: 7.65100649502415e-10
        predominant_ethnicity: "asian"

    basic_attributes:
      type: object
      description: basic attributes
      properties:
        age:
          allOf:
            - $ref: '#/components/schemas/age'
            - example: 29
        gender:
          allOf:
            - $ref: '#/components/schemas/gender'
            - example: 1

        ethnicities:
          $ref: '#/components/schemas/ethnicities'
      required: [age, gender, ethnicities]

    attribute_samples:
      type: array
      items:
        $ref: '#/components/schemas/sample_id'
      minItems: 0
      example: [ 'a3e8716f-70dc-42ad-8428-7a552e800a37' ]
      description: resource for attributes

    extracted_face_attributes:
      type: object
      description: extracted face attributes from samples.
      properties:
        filter:
          $ref: '#/components/schemas/extractor_filter'
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes'
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
          description: face descriptor quality score.
        samples:
          allOf:
            - description: face samples
            - $ref: '#/components/schemas/samples'
      required: [samples]

    reextracted_face_attribute:
      type: object
      properties:
        face_id:
          nullable: true
          allOf:
            - description: face id, null if descriptor score is lower than score treshold
            - $ref: '#/components/schemas/face_id'
        url:
          nullable: true
          type: string
          format: uri-reference
          example: /1/faces/24d405ce-bc56-4bf7-98e1-bdc962b4cf34/attributes
          description: location of attributes, null if attribute was not stored
        face_attributes:
          $ref: '#/components/schemas/extracted_face_attributes'
      required: [face_id, url, face_attributes]

    reextracted_event_attribute:
      type: object
      properties:
        event_id:
          allOf:
          - $ref: '#/components/schemas/event_id'
          - description: event id, null if descriptor score is lower than score threshold
          nullable: true
        url:
          nullable: true
          type: string
          format: uri-reference
          example: /1/events/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
          description: location of the event which attributes were updated.
        face_attributes:
          $ref: '#/components/schemas/extracted_face_attributes'
        body_attributes:
          type: object
          description: extracted body attributes from samples.
          properties:
            samples:
              allOf:
                - description: face samples
                - $ref: '#/components/schemas/samples'
            score:
              allOf:
                - $ref: '#/components/schemas/number01'
              description: face descriptor quality score.
          required: [samples, score]
      required: [event_id, url]

    reextracted_attribute:
      oneOf:
        - $ref: '#/components/schemas/reextracted_face_attribute'
        - $ref: '#/components/schemas/reextracted_event_attribute'

    attribute:
      type: object
      properties:
        attribute_id:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/attribute_id'
            - description: attribute id, null if descriptor score is lower than score treshold
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes'
        score:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: face descriptor quality score.
        url:
          nullable: true
          type: string
          format: uri-reference
          example: /0/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
          description: location of attributes, null if attribute was not stored
        samples:
          $ref: '#/components/schemas/attribute_samples'
        filter:
          $ref: '#/components/schemas/extractor_filter'

      required: [attribute_id, url, samples]

    input_event_face_attribute:
      type: object
      description: user extracted event face attributes
      nullable: true
      properties:
        attribute_id:
          $ref: '#/components/schemas/attribute_id'
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes'
        score:
          default: 1
          allOf:
            - $ref: '#/components/schemas/number01'
          description: face descriptor quality score.
        samples:
          minItems: 0
          maxItems: 8
          allOf:
          - $ref: '#/components/schemas/attribute_samples'
        descriptor:
          $ref: '#/components/schemas/sdk_descriptor'
        url:
          description: |
            attributes location url. If user does not set it and `attribute_id` is not null service will generates
            it automaticaly
          allOf:
            - $ref: '#/components/schemas/input_url'

    BodyAttribute:
      type: object
      properties:
        score:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: |
            body descriptor quality score.
            > **WARNING** If body descriptor was extracted, the value is always set to 1.
        samples:
          type: array
          items:
            $ref: '#/components/schemas/sample_id'
          example: ['a3e8716f-70dc-42ad-8428-7a552e800a37']
          description: Stored attribute samples.

      required: [samples]

    input_event_body_attribute:
      type: object
      description: user extracted event body attributes
      nullable: true
      properties:
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
          description: body descriptor quality score.
        samples:
          $ref: '#/components/schemas/attribute_samples'
        descriptor:
          $ref: '#/components/schemas/sdk_descriptor'

    extracted_attributes:
      type: array
      items:
        $ref: '#/components/schemas/attribute'

    candidate_match_result_face:
      type: object
      properties:
        similarity:
          allOf:
          - $ref: '#/components/schemas/similarity'
          - description: face match similarity
        face:
          $ref: '#/components/schemas/face'
      description: match result for the event and a face.
      required: [similarity, face]

    top_match_face:
      type: object
      properties:
        label:
          $ref: '#/components/schemas/label'
        similarity:
          description: similarity to the most similar face.
          allOf:
            - $ref: '#/components/schemas/similarity'
        face_id:
          allOf:
            - $ref: '#/components/schemas/face_id'
            - nullable: true
        external_id:
          allOf:
            - $ref: '#/components/schemas/field_external_id'
            - nullable: true
      required: [label, similarity, face_id, external_id]

    top_match_event:
      type: object
      properties:
        label:
          $ref: '#/components/schemas/top_matching_candidates_label'
        similarity:
          description: similarity to the most similar event.
          allOf:
            - $ref: '#/components/schemas/similarity'
        event_id:
          allOf:
            - $ref: '#/components/schemas/event_id'
            - nullable: true
        external_id:
          allOf:
            - $ref: '#/components/schemas/field_external_id'
            - nullable: true
      required: [label, similarity, event_id, external_id]

    candidate_event:
      type: object
      description: event candidate object in the response
      properties:
        event_id:
          $ref: '#/components/schemas/event_id'
        account_id:
          $ref: '#/components/schemas/face_id'
        create_time:
          allOf:
            - $ref: "#/components/schemas/time"
            - description: time of the event creation.
        end_time:
          allOf:
            - $ref: "#/components/schemas/time"
            - description: the end time of the event.
        external_id:
          $ref: '#/components/schemas/event_external_id'
        handler_id:
          $ref: '#/components/schemas/handler_id'
        source:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/source'
        top_match:
          nullable: true
          description: top match result from match policy
          oneOf:
            - $ref: '#/components/schemas/top_match_face'
            - $ref: '#/components/schemas/top_match_event'
        match_result:
          type: array
          nullable: true
          description: saved event matches by faces or events
          items:
            $ref: '#/components/schemas/event_match_result'
        face_detections:
          nullable: true
          type: array
          items:
            type: object
            properties:
              sample_id:
                $ref: '#/components/schemas/sample_id'
              detection:
                $ref: '#/components/schemas/event_face_detection'
              detect_time:
                $ref: "#/components/schemas/detect_time"
              image_origin:
                $ref: "#/components/schemas/image_origin"
            required: [sample_id, detect_time, image_origin]
        body_detections:
          nullable: true
          type: array
          items:
            type: object
            properties:
              sample_id:
                $ref: '#/components/schemas/sample_id'
              detection:
                $ref: '#/components/schemas/event_body_detection'
              detect_time:
                $ref: "#/components/schemas/detect_time"
              image_origin:
                $ref: "#/components/schemas/image_origin"
            required: [sample_id, detect_time, image_origin]
        face_id:
          allOf:
            - $ref: '#/components/schemas/face_id'
            - nullable: true
        attach_result:
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          nullable: true
        gender:
          allOf:
            - $ref: '#/components/schemas/gender'
            - nullable: true
        age:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/age'
        emotion:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/emotion'
        liveness:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/liveness_state'
        mask:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/mask'
        ethnic_group:
          allOf:
          - $ref: '#/components/schemas/ethnic_group'
          - nullable: true
        tags:
          nullable: true
          allOf:
          - $ref: '#/components/schemas/tags'
        user_data:
          $ref: '#/components/schemas/event_user_data'
        location:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/location'
        track_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/track_id'

    Candidate_Match_Result_Event:
      type: object
      properties:
        similarity:
          allOf:
          - $ref: '#/components/schemas/similarity'
          - description: face match similarity
        event:
          $ref: '#/components/schemas/candidate_event'
      description: sorted list with match result for the event and a event.
      required: [similarity, event]

    match_candidates_faces:
      type: object
      properties:
        label:
          $ref: '#/components/schemas/top_matching_candidates_label'
        candidates:
          type: array
          description: list of faces candidates
          items:
            $ref: '#/components/schemas/candidate_match_result_face'
      required: [label, candidates]

    match_candidates_events:
      type: object
      properties:
        label:
          $ref: '#/components/schemas/top_matching_candidates_label'
        candidates:
          type: array
          description: list of events candidates
          items:
            $ref: '#/components/schemas/Candidate_Match_Result_Event'
      required: [label, candidates]

    match_candidates_face_in_event_candidates_in_target_match_result:
      type: object
      properties:
        face:
          type: object
          properties:
            face_id:
              allOf:
                - $ref: '#/components/schemas/face_id'
                - nullable: true
            user_data:
              allOf:
                - $ref: '#/components/schemas/face_user_data'
                - nullable: true
            create_time:
              allOf:
                - $ref: '#/components/schemas/create_time'
                - nullable: true
            external_id:
              allOf:
                - $ref: '#/components/schemas/face_external_id'
                - nullable: true
        similarity:
          allOf:
          - $ref: '#/components/schemas/similarity'
          description: face candidate similarity
      required: [face, similarity]

    create_time:
      allOf:
        - $ref: "#/components/schemas/time"
        - description: time of the obejct creation.

    match_candidates_events_in_event_candidates_in_target_match_result:
      type: object
      description: event candidate object in the response
      properties:
        event:
          type: object
          properties:
            event_id:
              allOf:
                - $ref: '#/components/schemas/event_id'
                - nullable: true
            user_data:
              allOf:
              - $ref: '#/components/schemas/event_user_data'
              nullable: true
            create_time:
              allOf:
                - $ref: '#/components/schemas/create_time'
                - nullable: true
            external_id:
              allOf:
                - $ref: '#/components/schemas/event_external_id'
                - nullable: true
            handler_id:
              allOf:
                - $ref: '#/components/schemas/handler_id'
                - nullable: true
            source:
              allOf:
                - $ref: '#/components/schemas/source'
                - nullable: true
        similarity:
          allOf:
          - $ref: '#/components/schemas/similarity'
          description: event candidate similarity
      required: [event, similarity]

    event_match_result:
      type: object
      description: saved event matches by a set of candidates
      properties:
        label:
          $ref: '#/components/schemas/label'
        candidates:
          anyOf:
          - type: array
            description: saved event matches by faces
            items:
              $ref: '#/components/schemas/match_candidates_face_in_event_candidates_in_target_match_result'
          - type: array
            description: saved event matches by events
            items:
              $ref: '#/components/schemas/match_candidates_events_in_event_candidates_in_target_match_result'
      required: [label, candidates]

    match_candidates_reply:
      anyOf:
        - $ref: '#/components/schemas/match_candidates_faces'
        - $ref: '#/components/schemas/match_candidates_events'

    matches:
      description: sorted list with match result for the event.
      type: array
      items:
        $ref: '#/components/schemas/match_candidates_reply'
      example:
        [{
           label: good guys,
           candidates: [{
                          face:{
                            face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6,
                            external_id: 2xQ2gprbMUePw1s9gw9fvA==,
                            user_data: fox1991,
                            create_time: "2018-08-11T09:11:41.674Z",
                            lists: ["429b0e78-4616-426a-b57f-02baa72d638d", '6d037c33-31ec-4d73-b3b3-ec80b09446c2'],
                            avatar: 'https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg',
                            event_id: f9687459-986b-406d-9c1f-0d6289be5256
                          },
                          similarity: 0.5
                        }]},
         {
           label: bad guys,
           candidates: [{
                          event:{
                            event_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7,
                            external_id: 2xQ2gprbMUePw1s9gw9fvA==,
                            user_data: fox1991,
                            create_time: "2018-08-11T09:11:41.674Z",
                            handler_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7,
                            source: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7
                          },
                          similarity: 0.3
                        }]}]

    json_with_base_64_image:
      type: object
      properties:
        image:
          type: string
          description: image in base64
        mimetype:
          type: string
          enum: [ "image/x-jpeg-base64", "image/x-png-base64", "image/x-bmp-base64", "image/x-tiff-base64",
                  "image/x-portable-pixmap-base64" ]
          description: image mimetype
        face_bounding_boxes:
          allOf:
            - description: array with face bounding boxes for image (now support only 1 bounding box)
            - $ref: '#/components/schemas/base_bounding_boxes'
      required: [ image, mimetype ]

    detector_json_with_base_64_image:
      allOf:
        - $ref: '#/components/schemas/json_with_base_64_image'
      required: [image, mimetype, face_bounding_boxes]

    sdk_json_with_base_64_image:
      allOf:
        - $ref: '#/components/schemas/json_with_base_64_image'
        - properties:
            body_bounding_boxes:
              allOf:
                - description: array with body bounding boxes for image (now support only 1 bounding box)
                - $ref: '#/components/schemas/base_bounding_boxes'

    handler_json_with_base_64:
      type: object
      properties:
        image:
          type: string
          description: image or raw descriptor in base64
        mimetype:
          type: string
          enum: ["image/x-jpeg-base64", "image/x-png-base64", "image/x-bmp-base64", "image/x-tiff-base64",
                 "image/x-portable-pixmap-base64", "application/x-sdk-descriptor-base64", "application/x-vl-xpk-base64"]
          description: image mimetype
        detect_time:
          $ref: '#/components/schemas/detect_time'
        face_bounding_boxes:
          allOf:
            - description: array with face bounding boxes for image (now support only 1 bounding box)
            - $ref: '#/components/schemas/base_bounding_boxes'
        body_bounding_boxes:
          allOf:
            - description: array with body bounding boxes for image (now support only 1 bounding box)
            - $ref: '#/components/schemas/base_bounding_boxes'
        image_origin:
          $ref: '#/components/schemas/image_origin_not_nullable'
      required: [image, mimetype]

    verify_json_with_base_64:
      type: object
      properties:
        image:
          type: string
          description: image or raw descriptor in base64
        mimetype:
          type: string
          enum: [ "image/x-jpeg-base64", "image/x-png-base64", "image/x-bmp-base64", "image/x-tiff-base64",
                  "image/x-portable-pixmap-base64", "application/x-sdk-descriptor-base64", "application/x-vl-xpk-base64" ]
          description: image/descriptor mimetype
        face_bounding_boxes:
          allOf:
            - description: array with face bounding boxes for image (now support only 1 bounding box)
            - $ref: '#/components/schemas/base_bounding_boxes'
      required: [ image, mimetype ]

    url_for_detection:
      type: object
      description: url object for processing pipeline
      properties:
        url:
          type: string
          format: uri-reference
          description: image url
          example: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Abbey_Lee_2015.jpg/800px-Abbey_Lee_2015.jpg"
        face_bounding_boxes:
          allOf:
            - description: array with face bounding boxes for image (now support only 1 bounding box for each image)
            - $ref: '#/components/schemas/base_bounding_boxes'
      required: [ url ]

    json_request_body_urls:
      type: object
      properties:
        urls:
          type: array
          items:
            $ref: '#/components/schemas/url_for_detection'
          minItems: 1
          maxItems: 8
      required: [urls]

    handler_json_request_body_urls:
      type: object
      description: urls object for generated events
      properties:
        urls:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/url_for_detection'
              - properties:
                  body_bounding_boxes:
                    allOf:
                      - description: array with body bounding boxes for image (now support only 1 bounding box for each image)
                      - $ref: '#/components/schemas/base_bounding_boxes'
                  detect_time:
                    $ref: '#/components/schemas/detect_time'
                  image_origin:
                    $ref: '#/components/schemas/image_origin_not_nullable'
          minItems: 1
          maxItems: 8
      required: [ urls ]

    sdk_json_request_body_urls:
      type: object
      properties:
        urls:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/url_for_detection'
              - properties:
                  body_bounding_boxes:
                    allOf:
                      - description: array with body bounding boxes for image (now support only 1 bounding box for each image)
                      - $ref: '#/components/schemas/base_bounding_boxes'
            required: [ url ]
          minItems: 1
          maxItems: 8
      required: [ urls ]

    list_samples:
      type: object
      properties:
        samples:
          type: array
          items:
            allOf:
            - $ref: '#/components/schemas/sample_id'
          minItems: 1
          maxItems: 8
          description: |
            list of sample ids

            > **WARNING** The type of samples is determined by *`image_type`* / *`warped_image`* parameter.
            The detector stage of image processing pipeline is triggered for non-warped images and skipped for warps.

          example:
          - "c724fea1-d1bb-44c5-af6d-9833d22f3eb7"
          - "f78c6156-3946-4767-be65-4748f25aefd4"
      required: [samples]

    sample_for_detection:
      type: object
      description: samples object with detection time
      properties:
        sample_id:
          $ref: '#/components/schemas/sample_id'
        detect_time:
          $ref: '#/components/schemas/detect_time'
        image_origin:
          $ref: '#/components/schemas/image_origin_not_nullable'
      required: [sample_id]

    samples_for_detection:
      type: object
      description: samples including their ids and detection time for processing pipeline
      properties:
        samples:
          type: array
          items:
            $ref: '#/components/schemas/sample_for_detection'
          minItems: 1
          maxItems: 8
          description: list of sample object with ids and detection time
      required: [samples]
      example:
        samples:
          - sample_id: "c724fea1-d1bb-44c5-af6d-9833d22f3eb7"
            detect_time: "2018-08-11T09:11:41.674Z"
            image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    emit_event_json_request_body:
      oneOf:
        - $ref: '#/components/schemas/handler_json_with_base_64'
        - $ref: '#/components/schemas/handler_json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'
        - $ref: '#/components/schemas/samples_for_detection'

    detect_json_request_body:
      oneOf:
        - $ref: '#/components/schemas/detector_json_with_base_64_image'
        - $ref: '#/components/schemas/json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'

    sdk_json_request_body:
      oneOf:
        - $ref: '#/components/schemas/sdk_json_with_base_64_image'
        - $ref: '#/components/schemas/sdk_json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'

    verify_json_request_body:
      oneOf:
        - $ref: '#/components/schemas/verify_json_with_base_64'
        - $ref: '#/components/schemas/json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'

    iso_json_request_body:
      oneOf:
        - $ref: '#/components/schemas/json_with_base_64_image'
        - $ref: '#/components/schemas/json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'

    image:
       type: string
       format: binary or byte

    multipart_images:
      type: array
      items:
        $ref: '#/components/schemas/image'
      description: Content-Disposition header must contains actual filename.
        It is only possible to send many images with different filenames.
        This part must have valid Content-Type header (one of "image/x-jpeg-base64", "image/jpeg",
        "image/x-png-base64", "image/png", "image/x-bmp-base64", "image/bmp", "image/x-tiff-base64",
        "image/tiff", "image/x-portable-pixmap-base64", "image/x-portable-pixmap")

    base_bounding_boxes:
      type: array
      description: array with bounding boxes
      items:
        $ref: '#/components/schemas/rect'
      minItems: 1

    face_bounding_boxes:
       type: array
       description: map with image filenames and arrays of face bounding boxes
       items:
         type: object
         properties:
           filename:
             type: string
             description: Image filename. It must be the same as one of 'image' request part filename
           face_bounding_boxes:
              allOf:
                - description: array with face bounding boxes for image (now support only 1 bounding box)
                - $ref: '#/components/schemas/base_bounding_boxes'
         required: [filename, face_bounding_boxes]
       minItems: 1

    body_bounding_boxes:
      type: array
      description: map with image filenames and arrays of body bounding boxes
      items:
        type: object
        properties:
          filename:
            type: string
            description: Image filename. It must be the same as one of 'image' request part filename
          body_bounding_boxes:
            allOf:
              - description: array with body bounding boxes for image (now support only 1 bounding box)
              - $ref: '#/components/schemas/base_bounding_boxes'
        required: [filename, body_bounding_boxes]
      minItems: 1

    multipart_image_schema:
      type: object
      properties:
        image:
          $ref: '#/components/schemas/image_list_for_multipart'
        face_bounding_boxes:
          $ref: '#/components/schemas/face_bounding_boxes'
      required: [image]

    multipart_sdk_image_schema:
      type: object
      properties:
        image:
          $ref: '#/components/schemas/multipart_images'
        face_bounding_boxes:
          $ref: '#/components/schemas/face_bounding_boxes'
        body_bounding_boxes:
          $ref: '#/components/schemas/body_bounding_boxes'
      required: [image]

    multipart_raw_data_schema_with_policies:
      type: object
      properties:
        policies:
          $ref: '#/components/schemas/Policies'
        image:
          $ref: '#/components/schemas/raw_data_list_for_multipart'
        face_bounding_boxes:
          $ref: '#/components/schemas/face_bounding_boxes'
        body_bounding_boxes:
          $ref: '#/components/schemas/body_bounding_boxes'
        image_detect_time:
          $ref: '#/components/schemas/image_detect_time'
        image_origin:
          $ref: '#/components/schemas/image_origin_list'
      required: [image]

    multipart_verifier_payload:
      type: object
      properties:
        image:
          $ref: '#/components/schemas/raw_data_list_for_multipart'
        face_bounding_boxes:
          $ref: '#/components/schemas/face_bounding_boxes'
      required: [image]

    accept_docs_handler:
      type: string
      enum: [application/x-yaml, text/html]

    extracted_sdk_descriptor:
      description: sdk descriptor.
      type: object
      properties:
        sdk_descriptor:
          $ref: '#/components/schemas/sdk_descriptor'
        score:
          allOf:
          - $ref: '#/components/schemas/number01'
          - description: descriptor score (always 1 for body descriptor)

    face_warp:
      type: string
      format: byte
      description: face warped image in jpg format

    body_warp:
      type: string
      format: byte
      description: human body warped image in jpg format

    mask_estimations:
      type: object
      description: raw mask estimations
      properties:
        medical_mask:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: The probability that the `medical mask` exists on the face and is worn properly
        missing:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: The probability that the `medical mask` doesn't exist on the face
        occluded:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: The probability that the face is occluded by other object (not by `medical mask`)
      required: [medical_mask, missing, occluded]

    mask_predominant:
      type: string
      enum: [medical_mask, missing, occluded]
      description: most likely mask state

    masks:
      type: object
      description: estimated face mask state
      properties:
        estimations:
          $ref: '#/components/schemas/mask_estimations'
        predominant_mask:
          $ref: '#/components/schemas/mask_predominant'
      required: [estimations, predominant_mask]

    glasses_estimations:
      type: string
      enum: [no_glasses, eyeglasses, sunglasses]
      description: glasses estimation

    glasses:
      type: object
      description: estimated glasses
      properties:
        glasses:
          $ref: '#/components/schemas/glasses_estimations'
      required: [glasses]

    sdk_face_attributes:
      description: face attributes.
      type: object
      properties:
        mouth_attributes:
          allOf:
            - $ref: '#/components/schemas/mouth_attributes'
            - description: optional mouth attributes.
        eyes_attributes:
          allOf:
            - $ref: '#/components/schemas/eyes_attributes'
            - description: optional eye attributes.
        emotions:
          allOf:
            - $ref: '#/components/schemas/emotions'
            - description: face emotions estimation.
        head_pose:
          allOf:
            - $ref: '#/components/schemas/head_pose'
            - description: head pose estimation.
        gaze:
          allOf:
            - $ref: '#/components/schemas/gaze_direction'
            - description: gaze direction estimation.
        descriptor:
          $ref: '#/components/schemas/extracted_sdk_descriptor'
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes'
        mask:
          $ref: '#/components/schemas/masks'
        glasses:
          $ref: '#/components/schemas/glasses'
        liveness:
          $ref: '#/components/schemas/liveness'

    liveness:
      type: object
      description: liveness prediction
      properties:
        prediction:
          type: string
          enum: [spoof, real, unknown]
          description: liveness prediction name
        estimations:
          type: object
          description: liveness estimations
          properties:
            quality:
              allOf:
                - $ref: '#/components/schemas/number01'
              description: liveness quality score
            score:
              allOf:
                - $ref: '#/components/schemas/number01'
              description: liveness prediction score
          required: [quality, score]
      required: [prediction, estimations]

    sdk_face_detections:
      type: object
      properties:
        attributes:
          allOf:
            - $ref: '#/components/schemas/sdk_face_attributes'
            - description: face attributes estimation.
        quality:
          allOf:
            - $ref: '#/components/schemas/quality'
            - description: image quality estimation for this face detection region.
        rect:
          allOf:
            - $ref: '#/components/schemas/rect'
            - description: face detection bounding box.
        landmarks5:
          allOf:
            - $ref: '#/components/schemas/landmarks5'
            - description: facial landmarks.
        landmarks68:
          allOf:
            - $ref: '#/components/schemas/landmarks68'
            - description: facial landmarks.
        warp:
          $ref: '#/components/schemas/face_warp'


    sdk_face_estimations:
      description: face detection estimations
      type: object
      properties:
        detection:
          $ref: '#/components/schemas/sdk_face_detections'
      required: [detection]
      nullable: true

    sdk_body_attributes:
      description: human body attributes.
      type: object
      properties:
        descriptor:
          $ref: '#/components/schemas/extracted_sdk_descriptor'

    sdk_body_detections:
      type: object
      properties:
        attributes:
          $ref: '#/components/schemas/sdk_body_attributes'
        rect:
          allOf:
            - $ref: '#/components/schemas/rect'
            - description: face detection bounding box.
        warp:
          $ref: '#/components/schemas/body_warp'

    sdk_body_estimations:
      description: human body detection estimations
      type: object
      properties:
        detection:
          $ref: '#/components/schemas/sdk_body_detections'
      required: [detection]
      nullable: true

    one_image_estimation:
      type: object
      properties:
        filename:
          $ref: '#/components/schemas/filename'
        estimations:
          description: |
            list of related detections, i.e. body & face related samples that refer to the one person.
            If one of **body** or **face** field is *null*, it means that either the corresponding detection is disabled
            (see *detect_face*, *detect_body* parameters), or the detection has been filtered.
            Both **body** and **face** fields in a related detection can not be *null* at the same time.
          type: array
          items:
            type: object
            properties:
              face:
                $ref: '#/components/schemas/sdk_face_estimations'
              body:
                $ref: '#/components/schemas/sdk_body_estimations'
            required: [face, body]
      required: [filename, estimations]

    aggregate_estimations:
      type: object
      description: |
        aggregated attributes.
        If one of **body** or **face** field is *null*, it means that either the corresponding aggregation is disabled
        (see *aggregate_attributes*, *estimate_face_descriptor*, *estimate_body_descriptor* parameters),
        or the attribute has been filtered.
      properties:
        body:
          type: object
          properties:
            attributes:
              description: human body aggregate estimations
              type: object
              properties:
                descriptor:
                  $ref: '#/components/schemas/extracted_sdk_descriptor'
          required: [attributes]
          nullable: true
        face:
          type: object
          properties:
            attributes:
              description: face aggregate estimations
              type: object
              properties:
                descriptor:
                  $ref: '#/components/schemas/extracted_sdk_descriptor'
                basic_attributes:
                  $ref: '#/components/schemas/basic_attributes'
                mask:
                  $ref: '#/components/schemas/masks'
                emotions:
                  $ref: '#/components/schemas/emotions'
                liveness:
                  $ref: '#/components/schemas/liveness'
          required: [attributes]
          nullable: true
      required: [face, body]

    sdk_response_json:
      type: object
      properties:
        images_estimations:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/one_image_estimation'
              - $ref: '#/components/schemas/image_error'
        aggregate_estimations:
          $ref: '#/components/schemas/aggregate_estimations'
      required: [images_estimations]

    sdk_response_msgpack:
      type: object
      properties:
        images_estimations:
          type: array
          items:
            oneOf:
              - allOf:
                - properties:
                    estimations:
                      items:
                        properties:
                          face:
                            properties:
                              detection:
                                properties:
                                  warp:
                                    format: binary
                                  attributes:
                                    properties:
                                      descriptor:
                                        properties:
                                          sdk_descriptor:
                                            format: binary
                          body:
                            properties:
                              detection:
                                properties:
                                  warp:
                                    format: binary
                                  attributes:
                                    properties:
                                      descriptor:
                                        properties:
                                          sdk_descriptor:
                                            format: binary
                - $ref: '#/components/schemas/one_image_estimation'
              - $ref: '#/components/schemas/image_error'
        aggregate_estimations:
          allOf:
          - properties:
              face:
                properties:
                  attributes:
                    properties:
                      descriptor:
                        properties:
                          sdk_descriptor:
                            format: binary
              body:
                properties:
                  attributes:
                    properties:
                      descriptor:
                        properties:
                          sdk_descriptor:
                            format: binary
          - $ref: '#/components/schemas/aggregate_estimations'
      required: [ images_estimations ]

    image_binary_for_multipart:
      type: string
      format: binary
      description: |
        Binary image.

        Content-Disposition header must contain actual filename.

        Filenames are used to differentiate images, they must be unique within the request.

        This part must have valid Content-Type header (one of "image/jpeg", "image/png", "image/bmp", "image/tiff",
        "image/x-portable-pixmap")

    image_base64_for_multipart:
      type: string
      description: |
        Image encoded in base64.

        This part must have valid Content-Type header (one of "image/x-jpeg-base64", "image/x-png-base64",
        "image/x-bmp-base64", "image/x-tiff-base64", "image/x-portable-pixmap-base64")

    image_for_multipart:
      oneOf:
        - $ref: '#/components/schemas/image_binary_for_multipart'
        - $ref: '#/components/schemas/image_base64_for_multipart'

    image_list_for_multipart:
      type: array
      items:
        $ref: '#/components/schemas/image_for_multipart'
      minItems: 1

    raw_data_binary_for_multipart:
      type: string
      format: binary
      description: |
        Binary image or raw descriptror data (SDK descripror or XPK file).

        Content-Disposition header must contain actual filename.

        Filenames are used to differentiate images, they must be unique within the request.

        This part must have valid Content-Type header (one of "image/jpeg", "image/png", "image/bmp", "image/tiff",
        "image/x-portable-pixmap", "application/x-sdk-descriptor", "application/x-vl-xpk")

    raw_data_base64_for_multipart:
      type: string
      description: |
        Image encoded in base64.

        This part must have valid Content-Type header (one of "image/x-jpeg-base64", "image/x-png-base64",
        "image/x-bmp-base64", "image/x-tiff-base64", "image/x-portable-pixmap-base64",
        "application/x-sdk-descriptor-base64", "application/x-vl-xpk-base64")

    raw_data_for_multipart:
      oneOf:
        - $ref: '#/components/schemas/raw_data_binary_for_multipart'
        - $ref: '#/components/schemas/raw_data_base64_for_multipart'

    raw_data_list_for_multipart:
      type: array
      items:
        $ref: '#/components/schemas/raw_data_for_multipart'
      minItems: 1

    image_detect_time:
      type: array
      description: map with image filename and detection time
      items:
        type: object
        properties:
          filename:
            type: string
            description: Image filename. It must be the same as one of 'image' request part filename
          detect_time:
            $ref: "#/components/schemas/detect_time"
        required: [filename, detect_time]
      minItems: 1

    image_origin_list:
      type: array
      description: map with image filename and image origin
      items:
        type: object
        properties:
          filename:
            type: string
            description: Image filename. It must be the same as one of 'image' request part filename
          image_origin:
            $ref: '#/components/schemas/image_origin_not_nullable'
        required: [filename, image_origin]
      minItems: 1

    verifier_detect_policy:
      type: object
      properties:
        multiface_policy:
          allOf:
            - description: |
                  multiple face detection policy:
                  - *`0`* - multiple face detection not allowed
                  - *`1`* - multiple face detection allowed
                  - *`2`* - get best face detection from the image
            - $ref: '#/components/schemas/multiface_policy'
        estimate_head_pose:
          $ref: '#/components/schemas/estimate_head_pose'
        estimate_emotions:
          $ref: '#/components/schemas/estimate_emotions'
        estimate_mask:
          $ref: '#/components/schemas/estimate_mask'
        estimate_quality:
          $ref: '#/components/schemas/estimate_quality'
        estimate_gaze:
          $ref: '#/components/schemas/estimate_gaze'
        estimate_eyes_attributes:
          $ref: '#/components/schemas/estimate_eyes_attributes'
        estimate_mouth_attributes:
          $ref: '#/components/schemas/estimate_mouth_attributes'
        detect_landmarks68:
          $ref: '#/components/schemas/detect_landmarks68'
        extract_exif:
          $ref: '#/components/schemas/extract_exif'
        yaw_threshold:
          allOf:
            - $ref: '#/components/schemas/yaw_threshold'
            - nullable: true
        roll_threshold:
          allOf:
            - $ref: '#/components/schemas/roll_threshold'
            - nullable: true
        pitch_threshold:
          allOf:
            - $ref: '#/components/schemas/pitch_threshold'
            - nullable: true
        mask_states:
          allOf:
            - $ref: '#/components/schemas/mask_states'
            - nullable: true
        estimate_liveness:
          $ref: '#/components/schemas/estimate_liveness'
        liveness_states:
          allOf:
            - $ref: '#/components/schemas/liveness_states'
            - nullable: true
        face_quality:
          $ref: '#/components/schemas/face_quality'

      description:  |
        policy determinates parameters for face detection.

    verifier_detect_policy_required:
      allOf:
        - $ref: '#/components/schemas/verifier_detect_policy'
        - required: [multiface_policy, estimate_head_pose, estimate_emotions, estimate_mask, estimate_quality,
                     estimate_gaze, estimate_eyes_attributes, estimate_mouth_attributes, detect_landmarks68,
                     extract_exif, yaw_threshold, roll_threshold, pitch_threshold, mask_states, estimate_liveness,
                     liveness_states, face_quality]

    verifier_extract_policy:
      type: object
      properties:
        extract_basic_attributes:
          $ref: '#/components/schemas/extract_basic_attributes'
        fd_score_threshold:
          $ref: '#/components/schemas/score_threshold'
      description: policy determinates parameters for attributes extraction.

    verifier_extract_policy_required:
      allOf:
        - $ref: '#/components/schemas/verifier_extract_policy'
        - required: [extract_basic_attributes, fd_score_threshold]

    verifier_storage_policy:
      description: verifier object's storing policy
      type: object
      properties:
        attribute_policy:
          description: attribute storing policy
          type: object
          properties:
            store_attribute:
              allOf:
                - description: whether to store attribute
                - $ref: '#/components/schemas/int01'
              default: 0
          example:
            store_attribute: 0
        face_sample_policy:
          description: face sample storing policy
          type: object
          properties:
            store_sample:
              allOf:
                - description: whether to store face sample
                - $ref: '#/components/schemas/int01'
              default: 0
          example:
            store_sample: 0

    verifier_storage_policy_required:
      $ref: '#/components/schemas/verifier_storage_policy'

    verification_threshold:
      allOf:
      - $ref: '#/components/schemas/number01'
      description: verification similarity threshold

    new_verifier:
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        description:
          type: string
          maxLength: 128
          description: verifier user description.
          example: strict verifier
        policies:
          type: object
          properties:
            verification_threshold:
              allOf:
                - $ref: '#/components/schemas/verification_threshold'
              default: 0.9
            detect_policy:
              $ref: '#/components/schemas/verifier_detect_policy'
            extract_policy:
              $ref: '#/components/schemas/verifier_extract_policy'
            storage_policy:
              $ref: '#/components/schemas/verifier_storage_policy'
      required: [account_id]

    verifier_response:
      type: object
      properties:
        verifier_id:
          $ref: '#/components/schemas/handler_id'
        account_id:
          $ref: '#/components/schemas/account_id'
        description:
          type: string
          maxLength: 128
          description: user description.
        policies:
          type: object
          properties:
            verification_threshold:
              $ref: '#/components/schemas/verification_threshold'
            detect_policy:
              $ref: '#/components/schemas/verifier_detect_policy_required'
            extract_policy:
              $ref: '#/components/schemas/verifier_extract_policy_required'
            storage_policy:
              $ref: '#/components/schemas/verifier_storage_policy_required'
          required: [verification_threshold, detect_policy, extract_policy, storage_policy]
        create_time:
          type: string
          format: date-time
          description: the verifier creation time.
        last_update_time:
          type: string
          format: date-time
          description: the verifier last update time.
        version:
          description: verifier current version (increases on update)
          type: integer
          minimum: 0
          example: 111
      required: [verifier_id, account_id, description, create_time, last_update_time, policies, version]

    raw_descriptor:
      type: string
      format: binary
      description: raw descriptor

    descriptor_data:
      type: object
      description: descriptor and descriptor version
      properties:
        descriptor:
          $ref: '#/components/schemas/raw_descriptor'
        version:
          $ref: '#/components/schemas/descriptor_version'
      required: [descriptor, version]

    descriptor_version:
      type: integer
      description: face descriptor version
      enum: [46, 52, 54, 56, 57, 58, 59]
      example: 56

    body_descriptor_version:
      type: integer
      description: body descriptor version
      enum: [102, 103, 104]
      example: 104

    xpk_file:
      type: string
      format: binary
      description:  xpk file with descriptors

    identification_id:
      allOf:
      - $ref: '#/components/schemas/common_id'
      - description:  id for identification in the match results
      - example: 3456d

    raw_descriptor_entity_binary:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/identification_id'
        type:
          type: string
          enum: ["raw_descriptor"]
        data:
          $ref: '#/components/schemas/descriptor_data'
      required: [id, type, data]

    raw_descriptor_entity_base64:
      allOf:
      - type: object
        properties:
          data:
            type: object
            properties:
              descriptor:
                type: string
                format: byte
      - $ref: '#/components/schemas/raw_descriptor_entity_binary'

    sdk_descriptor_entity_binary:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/identification_id'
        type:
          type: string
          enum: ["sdk_descriptor"]
          description:  type corresponds to a `x-vl-face-descriptor` content type
        data:
          $ref: '#/components/schemas/sdk_descriptor'
      required: [id, type, data]

    sdk_descriptor_entity_base64:
      allOf:
      - type: object
        properties:
          data:
            type: string
            format: byte
      - $ref: '#/components/schemas/sdk_descriptor_entity_binary'

    xpk_file_entity_binary:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/identification_id'
        type:
          type: string
          enum: ["xpk_file"]
          description: type corresponds to a `application/x-vl-xpk` content type
        data:
          $ref: '#/components/schemas/xpk_file'
      required: [id, type, data]

    xpk_file_entity_base64:
      allOf:
      - type: object
        properties:
          data:
            type: string
            format: byte
      - $ref: '#/components/schemas/xpk_file_entity_binary'

    raw_verification_request_json:
      type: object
      properties:
        references:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/xpk_file_entity_base64'
              - $ref: '#/components/schemas/sdk_descriptor_entity_base64'
              - $ref: '#/components/schemas/raw_descriptor_entity_base64'
          description: reference list for verification
          minItems: 1
        candidates:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/xpk_file_entity_base64'
              - $ref: '#/components/schemas/sdk_descriptor_entity_base64'
              - $ref: '#/components/schemas/raw_descriptor_entity_base64'
          minItems: 1
          description: candidates for verification
      required: [references, candidates]

    raw_verification_request_msgpack:
      type: object
      properties:
        references:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/xpk_file_entity_binary'
              - $ref: '#/components/schemas/sdk_descriptor_entity_binary'
              - $ref: '#/components/schemas/raw_descriptor_entity_binary'
          description: reference list for verification
          minItems: 1
        candidates:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/xpk_file_entity_binary'
              - $ref: '#/components/schemas/sdk_descriptor_entity_binary'
              - $ref: '#/components/schemas/raw_descriptor_entity_binary'
          minItems: 1
          description: candidates for verification
      required: [references, candidates]

    raw_match_reference_id:
      allOf:
      - description: reference id for identification in the match results
      - example: 123456s
      - $ref: '#/components/schemas/common_id'

    raw_match_candidate_id:
      allOf:
      - description: candidate id for identification in the match results
      - example: 56789t
      - $ref: '#/components/schemas/common_id'

    raw_verification_response:
      type: object
      properties:
        matches:
          type: array
          items:
            type: object
            properties:
              reference_id:
                $ref: '#/components/schemas/raw_match_reference_id'
              matches:
                type: array
                items:
                  description: sorted list with success match result for the *reference_id* vs candidate batch.
                  type: object
                  properties:
                    candidate_id:
                      $ref: '#/components/schemas/raw_match_candidate_id'
                    similarity:
                      $ref: '#/components/schemas/similarity'
                    status:
                      $ref: '#/components/schemas/verification_status'
                  required: [candidate_id, similarity, status]
                minItems: 1
                description: reference vs candidates matches
            required: [reference_id, matches]
          minItems: 1
          description: list of matches
      required: [matches]

    verifier_base_verification:
      type: object
      properties:
        similarity:
          allOf:
          - $ref: '#/components/schemas/similarity'
          description: similarity score
        status:
          $ref: '#/components/schemas/verification_status'
          description: verification result
      required: [similarity, status]

    verifier_event_verification:
      allOf:
        - $ref: '#/components/schemas/verifier_base_verification'
        - type: object
          properties:
            event:
              type: object
              properties:
                event_id:
                  $ref: '#/components/schemas/event_id'
              description: Verification against an event id
              required: [event_id]
      required: [event]

    verifier_face_verification:
      allOf:
        - $ref: '#/components/schemas/verifier_base_verification'
        - type: object
          properties:
            face:
              type: object
              properties:
                face_id:
                  $ref: '#/components/schemas/face_id'
              description: Verification against a face
              required: [face_id]
      required: [face]

    verifier_attribute_verification:
      allOf:
        - $ref: '#/components/schemas/verifier_base_verification'
        - type: object
          properties:
            attribute:
              type: object
              properties:
                attribute_id:
                  $ref: '#/components/schemas/attribute_id'
              description: Verification against an attribute
              required: [ attribute_id ]
      required: [ attribute ]

    verifier_face_external_id_verification:
      allOf:
        - $ref: '#/components/schemas/verifier_base_verification'
        - type: object
          properties:
            face:
              type: object
              properties:
                external_id:
                  $ref: '#/components/schemas/face_external_id'
              description: Verification against a face
              required: [ external_id ]
      required: [ similarity, status, face ]

    verifier_face_detection_face_attributes:
      type: object
      properties:
        attribute_id:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/attribute_id'
          description: attribute id, null if descriptor score is lower than score treshold
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes'
        score:
          allOf:
          - $ref: '#/components/schemas/number01'
          description: face descriptor quality score.
        url:
          nullable: true
          type: string
          format: uri-reference
          example: /0/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
          description: location of attributes, null if descriptor score is lower than score treshold
        samples:
          type: array
          items:
            $ref: '#/components/schemas/sample_id'
          example: ['a3e8716f-70dc-42ad-8428-7a552e800a37']
          description: resource for attributes.

      required: [attribute_id, url, samples]

    verifier_face_detection:
      type: object
      properties:
        verifications:
          type: array
          items:
            oneOf:
            - $ref: '#/components/schemas/verifier_face_verification'
            - $ref: '#/components/schemas/verifier_event_verification'
            - $ref: '#/components/schemas/verifier_face_external_id_verification'
            - $ref: '#/components/schemas/verifier_attribute_verification'

        face_attributes:
          $ref: '#/components/schemas/verifier_face_detection_face_attributes'

        sample:
          type: object
          nullable: true
          properties:
            face:
              allOf:
              - type: object
                properties:
                  rect:
                    allOf:
                    - $ref: '#/components/schemas/rect'
                    description: face detection bounding box. Absent in case of verifying against warp.
                  sample_id:
                    $ref: '#/components/schemas/sample_id'
                  url:
                    type: string
                    nullable: true
                    format: uri-reference
                    example: /0/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
                    description: location of the sample, null if sample was not stored
              - $ref: '#/components/schemas/face_detection_with_quality'
          required: [face]
      required: [verifications, face_attributes, sample]

    verifier_id_verification_response:
      type: object
      properties:
        images:
          description: Verification results for provided images/descriptors.
          type: array
          items:
            type: object
            description: processed image.
            properties:
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - example:
                      error_code: 0
                      detail: Success
                      desc: Success
              status:
                allOf:
                  - $ref: '#/components/schemas/image_status'
                  - example: 1
                    description: |
                      Status 1 means that the image was processed without errors. Status 0 means
                      that the image was processed with errors, information about error is contained in field `error`

              filename:
                $ref: '#/components/schemas/filename'
              exif:
                $ref: '#/components/schemas/exif'
              detections:
                type: object
                description: detections lists
                properties:
                  face_detections:
                    type: array
                    items:
                      $ref: '#/components/schemas/verifier_face_detection'
                  filtered_detections:
                    $ref: '#/components/schemas/verifier_filtered_detections'
                required: [face_detections, filtered_detections]
            required: [error, status, filename, detections]
      required: [images]

    track_id:
      description: event track id
      type: string
      pattern: '^[a-zA-Z0-9_\-]{1,36}$'
      example: "useful_track_id_number_1"

    track_ids:
      type: array
      items:
        $ref: '#/components/schemas/track_id'
      description: list of track ids. Each event from result will contain one of the given track ids.
      minItems: 1
      maxItems: 1000

    raw_event:
      type: object
      description: user generated events
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        detections:
          description: list of body & face related detections
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/input_event_detection_samples'
        source:
          $ref: '#/components/schemas/source'
        location:
          $ref: '#/components/schemas/input_location'
        external_id:
          $ref: '#/components/schemas/event_external_id'
        user_data:
          $ref: '#/components/schemas/event_user_data'
        track_id:
          $ref: '#/components/schemas/track_id'
        face:
          $ref: '#/components/schemas/input_event_face'
        matches:
          allOf:
            - maxItems: 30
            - $ref: '#/components/schemas/matches'
        face_attributes:
          $ref: '#/components/schemas/input_event_face_attribute'
        body_attributes:
          $ref: '#/components/schemas/input_event_body_attribute'
        aggregate_estimations:
          $ref: '#/components/schemas/EventAggregateEstimations'
        tags:
          allOf:
          - $ref: '#/components/schemas/tags'
          - maxItems: 100
        create_time:
          allOf:
            - $ref: "#/components/schemas/time"
            - description: time of the event creation.
        end_time:
          allOf:
            - $ref: "#/components/schemas/time"
            - description: the end time of the event.
      required: [account_id]
      example:
        account_id: 9cf8e1fb-0637-4689-a55b-f9ffe455bc9c
        create_time: 2018-08-11T09:11:41.674Z
        end_time: 2018-08-11T10:10:40.555Z
        face_attributes:
          attribute_id: b668c4a5-2191-476e-a261-3b4f9ce2e25e
          basic_attributes:
            age: 29
            gender: 1
            ethnicities:
              estimations:
                african_american: 1.92238889737406e-12
                asian: 0.954671621322632
                caucasian: 0.045328326523304
                indian: 7.65100649502415e-10
              predominant_ethnicity: asian
          descriptor: string
          score: 0.7525901794
          url: /6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
          samples:
            - a3e8716f-70dc-42ad-8428-7a552e800a37
        body_attributes:
          score: 0
          samples:
              - a3e8716f-70dc-42ad-8428-7a552e800a37
          descriptor: string
        source: 3rd Avenue
        tags:
          - tag1
          - tag2
        external_id: b668c4a5-2191-some-important-words
        user_data: string
        face:
          face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
          event_id: f9687459-986b-406d-9c1f-0d6289be5256
          user_data: fox1991
          external_id: 2xQ2gprbMUePw1s9gw9fvA==
          avatar: /6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
          lists:
            - 429b0e78-4616-426a-b57f-02baa72d638d
            - 6d037c33-31ec-4d73-b3b3-ec80b09446c2
          url: /6/faces/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
        matches:
          - label: good guys
            candidates:
              - face:
                  face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
                  external_id: 2xQ2gprbMUePw1s9gw9fvA==
                  user_data: fox1991
                  create_time: 2018-08-11T09:11:41.674Z
                  lists:
                    - 429b0e78-4616-426a-b57f-02baa72d638d
                    - 6d037c33-31ec-4d73-b3b3-ec80b09446c2
                  avatar: /6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
                  event_id: f9687459-986b-406d-9c1f-0d6289be5256
                similarity: 0.5
          - label: bad guys
            candidates:
              - event:
                  event_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7
                  external_id: 2xQ2gprbMUePw1s9gw9fvA==
                  user_data: fox1991
                  create_time: 2018-08-11T09:11:41.674Z
                  handler_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7
                  source: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7
                similarity: 0.3
        location:
          city: Moscow
          area: ZAO
          district: Arbat
          street: Arbat
          house_number: "10"
          geo_position:
            longitude: 36.616
            latitude: 55.752
        detections:
          - filename: penelope.jpeg
            samples:
              body:
                sample_id: b668c4a5-2191-476e-a261-3b4f9ce2e25e
                detection:
                  rect:
                    height: 240
                    width: 209
                    x: 170
                    y: 198
                url: /6/samples/bodies/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
              face:
                sample_id: b668c4a5-2191-476e-a261-3b4f9ce2e25e
                detection:
                  attributes:
                    mouth_attributes:
                      occluded: 0
                      opened: 0
                      score: 1
                      smile: 0
                    emotions:
                      estimations:
                        anger: 0.00894705578684807
                        disgust: 9.65219624049496e-06
                        fear: 0.00121302821207792
                        happiness: 0.00129503419157118
                        neutral: 0.986027479171753
                        sadness: 0.00187553185969591
                        surprise: 0.000632198702078313
                      predominant_emotion: neutral
                    mask:
                      estimations:
                        medical_mask: 0.7108324766
                        missing: 0.0700698048
                        occluded: 0.2190976739
                      predominant_mask: medical_mask
                    head_pose:
                      pitch: 18.6827487945557
                      roll: -10.3542232513428
                      yaw: 15.4102487564087
                    gaze:
                      pitch: 9.26744079589844
                      yaw: -19.4657287597656
                    liveness:
                      prediction: spoof
                      estimations:
                        quality: 0.347
                        score: 0.9345
                  quality:
                    light: 0.87
                    dark: 0.13
                    illumination: 0.1
                    specularity: 0.1
                    blurriness: 0.2
                  rect:
                    height: 240
                    width: 209
                    x: 170
                    y: 198
                url: /6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
            detect_time: 2018-08-11T09:11:41.674Z
            image_origin: /6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e
        track_id: useful_track_id_number_1
        aggregate_estimations:
          face:
            attributes:
              liveness:
                prediction: spoof
                estimations:
                  quality: 0.347
                  score: 0.9345

    saved_event:
      type: object
      properties:
        event_id:
          $ref: '#/components/schemas/event_id'
        url:
          type: string
          format: uri-reference
      required:
        - event_id
        - url
      example:
        event_id: b5d6fd45-fcca-453d-ac05-3e594054b813
        url: http://127.0.0.1:5040/2/events/b5d6fd45-fcca-453d-ac05-3e594054b813

    samples:
      type: array
      items:
        $ref: '#/components/schemas/uuid'
      maxItems: 8
      minItems: 1

    face_attribute_upgrade_policy:
      type: object
      description: Face attribute upgrade policy
      properties:
        fd_score_threshold:
          $ref: '#/components/schemas/score_threshold'
        extract_descriptor:
          $ref: '#/components/schemas/extract_descriptor'
        extract_basic_attributes:
          $ref: '#/components/schemas/extract_basic_attributes'
        descriptor_version:
          allOf:
          - $ref: '#/components/schemas/descriptor_version'
          default: 59
          description: |
              Face descriptor version. Default descriptor version from config is used if not specified.
              Used only if *extract_descriptor* equal *1*.

    body_attribute_upgrade_policy:
      type: object
      description: |
          Body attribute upgrade policy. It is possible only to upgrade descriptor, so
          body descriptor extraction is mandatory and will be done for each specified body sample
      properties:
        descriptor_version:
          allOf:
          - $ref: '#/components/schemas/body_descriptor_version'
          default: 104
          description: Body descriptor version. Default descriptor version from config is used if not specified.

    face_upgrade_data:
      type: object
      description: face samples and its upgrade rules
      properties:
        samples:
          allOf:
            - $ref: '#/components/schemas/samples'
            - description: face sample id list
        policy:
          $ref: '#/components/schemas/face_attribute_upgrade_policy'
      required: [samples]

    body_upgrade_data:
      type: object
      description: body samples and its upgrade rules
      properties:
        samples:
          allOf:
            - $ref: '#/components/schemas/samples'
            - description: body sample id list
        policy:
          $ref: '#/components/schemas/body_attribute_upgrade_policy'
      required: [samples]

    upgrade_face_attribute:
      type: object
      properties:
        face_id:
          $ref: '#/components/schemas/face_id'
        upgrade_data:
          $ref: '#/components/schemas/face_upgrade_data'
      required: [face_id, upgrade_data]

    upgrade_event_attribute:
      type: object
      properties:
        event_id:
          $ref: '#/components/schemas/event_id'
        face_upgrade_data:
          $ref: '#/components/schemas/face_upgrade_data'
        body_upgrade_data:
          $ref: '#/components/schemas/body_upgrade_data'
      required: [event_id]

    upgrade_attribute_schema:
      oneOf:
        - $ref: '#/components/schemas/upgrade_face_attribute'
        - $ref: '#/components/schemas/upgrade_event_attribute'

    health_ok:
      description: successful healthcheck execution info
      type: object
      properties:
        execution_time:
          type: number
          example: 0.123
          description: request execution time in seconds
      required: [execution_time]

    health_errors:
      type: object
      properties:
        errors:
          description: failed healthcheck execution info
          type: array
          items:
            type: object
            properties:
              component:
                description: component name
                type: string
              error:
                allOf:
                  - description: healthcheck error
                  - $ref: '#/components/schemas/Error'
              status:
                description: component health status
                type: integer
                enum: [0, 1]
            required: [component, error, status]
      required: [errors]
      example:
        errors:
          - component: handlers_db
            error:
              error_code: 10017
              desc: Database error
              detail: Database connection timeout error
            status: 0
          - component: faces
            error:
              error_code: 0
              desc: Success
              detail: Success
            status: 1
          - component: events
            error:
              error_code: 0
              desc: Success
              detail: Success
            status: 1

    face_check_name:
      type: string
      description: unique estimation name

    face_check_result:
      type: integer
      enum: [ 0, 1 ]
      description: check result (1 - succeeded, 0 - failed)

    face_object_value_score:
      type: number
      format: double
      minimum: 0
      maximum: 1
      nullable: true
      description: estimated value as a number
      example: 0.15675428

    face_object_value_number:
      type: number
      format: double
      nullable: true
      description: estimated value as a number
      example: 0.15675428

    face_object_value_int_positive:
      type: integer
      minimum: 0
      nullable: true
      description: estrimated value as an integer
      example: 1

    iso_object_value_string:
      type: string
      nullable: true
      description: estimated value as a string

    face_threshold_value_int_positive:
      type: object
      properties:
        min:
          type: integer
          minimum: 0
          nullable: true
          description: lower bound of the allowed range
          example: 0
        max:
          type: integer
          minimum: 0
          nullable: true
          description: upper bound of the allowed range
          example: 1
      required: [ min, max ]
      description: allowed range of the estimation value

    face_threshold_value_number:
      type: object
      properties:
        min:
          type: number
          nullable: true
          description: lower bound of the allowed range
          example: 0
        max:
          type: number
          nullable: true
          description: upper bound of the allowed range
          example: 1
      required: [ min, max ]
      description: allowed range of the estimation value

    face_check_element_number:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/face_check_name'
        object_value:
          $ref: '#/components/schemas/face_object_value_number'
        threshold_value:
          $ref: '#/components/schemas/face_threshold_value_number'
        result:
          $ref: '#/components/schemas/face_check_result'
      required: [ name, object_value, threshold_value, result ]

    face_check_element_int_positive:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/face_check_name'
        object_value:
          $ref: '#/components/schemas/face_object_value_int_positive'
        threshold_value:
          $ref: '#/components/schemas/face_threshold_value_int_positive'
        result:
          $ref: '#/components/schemas/face_check_result'
      required: [ name, object_value, threshold_value, result ]

    face_check_element_score:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/face_check_name'
        object_value:
          $ref: '#/components/schemas/face_object_value_score'
        threshold_value:
          $ref: '#/components/schemas/face_threshold_value_number'
        result:
          $ref: '#/components/schemas/face_check_result'
      required: [ name, object_value, threshold_value, result ]

    face_check_element_string:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/face_check_name'
        object_value:
          $ref: '#/components/schemas/iso_object_value_string'
        threshold_value:
          type: array
          items:
            type: string
          description: list of estimation values allowed
        result:
          $ref: '#/components/schemas/face_check_result'
      required: [ name, object_value, threshold_value, result ]

    check_result:
      type: integer
      enum: [ 0, 1 ]
      description: check result (1 - succeeded, 0 - failed)

    check_image_format:
      type: object
      properties:
        name:
          type: string
          enum: [ image_format ]
          description: unique estimation name
        object_value:
          type: string
          enum: [ JPEG, JPEG2000, PNG, BMP, TIFF, Portable pixmap ]
          nullable: true
          description: original image format
          example: JPEG
        threshold_value:
          $ref: '#/components/schemas/image_format_threshold'
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]
      description: checking the image format for compliance with the standard

    check_image_quality:
      allOf:
        - $ref: '#/components/schemas/face_check_element_score'
        - properties:
            name:
              enum: [ blurriness_quality, specularity_quality, illumination_quality, dark_quality, light_quality ]
        - description: checking the image quality

    check_glasses_state:
      allOf:
        - $ref: '#/components/schemas/face_check_element_string'
        - properties:
            name:
              enum: [ glasses ]
            object_value:
              type: string
              enum: [ no_glasses, eyeglasses, sunglasses ]
              example: eyeglasses
        - description: checking eyes state

    check_eyes_state:
      allOf:
        - $ref: '#/components/schemas/face_check_element_string'
        - properties:
            name:
              enum: [ left_eye, right_eye ]
            object_value:
              type: string
              enum: [ open, occluded, closed ]
              example: occluded
        - description: checking eyes state

    check_gaze_direction:
      allOf:
        - $ref: '#/components/schemas/face_check_element_number'
        - properties:
            name:
              enum: [ gaze_pitch, gaze_yaw ]
        - description: checking the gaze direction angles

    check_mouth_state:
      allOf:
        - $ref: '#/components/schemas/face_check_element_score'
        - properties:
            name:
              enum: [ mouth_open, mouth_smiling, mouth_occluded ]
        - description: checking the mouth state

    check_head_rotation:
      allOf:
        - $ref: '#/components/schemas/face_check_element_number'
        - properties:
            name:
              enum: [ head_pitch, head_roll, head_yaw ]
        - description: checking the head rotation angles

    check_head_position:
      allOf:
        - $ref: '#/components/schemas/face_check_element_number'
        - properties:
            name:
              enum: [ head_horizontal_center, head_vertical_center ]
        - description: checking the head position is normally centered in relation to the original image

    check_head_proportions:
      allOf:
        - $ref: '#/components/schemas/face_check_element_number'
        - properties:
            name:
              enum: [ head_width, head_height ]
        - description: checking the head width & height are normal in relation to the size of the image

    check_eye_distance:
      allOf:
        - $ref: '#/components/schemas/face_check_element_number'
        - properties:
            name:
              enum: [ eye_distance ]
        - description: checking the distance between the eyes is sufficient

    iso_estimation_item:
      oneOf:
        - $ref: '#/components/schemas/check_image_format'
        - $ref: '#/components/schemas/check_image_quality'
        - $ref: '#/components/schemas/check_glasses_state'
        - $ref: '#/components/schemas/check_eyes_state'
        - $ref: '#/components/schemas/check_gaze_direction'
        - $ref: '#/components/schemas/check_mouth_state'
        - $ref: '#/components/schemas/check_head_rotation'
        - $ref: '#/components/schemas/check_head_position'
        - $ref: '#/components/schemas/check_head_proportions'
        - $ref: '#/components/schemas/check_eye_distance'
        - $ref: '#/components/schemas/eyebrows_state_iso'
        - $ref: '#/components/schemas/headwear_type_iso'
        - $ref: '#/components/schemas/smile_properties_iso'
        - $ref: '#/components/schemas/natural_light_iso'
        - $ref: '#/components/schemas/radial_distortion_iso'
        - $ref: '#/components/schemas/red_eyes_iso'
        - $ref: '#/components/schemas/face_color_type_iso'

    check_image_properties:
      allOf:
        - $ref: '#/components/schemas/face_check_element_int_positive'
        - properties:
            name:
              enum: [ image_width, image_height, image_size ]
        - description: checking the image width & height (in pixels) and the image size (in bytes)

    check_aspect_ratio:
      allOf:
        - $ref: '#/components/schemas/face_check_element_number'
        - properties:
            name:
              enum: [ aspect_ratio ]
        - description: checking the image width to height aspect ratio

    check_face_properties:
      allOf:
        - $ref: '#/components/schemas/face_check_element_int_positive'
        - properties:
            name:
              enum: [ face_width, face_height, indent_left, indent_right, indent_upper, indent_lower ]
        - description: checking the face width, height and horizontal and vertical indents (in pixels)

    check_face_illumination_uniformity:
      allOf:
        - $ref: '#/components/schemas/face_check_element_score'
        - properties:
            name:
              enum: [ illumination_uniformity, dynamic_range ]
        - description: checking the face uniformity and dynamic illumination

    iso_checks_estimations:
      type: object
      description: iso face estimations checks
      properties:
        status:
          type: integer
          enum: [ 0, 1 ]
          description: check status for all estimates
        checks:
          type: array
          description: iso container with all estimates
          items:
            $ref: '#/components/schemas/iso_estimation_item'
          uniqueItems: true
      required: [ status, checks ]

    iso_face_detections:
      type: object
      description: iso face detections
      properties:
        iso:
          $ref: '#/components/schemas/iso_checks_estimations'
        rect:
          allOf:
            - $ref: '#/components/schemas/rect'
            - description: face detection bounding box.
      required: [ iso ]

    iso_face_estimations:
      description: iso face detection estimations
      type: object
      properties:
        detection:
          $ref: '#/components/schemas/iso_face_detections'
      required: [ detection ]

    iso_image_estimation:
      type: object
      properties:
        filename:
          $ref: '#/components/schemas/filename'
        status:
          allOf:
            - $ref: '#/components/schemas/image_status'
            - example: 1
          description: |
            Status 1 means that the image was processed without errors. Status 0 means
            that the image was processed with errors, information about error is contained in field `error`
        error:
          allOf:
            - $ref: '#/components/schemas/Error'
            - example:
                error_code: 0
                detail: Success
                desc: Success
          description: image error information
        exif:
          $ref: '#/components/schemas/exif'
        estimations:
          description: |
            List of related detections, i.e. face related samples that refer to the one person.

            Can be empty if an error occurred during image processing or the image does not contain faces.
          type: array
          items:
            type: object
            properties:
              face:
                $ref: '#/components/schemas/iso_face_estimations'
            required: [ face ]
      required: [ filename, status, error, estimations ]

    check_iso_response:
      type: object
      properties:
        images:
          description: Estimation results for provided images
          type: array
          items:
            $ref: '#/components/schemas/iso_image_estimation'
      required: [ images ]
  responses:
    internal_server_error:
      description: internal server error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    server_timeout_error:
      description: server timeout error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
            example:
              error_code: 9
              detail: Request timeout
              desc: Request timeout on http://127.0.0.1:5090/{...}, method {...}

    verifier_not_found:
      description: verifier not found
      headers:
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Content-Type:
          $ref: '#/components/headers/application_json'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 34004
            desc: Object not found
            detail: Verifier with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found

    handler_not_found:
      description: handler not found
      headers:
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Content-Type:
          $ref: '#/components/headers/application_json'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 11033
            desc: Object not found
            detail: Handler with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found

    image_not_found:
      description: Image not found
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            sample_not_found:
              value:
                error_code: 13003
                desc: Object not found
                detail: Image with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found

    one_detection_rect_per_image:
      description: Only one detection rect for each image available
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            one_rect_per_image:
              value:
                error_code: 11045
                desc: Forbidden
                detail: Only one detection rect for each image available at the moment
paths:
  /version:
    get:
      tags:
      - version

      summary: get version
      description: get version of service
      operationId: getVersion

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/version'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/detector:
    post:
      tags: [samples]
      summary: detect faces
      description: detect faces in input images.
      operationId: detectFaces
      parameters:
      - $ref: '#/components/parameters/account_id_required'
      - $ref: '#/components/parameters/luna_request_id'
      - in: header
        name: Content-Type

        schema:
          type: string
          enum:
          - image/jpeg
          - image/png
          - image/bmp
          - image/x-portable-pixmap
          - image/tiff
          - multipart/form-data
          - application/json
          - image/x-jpeg-base64
          - image/x-png-base64
          - image/x-bmp-base64
          - image/x-tiff-base64
          - image/x-portable-pixmap-base64
      - $ref: '#/components/parameters/detector_multiface_policy'
      - $ref: '#/components/parameters/estimate_head_pose'
      - $ref: '#/components/parameters/estimate_emotions'
      - $ref: '#/components/parameters/estimate_mask'
      - $ref: '#/components/parameters/detect_landmarks68'
      - $ref: '#/components/parameters/extract_exif'
      - $ref: '#/components/parameters/estimate_quality'
      - $ref: '#/components/parameters/estimate_gaze'
      - $ref: '#/components/parameters/estimate_eyes_attributes'
      - $ref: '#/components/parameters/estimate_mouth_attributes'
      - $ref: '#/components/parameters/pitch_threshold'
      - $ref: '#/components/parameters/roll_threshold'
      - $ref: '#/components/parameters/yaw_threshold'
      - $ref: '#/components/parameters/warped_image'
      - $ref: '#/components/parameters/use_exif_info'

      requestBody:
        content:
          image/jpeg:
            schema:
              type: string
              format: binary
          image/png:
            schema:
              type: string
              format: binary
          image/bmp:
            schema:
              type: string
              format: binary
          image/x-portable-pixmap:
            schema:
              type: string
              format: binary
          image/tiff:
            schema:
              type: string
              format: binary
          image/x-jpeg-base64:
            schema:
              type: string
              format: byte
          image/x-png-base64:
            schema:
              type: string
              format: byte
          image/x-bmp-base64:
            schema:
              type: string
              format: byte
          image/x-tiff-base64:
            schema:
              type: string
              format: byte
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: byte
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_image_schema'
            encoding:
              filename:
                contentType: |
                  image/jpeg, image/png, image/bmp, image/x-portable-pixmap, image/tiff, image/x-jpeg-base64,
                  image/x-png-base64, image/x-bmp-base64, image/x-tiff-base64, image/x-portable-pixmap-base64
          application/json:
            schema:
               $ref: '#/components/schemas/detect_json_request_body'

        required: true
      responses:
        201:
          description: Created
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/detected_images'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'estimate_eyes_attributes'
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_conten_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                bad_conten_type_multepart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
        404:
          $ref: '#/components/responses/image_not_found'
        403:
          $ref: '#/components/responses/one_detection_rect_per_image'
        500:
          $ref: '#/components/responses/internal_server_error'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /1/extractor:
    post:
      tags:
      - attributes
      summary: extract attributes
      description: extract attributes from samples.
      operationId: extractAttributes
      parameters:
      - $ref: '#/components/parameters/account_id_required'
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      - $ref: '#/components/parameters/score_threshold'
      - $ref: '#/components/parameters/extract_descriptor'
      - $ref: '#/components/parameters/extract_basic_attributes'
      - $ref: '#/components/parameters/aggregate_attributes'
      - $ref: '#/components/parameters/ttl'

      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/uuid'
              maxItems: 8
              minItems: 1
              description: sample id list
        required: true

      responses:
        201:
          description: created.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/extracted_attributes'
        400:
          description: bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'extract_basic_attributes'
                sample_not_found:
                  value:
                    error_code: 11031
                    desc: Bad/incomplete input data
                    detail: Sample 483037a5-8d67-427d-a498-f8f62bb06fb1 not found
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'samples',  message: 'ensure this value has at least 1 items'"
        404:
          $ref: '#/components/responses/image_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /1/extractor/upgrade:
    post:
      tags:
      - attributes
      summary: upgrade attribute
      description: Append a descriptor of non-default version and/or replace basic attributes from samples.
      operationId: upgradeAttributes
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'

      - $ref: '#/components/parameters/account_id'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/upgrade_attribute_schema'
        required: true

      responses:
        201:
          description: success.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/reextracted_attribute'
        400:
          description: bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'extract_basic_attributes'
                sample_not_found:
                  value:
                    error_code: 11031
                    desc: Bad/incomplete input data
                    detail: Sample 483037a5-8d67-427d-a498-f8f62bb06fb1 not found
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'samples.0',  message: 'value is not a valid uuid'"
        404:
          $ref: '#/components/responses/image_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /1/iso:
    post:
      tags: [iso]
      summary: iso resource
      description: |
        The resource performs a visual examination of frontal type images based on ISO/IEC 19794-5 standard.
        This means that the images that have passed the validation are standardized and attributes of the person's face meet the established requirements.
        For more information on the requirements for face attributes in the image, see [ISO/IEC 19794-5 Clauses 7-10](https://www.iso.org/obp/ui/#iso:std:iso-iec:19794:-5:en).

        The output JSON contains the result of the check for each estimator.
        The image check is considered successful if the set of these results complies with the ISO standard.

        The order of input images is corresponding to elements order in output JSON. If an image is broken, the resource will
        return an error for this image and other images will be correctly processed.

      operationId: checkISO
      parameters:
        - $ref: '#/components/parameters/application_json_or_msgpack_accept'
        - $ref: '#/components/parameters/luna_request_id'
        - in: header
          name: Content-Type
          schema:
            type: string
            enum:
            - application/json
            - multipart/form-data
            - image/jpeg
            - image/png
            - image/bmp
            - image/x-portable-pixmap
            - image/tiff
            - image/x-jpeg-base64
            - image/x-png-base64
            - image/x-bmp-base64
            - image/x-tiff-base64
            - image/x-portable-pixmap-base64
        - $ref: '#/components/parameters/iso_image_type'
        - $ref: '#/components/parameters/iso_multiface_policy'
        - $ref: '#/components/parameters/extract_exif'

      requestBody:
        content:
          image/jpeg:
            schema:
              type: string
              format: binary
          image/png:
            schema:
              type: string
              format: binary
          image/bmp:
            schema:
              type: string
              format: binary
          image/x-portable-pixmap:
            schema:
              type: string
              format: binary
          image/tiff:
            schema:
              type: string
              format: binary
          image/x-jpeg-base64:
            schema:
              type: string
              format: byte
          image/x-png-base64:
            schema:
              type: string
              format: byte
          image/x-bmp-base64:
            schema:
              type: string
              format: byte
          image/x-tiff-base64:
            schema:
              type: string
              format: byte
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: byte
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_image_schema'
            encoding:
              filename:
                contentType: |
                  image/jpeg, image/png, image/bmp, image/x-portable-pixmap, image/tiff, image/x-jpeg-base64,
                  image/x-png-base64, image/x-bmp-base64, image/x-tiff-base64, image/x-portable-pixmap-base64
          application/json:
            schema:
               $ref: '#/components/schemas/iso_json_request_body'
        required: true
      responses:
        200:
          description: Estimated
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/check_iso_response'
              example:
                {
                  "images": [
                    {
                      "filename": "raw image",
                      "status": 1,
                      "error": {
                        "error_code": 0,
                        "desc": "Success",
                        "detail": "Success"
                      },
                      "estimations": [
                        {
                          "face": {
                            "detection": {
                              "iso": {
                                "status": 1,
                                "checks": [
                                  {
                                    "name": image_format,
                                    "object_value": JPEG,
                                    "threshold_value": [ JPEG, JPEG2000, PNG ],
                                    "result": 1
                                  },
                                  {
                                    "name": illumination_quality,
                                    "object_value": 0.6005162000656128,
                                    "threshold_value": { "min": 0.3, "max": 1 },
                                    "result": 1
                                  },
                                  {
                                    "name": specularity_quality,
                                    "object_value": 0.7662366628646851,
                                    "threshold_value": { "min": 0.3, "max": 1 },
                                    "result": 1
                                  },
                                  {
                                    "name": blurriness_quality,
                                    "object_value": 0.9429352283477783,
                                    "threshold_value": { "min": 0.61, "max": 1 },
                                    "result": 1
                                  },
                                  {
                                    "name": dark_quality,
                                    "object_value": 0.9020983576774597,
                                    "threshold_value": { "min": 0.5, "max": 1 },
                                    "result": 1
                                  },
                                  {
                                    "name": light_quality,
                                    "object_value": 0.7881984114646912,
                                    "threshold_value": { "min": 0.57, "max": 1 },
                                    "result": 1
                                  },
                                  {
                                    "name": head_yaw,
                                    "object_value": 2.818983316421509,
                                    "threshold_value": { "min": -5.0, "max": 5.0 },
                                    "result": 1
                                  },
                                  {
                                    "name": head_pitch,
                                    "object_value": 3.816443920135498,
                                    "threshold_value": { "min": -5.0, "max": 5.0 },
                                    "result": 1
                                  },
                                  {
                                    "name": head_roll,
                                    "object_value": 5.434040069580078,
                                    "threshold_value": { "min": -8.0, "max": 8.0 },
                                    "result": 1
                                  },
                                  {
                                    "name": gaze_yaw,
                                    "object_value": -3.773012399673462,
                                    "threshold_value": { "min": -5.0, "max": 5.0 },
                                    "result": 1
                                  },
                                  {
                                    "name": gaze_pitch,
                                    "object_value": 0.7140519022941589,
                                    "threshold_value": { "min": -5.0, "max": 5.0 },
                                    "result": 1
                                  },
                                  {
                                    "name": mouth_smiling,
                                    "object_value": 0.000290759839117527,
                                    "threshold_value": { "min": 0, "max": 0.5 },
                                    "result": 1
                                  },
                                  {
                                    "name": mouth_occluded,
                                    "object_value": 9.619363845558837e-05,
                                    "threshold_value": { "min": 0, "max": 0.5 },
                                    "result": 1
                                  },
                                  {
                                    "name": mouth_open,
                                    "object_value": 0.6226108074188232,
                                    "threshold_value": { "min": 0, "max": 0.5 },
                                    "result": 1
                                  },
                                  {
                                    "name": glasses,
                                    "object_value": no_glasses,
                                    "threshold_value": [ no_glasses, eyeglasses ],
                                    "result": 1
                                  },
                                  {
                                    "name": left_eye,
                                    "object_value": open,
                                    "threshold_value": [ open ],
                                    "result": 1
                                  },
                                  {
                                    "name": right_eye,
                                    "object_value": open,
                                    "threshold_value": [ open ],
                                    "result": 1
                                  },
                                  {
                                    "name": head_horizontal_center,
                                    "object_value": 0.51,
                                    "threshold_value": { "min": 0.45, "max": 0.55 },
                                    "result": 1
                                  },
                                  {
                                    "name": head_vertical_center,
                                    "object_value": 0.51,
                                    "threshold_value": { "min": 0.3, "max": 0.5 },
                                    "result": 1
                                  },
                                  {
                                    "name": head_width,
                                    "object_value": 0.61,
                                    "threshold_value": { "min": 0.5, "max": 0.75 },
                                    "result": 1
                                  },
                                  {
                                    "name": head_height,
                                    "object_value": 0.71,
                                    "threshold_value": { "min": 0.6, "max": 0.9 },
                                    "result": 1
                                  },
                                  {
                                    "name":eye_distance,
                                    "object_value": 110,
                                    "threshold_value": { "min": 90, "max": null },
                                    "result": 1
                                  }
                                ]
                              },
                              "rect": {
                                "x": 108,
                                "y": 58,
                                "width": 113,
                                "height": 165
                              }
                            }
                          }
                        }
                      ]
                    }
                  ]
                }
            application/msgpack:
              schema:
                $ref: '#/components/schemas/check_iso_response'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'multiface_policy'
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_content_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                bad_content_type_multepart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                failed_load_image:
                  value:
                    error_code: 11027
                    desc: External request failed
                    detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
        403:
          description: Access to this resource on the server is denied
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                one_rect_available:
                  value:
                    error_code: 11045
                    desc: Forbidden
                    detail: Only one detection rect for each image available at the moment
                licence_expired:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                license_iso_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: ISO license feature is disabled."
        404:
          $ref: '#/components/responses/image_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/handlers:
    post:
      tags:
      - handlers
      summary: create handler
      description: |
        Create a new handler. The handler determinates a list of rules for
        processing of input images. You can set parameters for detecting faces and/or human bodies and
        extracting attributes. You can set rules for matching attributes and
        creating faces from them.
      operationId: createHandler
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/New_Handler'
        required: true

      responses:
        201:
          description: Created
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                type: object
                properties:
                  handler_id:
                    $ref: '#/components/schemas/uuid'
                  url:
                    type: string
                    format: uri-reference
                required:
                - handler_id
                - url
              example:
                handler_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /1/handlers/b5d6fd45-fcca-453d-ac05-3e594054b813
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id 'b5d6fd45-fcca-453d-ac05-3e594054b813' not found
                bad_json:
                  value:
                    error_code: 12027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'policies.match_policy',  message: 'ensure this value has at most 30 items'"
        500:
          $ref: '#/components/responses/internal_server_error'

    get:
      tags:
      - handlers
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/is_dynamic'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/page_size'
      - in: query
        name: description
        schema:
          type: string
        description: find all handlers with description similar to this parameter.

      summary: get handlers
      description: Get handlers by filters
      operationId: getHandlers
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HandlerInResponse'
        400:
          description: bad request
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'page'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/handlers/count:
    get:
      tags:
      - handlers
      summary: get handler count
      description: Get handler count
      operationId:  getHandlerCount
      parameters:
      - $ref: '#/components/parameters/account_id'
      - in: query
        name: description
        schema:
          type: string
        description: find all handlers with description similar to this parameter.
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/is_dynamic'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                type: object
                properties:
                  handlers_count:
                    $ref: '#/components/schemas/count'
                required:
                - handlers_count
        400:
          description: bad request
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'description'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/handlers/validator:
    post:
      tags:
        - handlers
      summary: validate handler policies
      description: Validate handler policies before using them to create or update a handler
      operationId: validatePolicies
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handlers_validator'
        required: true

      responses:
        204:
          description: Validated
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id 'b5d6fd45-fcca-453d-ac05-3e594054b813' not found
                bad_json:
                  value:
                    error_code: 12027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'policies.match_policy',  message: 'ensure this value has at most 30 items'"
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/handlers/{handler_id}:
    parameters:
    - in: path
      name: handler_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: handler id

    get:
      tags:
      - handlers
      summary: get handler
      description: Get handler by id
      operationId: getHandler
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      responses:
        200:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'

            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HandlerInResponse'
        404:
          $ref: '#/components/responses/handler_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
    put:
      tags:
      - handlers
      summary: Replace handler
      description: |
        Replace the handler. You can not update a part of handler.
      operationId: putHandler
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/New_Handler'
        required: true

      responses:
        204:
          description: Updated
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id 'b5d6fd45-fcca-453d-ac05-3e594054b813' not found
                bad_json:
                  value:
                    error_code: 12027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'policies.match_policy',  message: 'ensure this value has at most 30 items'"
        404:
          $ref: '#/components/responses/handler_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
    head:
      tags:
      - handlers
      summary: check to exist a handler
      description:  Check a handler with id=handler_id existence
      operationId: checkHandler
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      responses:
        200:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'

          description: OK
        404:
          description: handler not found
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
        500:
          $ref: '#/components/responses/internal_server_error'

    delete:
      tags:
      - handlers
      summary: remove handler
      description: Remove handler by id
      operationId: removeHandler
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'

          description: The resource was deleted successfully.
        404:
          $ref: '#/components/responses/handler_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/handlers/{handler_id}/events:
    parameters:
    - in: path
      name: handler_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: handler id
    post:
      tags: [events]
      summary: generate events
      description: |
        Generate events from images and/or raw descriptor data.
        If luna-events support is disabled on server, events will not be saved.
        Do not forget to send policies for a dynamic handler along with emitting events.

        Notes for incoming data:
          - set the image detection time, if necessary, otherwise it will be equal to the request time.
      operationId: generateEvents
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id_required'
      - $ref: '#/components/parameters/luna_event_time'
      - $ref: '#/components/parameters/luna_event_end_time'
      - $ref: '#/components/parameters/city'
      - $ref: '#/components/parameters/area'
      - $ref: '#/components/parameters/district'
      - $ref: '#/components/parameters/street'
      - $ref: '#/components/parameters/house_number'
      - $ref: '#/components/parameters/longitude'
      - $ref: '#/components/parameters/latitude'
      - $ref: '#/components/parameters/track_id'
      - $ref: '#/components/parameters/use_exif_info'
      - in: header
        name: Content-Type

        schema:
          type: string
          enum:
          - image/jpeg
          - image/png
          - image/bmp
          - image/x-portable-pixmap
          - image/tiff
          - multipart/form-data
          - application/json
          - image/x-jpeg-base64
          - image/x-png-base64
          - image/x-bmp-base64
          - image/x-tiff-base64
          - image/x-portable-pixmap-base64
          - application/x-sdk-descriptor
          - application/x-sdk-descriptor-base64
          - application/x-vl-xpk
          - application/x-vl-xpk-base64
      - in: query
        name: external_id
        schema:
          $ref: '#/components/schemas/event_external_id'
        description: external id for created faces
      - in: query
        name: user_data
        schema:
          description: user data for objects that will be generated
          allOf:
            - $ref: '#/components/schemas/event_user_data'

        description: User data for created faces
      - $ref: '#/components/parameters/image_type'

      - $ref: '#/components/parameters/aggregate_attributes'
      - $ref: '#/components/parameters/source'
      - $ref: '#/components/parameters/no_cache'
      - $ref: '#/components/parameters/tags'
      requestBody:
        content:
          image/jpeg:
            schema:
              type: string
              format: binary
          image/png:
            schema:
              type: string
              format: binary
          image/bmp:
            schema:
              type: string
              format: binary
          image/x-portable-pixmap:
            schema:
              type: string
              format: binary
          image/tiff:
            schema:
              type: string
              format: binary
          application/x-sdk-descriptor:
            schema:
              $ref: '#/components/schemas/sdk_descriptor'
          application/x-vl-xpk:
            schema:
              $ref: '#/components/schemas/xpk_file'
          image/x-jpeg-base64:
            schema:
              type: string
              format: byte
          image/x-png-base64:
            schema:
              type: string
              format: byte
          image/x-bmp-base64:
            schema:
              type: string
              format: byte
          image/x-tiff-base64:
            schema:
              type: string
              format: byte
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: binary
          application/x-sdk-descriptor-base64:
            schema:
              allOf:
              - type: string
                format: byte
              - $ref: '#/components/schemas/sdk_descriptor'
          application/x-vl-xpk-base64:
            schema:
              allOf:
              - type: string
                format: byte
              - $ref: '#/components/schemas/xpk_file'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_raw_data_schema_with_policies'
            encoding:
              filename:
                contentType: |
                  image/jpeg, image/png, image/bmp, image/x-portable-pixmap, image/tiff,
                  application/x-sdk-descriptor, application/x-vl-xpk,
                  image/x-jpeg-base64, image/x-png-base64, image/x-bmp-base64, image/x-tiff-base64,
                  image/x-portable-pixmap-base64, application/x-sdk-descriptor-base64, application/x-vl-xpk-base64
          application/json:
            schema:
              $ref: '#/components/schemas/emit_event_json_request_body'

        required: true
      responses:
        201:
          description: Created
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Cache-Handler-Version:
              $ref: '#/components/headers/cache_handler_version'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/emit_event_reply'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'estimate_eyes_attributes'
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_conten_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                bad_content_type_multepart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                bad_multipart_input:
                  value:
                    error_code: 11027
                    desc: Bad/incomplete input data
                    detail: 'Not available to send new policies to non-dynamic handler'
                bad_input_data:
                  value:
                    error_code: 11027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'policies.match_policy',  message: 'ensure this value has at most 30 items'"
                missing_image:
                  value:
                    error_code: 11049
                    desc: Bad/incomplete input data
                    detail: |
                      Required field 'image' not found in request
                unsupported_descriptor_version:
                  value:
                    error_code: 34001
                    desc: Forbidden
                    detail: Descriptor version 42 is not supported
                bad_sdk_descriptor:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: SDK descriptor is not valid
                bad_xpk:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: Failed to parse xpk file
                aggregation_not_supported:
                  value:
                    error_code: 34003
                    desc: Bad/incomplete input data
                    detail: Aggregation is not supported for raw descriptors

        403:
          description: Access to this resource on the server is denied
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                events_is_disabled:
                  value:
                    error_code: 11040
                    desc: Forbidden
                    detail: Luna Events service is disabled
                one_rect_available:
                  value:
                    error_code: 11045
                    desc: Forbidden
                    detail: Only one detection rect for each image available at the moment
                fsdk_liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness v.2 feature disabled"
                liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                licence_expired:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
        404:
          $ref: '#/components/responses/handler_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /1/handlers/{handler_id}/events/raw:
    parameters:
    - in: path
      name: handler_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: dynamic handler id
    post:
      tags: [events]
      summary: save event
      description: |
        save event which was generated by the user. The event structure is similar to an event from handler response. Input events
         will send to the Sender also and to plugins. Therefore these events are the same events except that the events were 
        generated an `external handler`. Handler ID must belong to a dynamic handler.
      operationId: saveEvent
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/no_cache'
        - $ref: '#/components/parameters/wait_raw_event_saving'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/raw_event'
        required: true
      responses:
        201:
          description: Created
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Cache-Handler-Version:
              $ref: '#/components/headers/cache_handler_version'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Location:
              schema:
                type: string
                format: uri-reference
                example: http://127.0.0.1:5020/2/events/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: location of new events
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/saved_event'
        202:
          description: Accepted
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Cache-Handler-Version:
              $ref: '#/components/headers/cache_handler_version'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Location:
              schema:
                type: string
                format: uri-reference
                example: http://127.0.0.1:5020/2/events/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: location of new events
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/saved_event'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_input_data:
                  value:
                    error_code: 11027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'source',  message: 'str type expected'"
        403:
          description: Access to this resource on the server is denied
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                not_dynamic_handler_error:
                  value:
                    error_code: 34007
                    desc: Forbidden
                    detail: Allowed to use only dynamic handler
                events_is_disabled:
                  value:
                    error_code: 11040
                    desc: Forbidden
                    detail: Luna Events service is disabled
        404:
          $ref: '#/components/responses/handler_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /1/sdk:
    post:
      tags: [sdk]
      summary: sdk resource
      description: |
        detect faces, human bodies and estimate attributes on input images. Resource estimates only available attributes
        for corresponding images. For example, if user sends warped face image and wants to calculate a body descriptor,
        landmarks5 and basic attributes - only basic attributes will be estimated.

        Order of input images is corresponding to order elements in output json. If an image is broken resource will
        returns error for it image, other images will be correct processing.

        > **WARNING**: this resource is unstable. A resource API can be changes in any release.
      operationId: sdk
      parameters:
        - $ref: '#/components/parameters/application_json_or_msgpack_accept'
        - $ref: '#/components/parameters/luna_request_id'
        - in: header
          name: Content-Type

          schema:
            type: string
            enum:
              - application/json
              - multipart/form-data
              - image/jpeg
              - image/png
              - image/bmp
              - image/x-portable-pixmap
              - image/tiff
              - image/x-jpeg-base64
              - image/x-png-base64
              - image/x-bmp-base64
              - image/x-tiff-base64
              - image/x-portable-pixmap-base64
        - $ref: '#/components/parameters/image_type'
        - $ref: '#/components/parameters/multiface_policy'
        - $ref: '#/components/parameters/detect_face'
        - $ref: '#/components/parameters/detect_body'
        - $ref: '#/components/parameters/estimate_head_pose'
        - $ref: '#/components/parameters/estimate_emotions'
        - $ref: '#/components/parameters/estimate_landmarks68'
        - $ref: '#/components/parameters/estimate_landmarks5'
        - $ref: '#/components/parameters/estimate_quality'
        - $ref: '#/components/parameters/estimate_gaze'
        - $ref: '#/components/parameters/estimate_eyes_attributes'
        - $ref: '#/components/parameters/estimate_mouth_attributes'
        - $ref: '#/components/parameters/estimate_mask'
        - $ref: '#/components/parameters/estimate_glasses'
        - $ref: '#/components/parameters/estimate_liveness'
        - $ref: '#/components/parameters/estimate_face_descriptor'
        - $ref: '#/components/parameters/estimate_basic_attributes'
        - $ref: '#/components/parameters/estimate_body_descriptor'
        - $ref: '#/components/parameters/estimate_body_warp'
        - $ref: '#/components/parameters/estimate_face_warp'
        - $ref: '#/components/parameters/aggregate_attributes'
        - $ref: '#/components/parameters/pitch_threshold'
        - $ref: '#/components/parameters/roll_threshold'
        - $ref: '#/components/parameters/yaw_threshold'
        - $ref: '#/components/parameters/score_threshold'
        - $ref: '#/components/parameters/mask_states'
        - $ref: '#/components/parameters/liveness_states'
        - $ref: '#/components/parameters/use_exif_info'

      requestBody:
        content:
          image/jpeg:
            schema:
              type: string
              format: binary
          image/png:
            schema:
              type: string
              format: binary
          image/bmp:
            schema:
              type: string
              format: binary
          image/x-portable-pixmap:
            schema:
              type: string
              format: binary
          image/tiff:
            schema:
              type: string
              format: binary
          image/x-jpeg-base64:
            schema:
              type: string
              format: byte
          image/x-png-base64:
            schema:
              type: string
              format: byte
          image/x-bmp-base64:
            schema:
              type: string
              format: byte
          image/x-tiff-base64:
            schema:
              type: string
              format: byte
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: byte
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_sdk_image_schema'
            encoding:
              filename:
                contentType: |
                  image/jpeg, image/png, image/bmp, image/x-portable-pixmap, image/tiff, image/x-jpeg-base64,
                  image/x-png-base64, image/x-bmp-base64, image/x-tiff-base64, image/x-portable-pixmap-base64
          application/json:
            schema:
              $ref: '#/components/schemas/sdk_json_request_body'
        required: true
      responses:
        200:
          description: Estimated
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sdk_response_json'
              examples:
                all:
                  value:
                    images_estimations:
                      - filename: raw image
                        estimations:
                          - face:
                              detection:
                                rect:
                                  x: 71
                                  'y': 45
                                  width: 134
                                  height: 178
                                landmarks5: [ [ 25, 25 ], [ 83, 83 ], [ 47, 47 ], [ 33, 33 ], [ 82, 82 ] ]
                                landmarks68: [ [ 1, 1 ], [ 1, 1 ], [ 4, 4 ], [ 8, 8 ], [ 14, 14 ], [ 23, 23 ], [ 33, 33 ], [ 43, 43 ], [ 60, 60 ], [ 78, 78 ], [ 96, 96 ], [ 112, 112 ], [ 124, 124 ], [ 132, 132 ], [ 135, 135 ], [ 137, 137 ], [ 138, 138 ], [ 1, 1 ], [ 8, 8 ], [ 17, 17 ], [ 26, 26 ], [ 35, 35 ], [ 59, 59 ], [ 73, 73 ], [ 86, 86 ], [ 100, 100 ], [ 113, 113 ], [ 47, 47 ], [ 45, 45 ], [ 44, 44 ], [ 43, 43 ], [ 37, 37 ], [ 42, 42 ], [ 47, 47 ], [ 54, 54 ], [ 61, 61 ], [ 14, 14 ], [ 20, 20 ], [ 29, 29 ], [ 36, 36 ], [ 28, 28 ], [ 19, 19 ], [ 69, 69 ], [ 77, 77 ], [ 86, 86 ], [ 95, 95 ], [ 88, 88 ], [ 78, 78 ], [ 33, 33 ], [ 38, 38 ], [ 45, 45 ], [ 50, 50 ], [ 57, 57 ], [ 69, 69 ], [ 82, 82 ], [ 72, 72 ], [ 60, 60 ], [ 52, 52 ], [ 45, 45 ], [ 38, 38 ], [ 36, 36 ], [ 46, 46 ], [ 51, 51 ], [ 58, 58 ], [ 77, 77 ], [ 58, 58 ], [ 51, 51 ], [ 45, 45 ] ]
                                attributes:
                                  eyes_attributes:
                                    left_eye:
                                      iris_landmarks: [ [ 92, 92 ], [ 92, 92 ], [ 93, 93 ], [ 93, 93 ], [ 94, 94 ], [ 95, 95 ], [ 96, 96 ], [ 98, 98 ], [ 99, 99 ], [ 100, 100 ], [ 101, 101 ], [ 102, 102 ], [ 103, 103 ], [ 104, 104 ], [ 105, 105 ], [ 105, 105 ], [ 105, 105 ], [ 105, 105 ], [ 105, 105 ], [ 104, 104 ], [ 103, 103 ], [ 102, 102 ], [ 101, 101 ], [ 100, 100 ], [ 99, 99 ], [ 98, 98 ], [ 97, 97 ], [ 96, 96 ], [ 95, 95 ], [ 94, 94 ], [ 93, 93 ], [ 93, 93 ] ]
                                      state: open
                                    right_eye:
                                      iris_landmarks: [ [ 152, 152 ], [ 153, 153 ], [ 153, 153 ], [ 154, 154 ], [ 154, 154 ], [ 155, 155 ], [ 157, 157 ], [ 158, 158 ], [ 159, 159 ], [ 161, 161 ], [ 162, 162 ], [ 163, 163 ], [ 164, 164 ], [ 165, 165 ], [ 166, 166 ], [ 166, 166 ], [ 166, 166 ], [ 166, 166 ], [ 166, 166 ], [ 165, 165 ], [ 164, 164 ], [ 163, 163 ], [ 162, 162 ], [ 161, 161 ], [ 159, 159 ], [ 158, 158 ], [ 158, 158 ], [ 157, 157 ], [ 156, 156 ], [ 154, 154 ], [ 154, 154 ], [ 153, 153 ] ]
                                      state: open
                                  head_pose:
                                    pitch: 12.7464532852
                                    roll: -2.9892115593
                                    yaw: 17.7173442841
                                  gaze:
                                    yaw: -5.9912848473
                                    pitch: -10.2646684647
                                  emotions:
                                    predominant_emotion: neutral
                                    estimations:
                                      anger: 8.682e-7
                                      disgust: 1.0670000000000001e-7
                                      fear: 4.386e-7
                                      happiness: 0.45658952
                                      sadness: 4.951e-7
                                      surprise: 0.0000029291
                                      neutral: 0.543405652
                                  mask:
                                    estimations:
                                      medical_mask: 0.7108324766
                                      missing: 0.0700698048
                                      occluded: 0.2190976739
                                    predominant_mask: "medical_mask"
                                  liveness:
                                    estimations:
                                      quality: 0.9984464645385742
                                      score: 0.9872102737426758
                                    prediction: "real"
                                  glasses:
                                    glasses: "no_glasses"
                                  mouth_attributes:
                                    score: 1.0
                                    opened: 0.3884400725
                                    occluded: 1.4000000000000001e-9
                                    smile: 0.6115599275
                                  basic_attributes:
                                    ethnicities:
                                      predominant_ethnicity: caucasian
                                      estimations:
                                        asian: 0.0000025556
                                        indian: 6.417e-7
                                        caucasian: 0.9999949932000001
                                        african_american: 0.0000017718000000000001
                                    age: 24
                                    gender: 0
                                  descriptor:
                                    sdk_descriptor: ZHAAADgAAAB0k4SAf...IB6gHyAgH19fQ==
                                    score: 0.7854047418000001
                                quality:
                                  blurriness: 0.9769582748000001
                                  dark: 0.9542820454000001
                                  illumination: 0.8248310089
                                  specularity: 0.8472354412
                                  light: 0.8179533482
                                warp: /9j/4AAQSkZJRgABAQAAAQABA..C4gb+KneZD/erEHWn0/asOTzP/9k=
                          - body:
                              detection:
                                rect:
                                  x: 32
                                  'y': 4
                                  width: 224
                                  height: 255
                                warp: /9j/4AAQSkZJRgABAQAAAQABAA...CX6kdapTi1qS00f/Z
                                attributes:
                                  descriptor:
                                    sdk_descriptor: ZHAAAGUAAAC....AfX9
                                    score: 1

                with_error:
                  value:
                    images_estimations:
                      - error:
                          error_code: 100033
                          desc: Unsupported image type
                          detail: Unsupported type
                        filename: bad_image.jpg
                      - filename: Claudia_Schiffer_warp.jpg
                        estimations:
                          - face:
                              detection:
                                rect:
                                  x: 71
                                  'y': 45
                                  width: 134
                                  height: 178
                with_aggregation:
                  value:
                    images_estimations:
                      - filename: image1.jpg
                        estimations:
                          - body:
                              detection:
                                rect:
                                  x: 118
                                  'y': -17
                                  width: 410
                                  height: 627
                      - filename: image2.jpg
                        estimations:
                          - body:
                              detection:
                                rect:
                                  x: 7
                                  'y': -60
                                  width: 1682
                                  height: 2523
                    aggregate_estimations:
                      body:
                        attributes:
                          descriptor:
                            sdk_descriptor: ZHAAAGUAAACBeX1w==
                            score: 0
            application/msgpack:
              schema:
                $ref: '#/components/schemas/sdk_response_msgpack'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'estimate_eyes_attributes'
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_content_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                bad_content_type_multepart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                failed_load_image:
                  value:
                    error_code: 11027
                    desc: External request failed
                    detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
        403:
          description: Access to this resource on the server is denied
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                one_rect_available:
                  value:
                    error_code: 11045
                    desc: Forbidden
                    detail: Only one detection rect for each image available at the moment
                fsdk_liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness v.2 feature disabled"
                liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                licence_expired:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
        404:
          $ref: '#/components/responses/image_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/verifiers:
    post:
      tags:
      - verifiers
      summary: create verifier
      description: |
        Create a new verifier. The verifier determinates a list of rules for
        processssing & verification of input images. You can set parameters for detecting faces and
        extracting attributes.
      operationId: createVerifier
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/new_verifier'
        required: true

      responses:
        201:
          description: Created
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                type: object
                properties:
                  verifier_id:
                    $ref: '#/components/schemas/uuid'
                  url:
                    type: string
                    format: uri-reference
                required:
                - verifier_id
                - url
              example:
                verifier_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /1/verifiers/b5d6fd45-fcca-453d-ac05-3e594054b813
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_json:
                  value:
                    error_code: 12027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'policies.match_policy.0.label',  message: 'ensure this value has at most 36 characters'"
        500:
          $ref: '#/components/responses/internal_server_error'


    get:
      tags:
        - verifiers
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/verifier_description'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'

      summary: get verifiers
      description: Get verifiers by filters
      operationId: getVerifiers
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/verifier_response'
        400:
          description: bad request
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'page'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/verifiers/count:
    get:
      tags:
      - verifiers
      summary: count verifiers
      description: Count verifiers that satisfy the filters
      operationId:  countVerifiers
      parameters:
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/verifier_description'
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                type: object
                properties:
                  verifiers_count:
                    $ref: '#/components/schemas/count'
                required:
                - verifiers_count
        400:
          description: bad request
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/verifiers/{verifier_id}:
    parameters:
    - in: path
      name: verifier_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: verifier id

    get:
      tags:
      - verifiers
      summary: get verifier
      description: Get verifier by id.
      operationId: getVerifier
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      responses:
        200:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verifier_response'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
        404:
          $ref: '#/components/responses/verifier_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'

    put:
      tags:
      - verifiers
      summary: replace verifier
      description: |
        Replace the verifier. You can not update a part of verifier.
      operationId: putVerifier
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/new_verifier'
        required: true
      responses:
        200:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    description: verifier current version (increases on update)
                    type: integer
                    minimum: 1
                    example: 111
                required:
                  - version
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_json:
                  value:
                    error_code: 12027
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Message: ''{''policies'': {''verification_threshold'': [''Not a valid float.'']}}'''
        404:
          $ref: '#/components/responses/verifier_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'

    head:
      tags:
      - verifiers
      summary: check verifier
      description:  Check the verifier existense.
      operationId: checkVerifier
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      responses:
        200:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          description: OK
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        404:
          description: verifier not found
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
        500:
          $ref: '#/components/responses/internal_server_error'

    delete:
      tags:
      - verifiers
      summary: remove verifier
      description: Remove verifier by id.
      operationId: removeVerifier
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id'
      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          description: Deleted.
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
        404:
          $ref: '#/components/responses/verifier_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/verifiers/{verifier_id}/raw:
    parameters:
    - in: path
      name: verifier_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: verifier id

    post:
      tags:
      - verifiers
      summary: raw verification
      description: |
        Raw API allows to do similarity and verification status calculations for input descriptors.
      operationId: rawVerification
      parameters:
      - $ref: '#/components/parameters/json_or_msgpack_content'
      - $ref: '#/components/parameters/luna_request_id'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/raw_verification_request_json'
          application/msgpack:
            schema:
              $ref: '#/components/schemas/raw_verification_request_msgpack'
        required: true
      responses:
        200:
          description: Ok
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/raw_verification_response'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'policies.match_policy.0.label',  message: 'ensure this value has at most 36 characters'"
                bad_base64_for_one_descriptor:
                  value:
                    error_code: 18001
                    desc: Bad/incomplete input data
                    detail: Failed convert data from base64 to bytes
                wrong_descriptors_length:
                  value:
                    error_code: 12034
                    desc: Bad/incomplete input data
                    detail: Descriptor has incorrect length 200
                bad_xpk_file:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: Failed to parse xpk file
                bad_sdk_descripot:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: SDK descriptor is not valid
                xpk_does_not_contain_descriptor:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: XPK file does not contain descriptor
                unknown_descriptor_version:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: Descriptor version 37 are not registered in the system
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
        404:
          $ref: '#/components/responses/verifier_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /1/verifiers/{verifier_id}/verifications:
    parameters:
    - in: path
      name: verifier_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: verifier id

    post:
      tags:
      - verifiers
      summary: perform verification
      description: Verify given images and/or descriptors against specified objects set.
      operationId: postVerifier
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/account_id_required'
      - $ref: '#/components/parameters/face_ids'
      - $ref: '#/components/parameters/event_ids'
      - $ref: '#/components/parameters/attribute_ids'
      - $ref: '#/components/parameters/external_ids'
      - $ref: '#/components/parameters/use_exif_info'
      - $ref: '#/components/parameters/image_type'
      - in: header
        name: Content-Type

        schema:
          type: string
          enum:
          - image/jpeg
          - image/png
          - image/bmp
          - image/x-portable-pixmap
          - image/tiff
          - multipart/form-data
          - application/json
          - image/x-jpeg-base64
          - image/x-png-base64
          - image/x-bmp-base64
          - image/x-tiff-base64
          - image/x-portable-pixmap-base64
          - application/x-sdk-descriptor
          - application/x-sdk-descriptor-base64
          - application/x-vl-xpk
          - application/x-vl-xpk-base64
      requestBody:
        content:
          image/jpeg:
            schema:
              type: string
              format: binary
          image/png:
            schema:
              type: string
              format: binary
          image/bmp:
            schema:
              type: string
              format: binary
          image/x-portable-pixmap:
            schema:
              type: string
              format: binary
          image/tiff:
            schema:
              type: string
              format: binary
          application/x-sdk-descriptor:
            schema:
              $ref: '#/components/schemas/sdk_descriptor'
          application/x-vl-xpk:
            schema:
              $ref: '#/components/schemas/xpk_file'
          image/x-jpeg-base64:
            schema:
              type: string
              format: byte
          image/x-png-base64:
            schema:
              type: string
              format: byte
          image/x-bmp-base64:
            schema:
              type: string
              format: byte
          image/x-tiff-base64:
            schema:
              type: string
              format: byte
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: binary
          application/x-sdk-descriptor-base64:
            schema:
              allOf:
              - type: string
                format: byte
              - $ref: '#/components/schemas/sdk_descriptor'
          application/x-vl-xpk-base64:
            schema:
              allOf:
              - type: string
                format: byte
              - $ref: '#/components/schemas/xpk_file'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_verifier_payload'
            encoding:
              filename:
                contentType: |
                  image/jpeg, image/png, image/bmp, image/x-portable-pixmap, image/tiff,
                  application/x-sdk-descriptor, application/x-vl-xpk,
                  image/x-jpeg-base64, image/x-png-base64, image/x-bmp-base64, image/x-tiff-base64,
                  image/x-portable-pixmap-base64, application/x-sdk-descriptor-base64, application/x-vl-xpk-base64
          application/json:
            schema:
              $ref: '#/components/schemas/verify_json_request_body'
      responses:
        200:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verifier_id_verification_response'
        400:
          description: Bad request
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
        403:
          description: Access to this resource on the server is denied
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                events_is_disabled:
                  value:
                    error_code: 11040
                    desc: Forbidden
                    detail: Luna Events service is disabled
                fsdk_liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness v.2 feature disabled"
                liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                licence_expired:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
        404:
          $ref: '#/components/responses/verifier_not_found'
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/docs/spec:
    get:
      tags:
        - documents
      summary: get openapi documentation
      description: |
        Get service OpenApi documentation. If *Accept* request header is of type `application/x-yaml`,
        returns documentation in `yaml` format or returns `html` documentation, if *Accept-Type* is `text/html`
      operationId: getSpec

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/accept_docs_handler'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/docs_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/x-yaml:
              schema:
                type: string
                description: yaml format documentation
            text/html:
              schema:
                type: string
                description: html format documentation
        415:
          description: Unsupported Media Type
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unsupported_media_type:
                  value:
                    error_code: 12024
                    detail: 'Bad/incomplete input data'
                    desc: "Unsupported media type"
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/docs/dev:
    get:
      tags:
        - documents
      summary: get development manual
      description: |
        Get sphinx documentation - *Development Manual*. After the request you will be redirected to the page `/docs/dev/index.html`
      operationId: getDevManual

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/text_html'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            text/html:
              schema:
                type: string
                description: html format documentation
        500:
          $ref: '#/components/responses/internal_server_error'
  /1/config:
    get:
      tags:
        - config
      summary: get service configuration
      description: Get service configuration. Passwords and tokens will be hidden in the response.
      operationId: getConfig

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/accept_config_handler'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/config_accept_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                type: object
                description: json format configuration
              example:
                INFLUX_MONITORING:
                  SEND_DATA_FOR_MONITORING: 0
                  VERSION: 2
                  ORGANIZATION: ORGANIZATION_NAME
                  TOKEN: '********'
                  BUCKET: luna_monitoring
                  HOST: 127.0.0.1
                  PORT: 8086
                  USE_SSL: 0
                  FLUSHING_PERIOD: 1.0
            text/plain:
              schema:
                type: string
                description: text format configuration
              example: |
                [INFLUX_MONITORING]
                SEND_DATA_FOR_MONITORING = 0
                VERSION = 2
                ORGANIZATION = ORGANIZATION_NAME
                TOKEN = ********
                BUCKET = luna_monitoring
                HOST = 127.0.0.1
                PORT = 8086
                USE_SSL = 0
                FLUSHING_PERIOD = 1.0
        415:
          description: Unsupported Media Type
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unsupported_media_type:
                  value:
                    error_code: 12024
                    detail: 'Bad/incomplete input data'
                    desc: "Unsupported media type"
        500:
          $ref: '#/components/responses/internal_server_error'
  /healthcheck:
    get:
      tags:
        - health
      summary: get health
      description: get health of service
      operationId: healthcheck
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/include_luna_services'
      responses:
        200:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/health_ok'
        500:
          $ref: '#/components/responses/internal_server_error'
        502:
          description: Unhealthy
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/health_errors'
        504:
          $ref: '#/components/responses/server_timeout_error'