OpenApi

You can find spec for the API service spec in the html document.

openapi: 3.0.0
info:
  version: 'v.6.27.2'
  title: 'LUNA PLATFORM 5 API'
  description: |
          VisionLabs Luna Platform 5 API. The API version is 6.

          OpenAPI specification is the only valid document providing up-to-date information about the service API.

          The specification can be used:

          - By documentation generation tools to visualize the API.
          - By code generation tools.

          All the documents and code generated using this specification can include inaccuracies and should be carefully checked.

          OpenAPI specification can be received using the [/docs/spec](#operation/getSpec) resource. The "Accept" header should be set to "application/x-yaml".

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


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

    image_content_type:
      schema:
        type: string
        enum:
        - image/jpeg
        - image/png
      description: Content type is `image/jpeg` or `image/png`.
      required: true

    luna_request_id:
      schema:
        type: string
        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: Request ID. Helps to uniquely identify messages in system logs that correspond to particular requests. Format is "{timestamp},{uuid}".
      required: true

    content_disposition:
      schema:
        type: string
      example: 'attachment; filename=task_146.zip'
      required: true
      description: Content disposition with filename.

    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`.

    allow_methods:
      schema:
        type: string
      example: 'PUT, DELETE, GET, OPTIONS'
      required: true
      description: Allow methods header.

    access_control_allow_origin:
      schema:
        type: string
        enum: ['*']
      example: '*'
      description: Access-Control-Allow-Origin header. Is supported by CORS requests to the server.

    access_control_allow_headers:
      schema:
        type: string
        enum: ['*']
      example: '*'
      description: Access-Control-Allow-Headers. Is supported by CORS requests to the server.

    access_control_allow_methods:
      schema:
        type: string
        enum: ['*']
      example: '*'
      description: Access-Control-Allow-Methods. Is supported by CORS requests to the server.

    access_control_max_age:
      schema:
        type: string
        enum: ['86400']
      example: '86400'
      description: Access-Control-Max-Age-Header. Is supported by CORS requests to the server.

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

    config_accept_content_type:
      schema:
        type: string
        enum:
          - application/json
          - text/plain
      required: false
      description: The content type of the response body.

    authenticate:
      schema:
        type: string
        enum:
        - Basic realm='login:password'
        - Bearer
      required: true
      description: Authorization format.

    meta_headers:
      schema:
        type: string
        example: <user_defined_value>
      description: User-defined image metadata key-value that specified when the image were stored.

    transfer_encoding:
      schema:
        type: string
      example: 'chunked'
      required: true
      description: Transfer encoding type.

    object_content_disposition:
      schema:
        type: string
        description: |
          Attachment content-disposition header. Filename is generated based on object id and object mime type 
          and equal to `{object_id}.{extention}`. If mime type are not determined the file extension will 
          be set as `.bin`.
        example: attachment; filename='28b87262-43e2-4afc-ad1b-8308e2798b80.pdf'
      required: true

    object_content_type:
      schema:
        type: string
        description: |
          Content type is determined as content type which user sent up into the saving request of  the object.
        example: appliction/pdf
      required: true

    octet_stream_content_type:
      schema:
        type: string
        enum:
        - application/octet-stream
      required: true
      description: Content type is `application/octet-stream`.

    set_cookie:
      schema:
        type: string
        enum: ['*']
      example: '*'
      description: Set cookie header for setting or deleting cookies.

    set_cookie_required:
      schema:
        type: string
        enum: ['*']
      example: '*'
      required: true
      description: Set cookie header for setting or deleting cookies.
  parameters:
    page:
      in: query
      name: page
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number.

    luna_request_id:
      in: header
      schema:
        type: string
        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 in system logs that correspond to particular requests.
        If it was not set, the system will set it to the default format ("timestamp, UUID"). It will be returned with the response.
      name: Luna-Request-Id

    luna_account_id:
      in: header
      deprecated: true
      schema:
        type: string
        format: uuid
        example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a
        pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
      description: |
        Account ID.

        An account is a limitation for all the user actions (matching, removing, updating and other)
        on data which does not have corresponding account ID. For example: it is impossible to attach a face with one
        account ID to a list with another account ID.

        User can make a limited set of requests without this header
        (requests with methods *GET, HEAD, OPTIONS*, match requests and getting events statistics requests).
      name: Luna-Account-Id

    luna_account_id_new_account:
      in: header
      schema:
        type: string
        format: uuid
        example: 8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a
        pattern: ^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
      description: |
        Account ID for new account creation.
      name: Luna-Account-Id

    query_account_id:
      in: query
      name: account_id
      schema:
        $ref: '#/components/schemas/account_id'
      description: Account ID filter. Will not have effect if Luna-Account-Id header is used for authorization
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    page_size:
      in: query
      name: page_size
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 10
      description: Number of items on page.

    is_dynamic:
      in: query
      deprecated: true
      name: is_dynamic
      schema:
        type: integer
        enum: [0, 1]
      description: |
        Whether to get only dynamic (1) or non-dynamic (0) handlers. 
        If not specified handlers of both type will received.

    handler_type:
      in: query
      name: handler_type
      schema:
        type: integer
        enum: [0, 1, 2]
      description: |
        Whether to get only handler with specific type (0 - static, 1 - dynamic, 2 - lambda). 

        If not specified handlers of any type will be received.

        If `handler_type` specified, the deprecated `is_dynamic` parameter will be ignored.

    order:
      in: query
      name: order
      schema:
        type: string
        enum: ["asc", "desc"]
      description: Sort order. If "desc" is set, the newest events will be shown first. If "asc" is set, the oldest events will be shown first.

    gender:
      in: query
      name: gender
      schema:
        type: integer
        enum: [0, 1]
      description: Gender. 1 - male, 0 - female.
      example: 1

    gender_nullable:
      in: query
      name: gender
      schema:
        oneOf:
          - type: integer
            enum: [0, 1]
          - $ref: '#/components/schemas/null_filter'
      description: Gender. 1 - male, 0 - female, "null" - null value.
      example: 1

    emotions:
      in: query
      name: emotions
      schema:
        type: string
        format: list of integer (1, 2, 3, 4, 5, 6, 7)
      description: |
        Comma-separated list of predominant emotions. Each event from result will contain one of the given emotions.

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

    emotions_nullable:
      in: query
      name: emotions
      schema:
        type: string
        format: list of integer and null (1, 2, 3, 4, 5, 6, 7, null)
      description: |
        Comma-separated list of predominant emotions or null. Each event from result will contain one of the given emotions.

        | emotions    | value |
        |-----------------|---|
        | anger           | 1 |
        | disgust         | 2 |
        | fear            | 3 |
        | happiness       | 4 |
        | neutral         | 5 |
        | sadness         | 6 |
        | surprise        | 7 |
        | not set      | null |
      example: "1,2,3,null"


    masks:
      in: query
      name: masks
      schema:
        type: string
        format: list of integer(1, 2, 3)
      description: |
        Comma-separated list of predominant masks. Each event from result will contain one of the given mask state.

        | mask        | value |
        |-----------------|---|
        | missing         | 1 |
        | medical_mask    | 2 |
        | occluded        | 3 |
      example: "1,2,3"

    masks_nullable:
      in: query
      name: masks
      schema:
        type: string
        format: list of integer and null (1, 2, 3, null)
      description: |
        Comma-separated list of predominant masks or null. Each event from result will contain one of the given mask state.

        | mask        | value |
        |-----------------|---|
        | missing         | 1 |
        | medical_mask    | 2 |
        | occluded        | 3 |
        | not set      | null |
      example: "1,2,3,null"


    ethnic_groups:
      in: query
      name: ethnic_groups
      schema:
        type: string
        format: list of integer (1, 2, 3, 4)
      description: |
        Comma-separated list of dominant ethnic group. Each event from result will contain one of the given ethnic groups.

        | ethnicity    | value |
        |------------------|---|
        | African american | 1 |
        | Indian           | 2 |
        | Asian            | 3 |
        | Caucasian        | 4 |

      example: "1,2"

    ethnic_groups_nullable:
      in: query
      name: ethnic_groups
      schema:
        type: string
        format: list of integer and null (1, 2, 3, 4, null)
      description: |
        Comma-separated list of dominant ethnic group or null. Each event from result will contain one of the given ethnic groups.

        | ethnicity    | value |
        |------------------|---|
        | African american | 1 |
        | Indian           | 2 |
        | Asian            | 3 |
        | Caucasian        | 4 |
        | Not set       | null |

      example: "1,2,null"

    liveness:
      in: query
      name: liveness
      schema:
        type: string
        format: list of integer (0, 1 ,2)
      description: |
        Comma-separated list of dominant liveness. Each event from result will contain one of the given liveness.

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

      example: "1,2"

    liveness_nullable:
      in: query
      name: liveness
      schema:
        type: string
        format: list of integer and null (0, 1 ,2, null)
      description: |
        Comma-separated list of dominant liveness or null. Each event from result will contain one of the given liveness.

        | liveness | value |
        |--------------|---|
        | spoof        | 0 |
        | real         | 1 |
        | unknown      | 2 |
        | not set   | null |

      example: "1,2,null"

    deepfake:
      in: query
      name: deepfake
      schema:
        type: string
        format: list of integer(0, 1)
      description: |
        Comma-separated list of dominant deepfakes. Each event from result will contain one of the given deepfake.

        | deepfake | value |
        |--------------|---|
        | fake         | 0 |
        | real         | 1 |

      example: "0,1"

    deepfake_nullable:
      in: query
      name: deepfake
      schema:
        type: string
        format: list of integer and null (0, 1, null)
      description: |
        Comma-separated list of dominant deepfakes or null. Each event from result will contain one of the given deepfake.

        | deepfake | value |
        |--------------|---|
        | fake         | 0 |
        | real         | 1 |
        | not set   | null |

      example: "0,null"

    apparent_gender:
      in: query
      name: apparent_gender
      schema:
        type: array
        items:
          type: integer
          enum: [ 0, 1, 2 ]
      explode: false
      description: |
        Comma-separated list of apparent gender: 0 - female, 1 - male, 2 - undefined. Each event from result will contain one of the given states.
      example: 1

    apparent_gender_nullable:
      in: query
      name: apparent_gender
      schema:
        type: array
        items:
          oneOf:
            - type: integer
              enum: [ 0, 1, 2 ]
            - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
        Comma-separated list of apparent gender: 0 - female, 1 - male, 2 - undefined, "null" - null value. Each event from result will contain one of the given states.
      example: 1

    apparent_age__lt:
      in: query
      name: apparent_age__lt
      schema:
        type: integer
        minimum: 0
        maximum: 100
      description: Apparent age upper excluded bound.
      example: 50

    apparent_age__gte:
      in: query
      name: apparent_age__gte
      schema:
        type: integer
        minimum: 0
        maximum: 100
      description: Apparent age lower included bound.
      example: 50

    headwear_states:
      in: query
      name: headwear_states
      schema:
        type: array
        items:
          type: integer
          enum: [ 0, 1, 2 ]
      explode: false
      description: |
        Comma-separated list of headwear states: 0 - absent, 1 - present, 2 - undefined. Each event from result will contain one of the given states.
      example: 1

    headwear_states_nullable:
      in: query
      name: headwear_states
      schema:
        type: array
        items:
          anyOf:
            - type: integer
              enum: [ 0, 1, 2 ]
            - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
        Comma-separated list of headwear states: 0 - absent, 1 - present, 2 - undefined, "null" - null value. Each event from result will contain one of the given states.
      example: 1

    headwear_colors:
      in: query
      name: headwear_apparent_colors
      schema:
        type: array
        items:
          $ref: '#/components/schemas/headwear_color'
      explode: false
      description: |
        Comma-separated list of headwear apparent colors. Each event from result will contain one of the given states.
      example: white,undefined

    headwear_colors_nullable:
      in: query
      name: headwear_apparent_colors
      schema:
        type: array
        items:
          oneOf:
            - $ref: '#/components/schemas/headwear_color'
            - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
        Comma-separated list of headwear apparent colors or null value. Each event from result will contain one of the given states.
      example: white,undefined,null

    sleeve_lengths:
      in: query
      name: sleeve_lengths
      schema:
        type: array
        items:
          type: string
          enum: [ short, long, undefined]
      explode: false
      description: |
        Comma-separated list of sleeve length states. Each event from result will contain one of the given states.
      example: short,undefined


    sleeve_lengths_nullable:
      in: query
      name: sleeve_lengths
      schema:
        type: array
        items:
          type: string
          enum: [ short, long, undefined, null]
      explode: false
      description: |
        Comma-separated list of sleeve length states or null value. Each event from result will contain one of the given states.
      example: short,null

    upper_clothing_colors:
      in: query
      name: upper_clothing_colors
      schema:
        type: array
        items:
          $ref: '#/components/schemas/clothing_color'
      explode: false
      description: |
        Comma-separated list of upper clothing colors. Each event from result will contain at least one of the given clothing colors.
      example: black,white

    upper_clothing_colors_nullable:
      in: query
      name: upper_clothing_colors
      schema:
        oneOf:
          - type: array
            items:
              $ref: '#/components/schemas/clothing_color'
          - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
        Comma-separated list of upper clothing colors or null for not specified colors. Each event from result will contain at least one of the given clothing colors.
      example: black,white

    lower_garment_types:
      in: query
      name: lower_garment_types
      schema:
        type: array
        items:
          type: string
          enum: [ undefined, trousers, shorts, skirt]
      explode: false
      description: |
        Comma-separated list of lower garment types. Each event from result will contain one of the given types.
      example: trousers,undefined

    lower_garment_types_nullable:
      in: query
      name: lower_garment_types
      schema:
        type: array
        items:
          type: string
          enum: [ undefined, trousers, shorts, skirt]
      explode: false
      description: |
        Comma-separated list of lower garment types. Each event from result will contain one of the given types.
      example: trousers,undefined,null

    lower_garment_colors:
      in: query
      name: lower_garment_colors
      schema:
        type: array
        items:
          $ref: '#/components/schemas/clothing_color'
      explode: false
      description: |
        Comma-separated list of lower garment colors. Each event from result will contain at least one of the given clothing colors.
      example: black,white

    lower_garment_colors_nullable:
      in: query
      name: lower_garment_colors
      schema:
        oneOf:
          - type: array
            items:
              $ref: '#/components/schemas/clothing_color'
          - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
        Comma-separated list of lower garment colors. Each event from result will contain at least one of the given clothing colors.
      example: black,white

    shoes_colors:
      in: query
      name: shoes_apparent_colors
      schema:
        type: array
        items:
          $ref: '#/components/schemas/shoes_color'
      explode: false
      description: |
        Comma-separated list of shoes apparent colors. Each event from result will contain one of the given states.
      example: white,undefined

    shoes_colors_nullable:
      in: query
      name: shoes_apparent_colors
      schema:
        type: array
        items:
          oneOf:
            - $ref: '#/components/schemas/shoes_color'
            - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
        Comma-separated list of shoes apparent colors or null value. Each event from result will contain one of the given states.
      example: white,undefined,null

    backpack_states:
      in: query
      name: backpack_states
      schema:
        type: array
        items:
          type: integer
          enum: [ 0, 1, 2 ]
      explode: false
      description: |
      Comma-separated list of backpack states: 0 - absent, 1 - present, 2 - undefined. Each event from result will contain one of the given states.
      example: 1

    backpack_states_nullable:
      in: query
      name: backpack_states
      schema:
        type: array
        items:
          oneOf:
            - type: integer
              enum: [ 0, 1, 2 ]
            - $ref: '#/components/schemas/null_filter'
      explode: false
      description: |
      Comma-separated list of backpack states: 0 - absent, 1 - present, 2 - undefined, "null" - not specified. Each event from result will contain one of the given states.
      example: 1

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

    list_create_time__lt:
      in: query
      name: create_time__lt
      schema:
        $ref: '#/components/schemas/time'
      description: Upper bound for list create_time.
      example: "2018-08-11T09:11:41.674Z"

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

    list_last_update_time__lt:
      in: query
      name: last_update_time__lt
      schema:
        $ref: '#/components/schemas/time'
      description: Upper excluded bound for list last_update_time.
      example: "2018-08-11T09:11:41.674Z"

    list_last_update_time__gte:
      in: query
      name: last_update_time__gte
      schema:
        $ref: '#/components/schemas/time'
      description: Lower included bound for list last_update_time.
      example: "2018-08-11T09:11:41.674Z"

    age__lt:
      in: query
      name: age__lt
      schema:
        type: integer
      description: Age upper excluded bound.
      example: 50

    age__gte:
      in: query
      name: age__gte
      schema:
        type: integer
      description: Age lower included bound.
      example: 50

    face_ids:
      in: query
      name: face_ids
      schema:
        type: string
        format: list of uuid
      description: Comma-separated list of face IDs.

      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381'

    face_id__lt:
      in: query
      name: face_id__lt
      schema:
        $ref: '#/components/schemas/uuid'
      description: Face ID upper excluded bound.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    face_id__lt_sorting:
      in: query
      name: face_id__lt
      schema:
        $ref: '#/components/schemas/uuid'
      description: Face ID upper excluded bound. Faces in response will be sorted by their ids. If neither *face_id__lt* or *face_id__gte* is specified, the faces will be sorted by creation time.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    face_id__gte:
      in: query
      name: face_id__gte
      schema:
        $ref: '#/components/schemas/uuid'
      description: Face ID lower included bound.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    face_id__gte_sorting:
      in: query
      name: face_id__gte
      schema:
        $ref: '#/components/schemas/uuid'
      description: Face ID lower included bound. Faces in response will be sorted by their ids. If neither *face_id__lt* or *face_id__gte* is specified, the faces will be sorted by creation time.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

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

      description: Comma-separated list of event IDs.

    event_id__gte:
      in: query
      name: event_id__gte
      schema:
        type: string
        format: uuid.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'
      description: Event ID lower included bound.

    event_id__gte_sorting:
      in: query
      name: event_id__gte
      schema:
        type: string
        format: uuid.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'
      description: Event ID lower included bound. Events in response will be sorted by their ids. If neither *event_id__lt* or *event_id__gte* is specified, the faces will be sorted by creation time.

    event_id__lt:
      in: query
      name: event_id__lt
      schema:
        type: string
        format: uuid.
      example: '346a5645-ec89-4806-820a-dbcb6e0dc381'
      description: Event ID upper excluded bound.

    event_id__lt_sorting:
      in: query
      name: event_id__lt
      schema:
        type: string
        format: uuid.
      example: '346a5645-ec89-4806-820a-dbcb6e0dc381'
      description: Event ID upper excluded bound. Events in response will be sorted by their ids. If neither *event_id__lt* or *event_id__gte* is specified, the faces will be sorted by creation time.

    attribute_ids:
      in: query
      name: attribute_ids
      schema:
        type: string
        format: list of uuid
      description: Comma-separated list of attribute IDs.

      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381'

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

    ignore:
      in: query
      name: ignore
      schema:
        $ref: '#/components/schemas/int01'
        default: 0
      description: Whether to ignore the error if the face to be deleted does not exist.

    descriptor_version:
      in: query
      name: descriptor_version
      schema:
        $ref: '#/components/schemas/descriptor_version'
      description: |
        Descriptor version returned in the response. By default, the LUNA PLATFORM default descriptor version is used.

    required_attribute_ids:
      in: query
      name: attribute_ids
      schema:
        type: string
        format: list of uuid
      required: true
      description: Comma-separated list of attribute IDs.

    temporary_attributes_targets:
      in: query
      name: targets
      schema:
        type: string
        format: comma-separated items
        default: create_time, attribute_id, account_id, face_descriptor_samples, basic_attributes_samples, face_descriptor, basic_attributes_samples
      description: |
        Comma-separated list of temporary attributes targets. All targets are available by default.
      example: basic_attributes,basic_attributes_samples,account_id

    face_attributes_targets:
      in: query
      name: targets
      schema:
        type: string
        format: comma-separated items
        default: create_time,basic_attributes,basic_attributes_samples,face_descriptor,face_descriptor_samples
      description: |
        Comma-separated list of temporary attributes targets. Available targets:
        `create_time`, `basic_attributes`, `basic_attributes_samples`, `face_descriptor`, `face_descriptor_samples`.

    event_id:
      in: query
      name: event_id
      schema:
        $ref: '#/components/schemas/event_id'
      description: Event ID associated with the face creation.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    handler_ids:
      in: query
      name: handler_ids
      schema:
        type: string
        format: list of uuid.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381'
      description: Comma-separated list of handler IDs.

    external_ids:
      in: query
      name: external_ids
      schema:
        type: string
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381'

      description: Comma-separated list of external IDs.

    user_data:
      in: query
      name: user_data
      schema:
        type: string
      description: |
        Find all objects with `user_data` similar to this parameter.
        You can specify only part of the `user_data` value for this filter.
      example: "user_data_text"

    user_data__eq:
      in: query
      name: user_data__eq
      schema:
        type: string
      description: |
        Find all objects with same `user_data`.
      example: "user_data_text"

    city:
      in: query
      name: city
      schema:
        $ref: '#/components/schemas/location_str'
      description: City where an event occurred.
      example: "New York"

    area:
      in: query
      name: area
      schema:
        $ref: '#/components/schemas/location_str'
      description: Area where an event occurred.
      example: "Manhattan"

    district:
      in: query
      name: district
      schema:
        $ref: '#/components/schemas/location_str'
      description: District where an event occurred.
      example: "Midtown"

    street:
      in: query
      name: street
      schema:
        $ref: '#/components/schemas/location_str'
      description: Street where an event occurred.
      example: "West 48th street"

    house_number:
      in: query
      name: house_number
      schema:
        $ref: '#/components/schemas/location_str'
      description: House number where an event occurred.
      example: "220"

    sources:
      in: query
      name: sources
      schema:
        type: string
      description: Comma-separated list of sources. Each event from result will contain one of given sources.
      example: "cam1,cam2"

    sources_nullable:
      in: query
      name: sources
      schema:
        type: string
      description: Comma-separated list of sources or null. Each event from result will contain one of given sources.
      example: "cam1,cam2,null"

    stream_id:
      in: query
      name: stream_id
      schema:
        $ref: '#/components/schemas/stream_id'
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'
      description: Stream ID.

    stream_ids:
      in: query
      name: stream_ids
      schema:
        type: string
        format: list of uuid.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381'
      description: Comma-separated list of stream IDs.

    stream_ids_nullable:
      in: query
      name: stream_ids
      schema:
        type: string
        format: list of uuid.
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb,346a5645-ec89-4806-820a-dbcb6e0dc381'
      description: Comma-separated list of stream IDs or null.

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

    cities:
      in: query
      name: cities
      schema:
        type: string
      description: Comma-separated list of cities. Each event from result will contain one of given cities in "location" parameter.
      example: "Moscow,New York"

    cities_nullable:
      in: query
      name: cities
      schema:
        type: string
      description: Comma-separated list of cities or null. Each event from result will contain one of given cities in "location" parameter.
      example: "Moscow,New York,null"

    areas:
      in: query
      name: areas
      schema:
        type: string
      description: Comma-separated list of areas. Each event from result will contain one of given areas in "location" parameter.
      example: "CAD,Manhattan"

    areas_nullable:
      in: query
      name: areas
      schema:
        type: string
      description: Comma-separated list of areas or null. Each event from result will contain one of given areas in "location" parameter.
      example: "CAD,Manhattan,null"

    districts:
      in: query
      name: districts
      schema:
        type: string
      description: Comma-separated list of districts. Each event from result will contain one of given districts in "location" parameter.
      example: "Mitino,Midtown"

    districts_nullable:
      in: query
      name: districts
      schema:
        type: string
      description: Comma-separated list of districts or null. Each event from result will contain one of given districts in "location" parameter.
      example: "Mitino,Midtown,null"

    streets:
      in: query
      name: streets
      schema:
        type: string
      description: |
        Comma-separated list of streets. Each event from result will contain one of given streets in "location" parameter.
      example: "Arbat,West 48th street"

    streets_nullable:
      in: query
      name: streets
      schema:
        type: string
      description: |
        Comma-separated list of streets or null. Each event from result will contain one of given streets in "location" parameter.
      example: "Arbat,West 48th street,null"

    house_numbers:
      in: query
      name: house_numbers
      schema:
        type: string
      description: |
        Comma-separated list of house numbers. Each event from result will contain one of given house numbers
        in "location" parameter.
      example: "1,220"

    house_numbers_nullable:
      in: query
      name: house_numbers
      schema:
        type: string
      description: |
        Comma-separated list of house numbers or null. Each event from result will contain one of given house numbers
        in "location" parameter.
      example: "1,220,null"

    top_matching_candidates_label:
      in: query
      name: top_matching_candidates_label
      schema:
        type: string
      description: Top matching candidates label. Each event from result will contain given label.
      example: "matching_label"

    matching_candidates_labels:
      in: query
      name: matching_candidates_labels
      schema:
        type: string
      description: Comma-separated list of matching candidates label. Each event from result will contain one or more given labels.
      example: "matching_label_1,matching_label_2"

    top_similar_object_ids:
      in: query
      name: top_similar_object_ids
      schema:
        type: array
        items:
          $ref: '#/components/schemas/external_id'
      description: Comma-separated list of top similar object IDs. Each event from result will contain one of given top similar object IDs.

    top_similar_external_ids:
      in: query
      name: top_similar_external_ids
      schema:
        type: array
        items:
          $ref: '#/components/schemas/uuid'
      description: Comma-separated list of top similar external IDs. Each event from result will contain one of given top similar external IDs.

    top_similar_object_similarity__gte:
      in: query
      name: top_similar_object_similarity__gte
      schema:
        type: number
      description: Top similar object similarity lower included bound.
      example: 0.5

    top_similar_object_similarity__lt:
      in: query
      name: top_similar_object_similarity__lt
      schema:
        type: number
      description: Top similar object similarity upper excluded bound.
      example: 0.5

    object_similarity__gte:
      in: query
      name: object_similarity__gte
      schema:
        type: number
      description: Object similarity lower included bound (boundary for top matching candidate).
      example: 0.5

    object_similarity__lt:
      in: query
      name: object_similarity__lt
      schema:
        type: number
      description: Object similarity upper excluded bound (boundary for top matching candidate).
      example: 0.5

    get_event_target:
      in: query
      name: target
      schema:
        $ref: '#/components/schemas/events_targets'
      description: |
        Comma-separated list of event fields.
        If set, each event from result will contain only specified fields, otherwise, events with all fields will be returned.
      example: "create_time,event_id,face_detections"

    get_single_event_target:
      in: query
      name: target
      schema:
        $ref: '#/components/schemas/events_targets'
      description: |
        Comma-separated list of event fields.
        If set, an event from result will contain only specified fields, otherwise, an event with all fields will be returned.
      example: "create_time,event_id,face_detections"

    get_face_target:
      in: query
      name: targets
      schema:
        $ref: '#/components/schemas/faces_targets'
      description: |
        Comma-separated list of face fields.
        If set, each face from result will contain only specified fields, otherwise, faces with all the fields will be returned.
      example: "face_id,user_data"

    list_id:
      in: query
      name: list_id
      schema:
        $ref: '#/components/schemas/uuid'
      description: List ID that contains faces.

    list_ids:
      in: query
      name: list_ids
      schema:
        type: string
        format: list of uuid
      description: Comma-separated list of list IDs.

    list_id__gte:
      in: query
      name: list_id__gte
      schema:
        type: string
        format: uuid
      description: List ID lower including boundary.

    list_id__lt:
      in: query
      name: list_id__lt
      schema:
        type: string
        format: uuid
      description: List ID upper excluding boundary.

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

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

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

    estimate_people_count:
      in: query
      name: estimate_people_count
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate people count on the image.

        ⚠ **People counter licensing feature is required to be enabled to perform estimation.**

    people_count_coordinates:
      in: query
      name: people_count_coordinates
      schema:
        allOf:
          - $ref: '#/components/schemas/int01'
          - default: 1
      description: |
        Whether to return people coordinates with people count estimation.

    multiface_policy:
      in: query
      name: multiface_policy
      schema:
        $ref: '#/components/schemas/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 only best face detection from the image.

    estimate_head_pose:
      in: query
      name: estimate_head_pose
      schema:
        $ref: '#/components/schemas/estimate_head_pose'
      description: |
        Whether to estimate head pose in the image. The head pose is represented by pitch, yaw and roll angles.

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

    estimate_emotions:
      in: query
      name: estimate_emotions
      schema:
        $ref: '#/components/schemas/estimate_emotions'
      description: |
        Whether to estimate emotions in the image. The probability of the following emotions is estimated: "anger", "disgust", "fear", "happiness", "sadness", "surprise", "neutral".

    estimate_mask:
      in: query
      name: estimate_mask
      schema:
        $ref: '#/components/schemas/estimate_mask'
      description: |
        Whether to estimate mask in the image. The probability of the following masks states is estimated: "medical_mask", "missing", "occluded".

        The estimated probability with the highest score is returned in the "predominant mask" parameter.

    estimate_glasses:
      in: query
      name: estimate_glasses
      schema:
        $ref: '#/components/schemas/estimate_glasses'
      description: |
        Whether to estimate glasses in the image. One of the following parameters is returned: "eyeglasses", "sunglasses", "no_glasses".

    estimate_liveness:
      in: query
      name: estimate_liveness
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate liveness in the image. The "quality" and "score" probabilities are estimated. Based on these probabilities, the following result is returned: "real", "spoof", "unknown".

        Liveness is utilized for this estimation. See "Administrator’s manual" for details about Liveness requirements.

        ⚠ **Webcam or selfie photos are required**. Otherwise the result may be incorrect.

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

        *Liveness estimation is not supported for samples (warped images).* The `image_type` parameter should be set to "0".

    estimate_deepfake:
      in: query
      name: estimate_deepfake
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate deepfake feature on the image.
        
        ⚠ **Deepfake licensing feature is required to be enabled to perform deepfake estimation.**

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

    detect_landmarks68:
      in: query
      name: detect_landmarks68
      schema:
        $ref: '#/components/schemas/detect_landmarks68'
      description: |
        Whether to detect basic 68-point facial landmarks in the image.
        *Not supported with warped images (see `warped_image` parameter).*

    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. Each of the following probabilities is estimated: "darkness", "light", "blurriness", "illumination", "specularity".

        The quality factor is estimated for each probability. It's value is in the range [0..1] where 0 corresponds to low quality and 1 to high quality.

        Note. Face recognition is not greatly affected by uneven illumination or high specularity.

    estimate_gaze:
      in: query
      name: estimate_gaze
      schema:
        $ref: '#/components/schemas/estimate_gaze'
      description: |
        Whether to estimate gaze in the image. The gaze is represented by yaw angle and pitch angle for both eyes at once.

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

    estimate_eyes_attributes:
      in: query
      name: estimate_eyes_attributes
      schema:
        $ref: '#/components/schemas/estimate_eyes_attributes'
      description: |
        Whether to estimate eye attributes in the image. The "right_eye" and "left_eye" parameters are estimated, which contain the "state" (opened, closed or occluded) and "iris_landmarks" parameters.

    estimate_mouth_attributes:
      in: query
      name: estimate_mouth_attributes
      schema:
        $ref: '#/components/schemas/estimate_mouth_attributes'
      description: |
        Whether to estimate mouth attributes in the image. Each of the following probabilities is estimated: "opened", "occluded", "smile", "score".

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

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

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


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

      description: |
        Filter by mask states.

        | mask state     | 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   |

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

      description: |
        Filter by deepfake states.

        | deepfake state | value |
        |----------------|-------|
        | fake           |   0   |
        | real           |   1   |

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

    aggregate_attributes:
      in: query
      name: aggregate_attributes
      schema:
        $ref: '#/components/schemas/aggregate_attributes'
      description: |
        Whether to aggregate face attributes (descriptor and basic attributes). Aggregation will only be performed together with the `extract_descriptor` and/or `extract_basic_attributes` parameters.

        If set, all extracted attributes from each image will be aggregated and stored as single objects.

        Otherwise, all extracted attributes from each image will be stored for each sample as separate objects.

    aggregate_attributes_sdk:
      in: query
      name: aggregate_attributes
      schema:
        $ref: '#/components/schemas/aggregate_attributes'
      description: |
        Whether to aggregate the following parameters:

           - face descriptor
           - body descriptor
           - face basic attributes (age, gender)
           - body basic attributes (apparent age, apparent gender)
           - mask states
           - emotions
           - liveness
           - deepfake
           - upper body attributes
           - lower body attributes
           - accessories

        Aggregation will be performed only if the appropriate parameters for estimating the listed above parameters are enabled.

        If set, all estimated parameters from each image will be aggregated and displayed in the `aggregate_estimations` field of the response body as single objects for all images. 

        Otherwise, all estimated parameters from each image will be displayed in the `estimations` field of the response body as separate objects for corresponding images.

    aggregate_attributes_events:
      in: query
      name: aggregate_attributes
      schema:
        $ref: '#/components/schemas/aggregate_attributes'
      description: |
        Whether to aggregate the following parameters:

           - face descriptor (not displayed in the response body)
           - body descriptor (not displayed in the response body)
           - face basic attributes (age, gender)
           - body basic attributes (apparent age, apparent gender)
           - mask states
           - emotions
           - liveness
           - deepfake
           - upper body 
           - accessories

        Aggregation will be performed only if the appropriate parameters for estimating the listed above parameters are enabled in the handler.

        If set, all estimated parameters from each image will be aggregated and stored in the event as single objects for all images. In the response body, the aggregated face basic attributes of all images will be displayed in the `face_attributes` > `basic_attributes` field, and the other aggregated parameters will be displayed in the `aggregate_estimations` field.

        Otherwise, all estimated parameters from each image will be stored in the event as separate objects. In the response body, the face basic attributes will be displayed in the `face_attributes` > `basic_attributes` field of the corresponding image, and the other parameters will be displayed in the `detections` > `samples` > `face`/`body` > `detection` > `attributes` field of the corresponding image.

    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).

    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 an input image is a sample or not.

    luna_event_time:
      in: header
      name: Luna-Event-Time
      schema:
        $ref: '#/components/schemas/time'
      examples:
        with_time_zone:
          summary: time with timezone with an offset of -08:00 from UTC (Pacific Standard Time).
          value: '2018-12-16T15:29:59.300275-08:00'
        utc:
          summary: utc time. The "Z" suffix denotes a UTC offset of 00:00 (Zulu).
          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). Any 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 with an offset of -08:00 from UTC (Pacific Standard Time).
          value: '2018-12-16T15:29:59.300275-08:00'
        utc:
          summary: utc time. The "Z" suffix denotes a UTC offset of 00:00 (Zulu).
          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.

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

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

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

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

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

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

    error_id:
      in: query
      name: error_id
      schema:
        $ref: '#/components/schemas/errorId'
      description: Error ID.
      example: 10

    error_ids:
      in: query
      name: error_ids
      schema:
        $ref: '#/components/schemas/errorIds'
      description: Comma-separated error IDs.

    task_ids:
      in: query
      name: task_ids
      schema:
        $ref: '#/components/schemas/taskIds'
      description: Comma-separated task IDs.

    error_code:
      in: query
      name: error_code
      schema:
        $ref: '#/components/schemas/error_code'
      description: Error code.

    task_type:
      in: query
      name: task_type
      schema:
        $ref: '#/components/schemas/task_type'
      example: 1

    task_status:
      in: query
      name: task_status
      schema:
        $ref: '#/components/schemas/taskStatus'
      example: 1

    status_code:
      in: query
      name: status_code
      schema:
        $ref: '#/components/schemas/status_code'
      description: HTTP status code.

    with_faces:
      in: query
      name: with_faces
      schema:
        $ref: '#/components/schemas/int01'
      description: Whether to delete list with all its faces.

    multiple_images_content_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

    multiple_data_content_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-vl-xpk
          - application/x-sdk-descriptor-base64
          - applicaition/x-vl-xpk-base64

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

    origin_longitude:
      in: query
      name: origin_longitude
      schema:
        - $ref: '#/components/schemas/longitude'
      description: |
        Longitude origin in degrees, a part of composite geo position filter or null for undefined geo position.
                Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.
                Geo position filter is considered as properly specified if both *origin_longitude* and
                *origin_latitude* are set, and considered as properly empty if neither of *origin_longitude*,
                *origin_latitude*, *longitude_delta*, *latitude_delta* is set.

      example: "36.616"

    origin_longitude_nullable:
      in: query
      name: origin_longitude
      schema:
        oneOf:
          - $ref: '#/components/schemas/longitude'
          - $ref: '#/components/schemas/null_filter'
      description: |
        Longitude origin in degrees, a part of composite geo position filter or null for undefined geo position.
                Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.
                Geo position filter is considered as properly specified if both *origin_longitude* and
                *origin_latitude* are set, and considered as properly empty if neither of *origin_longitude*,
                *origin_latitude*, *longitude_delta*, *latitude_delta* is set.
                Null filter applied only if *origin_longitude* or *origin_latitude* is set to 'null', and
                *longitude_delta* and *latitude_delta* is not set.

      example: "36.616"

    origin_latitude:
      in: query
      name: origin_latitude
      schema:
        - $ref: '#/components/schemas/latitude'
      description: |
        Latitude origin in degrees, a part of composite geo position filter or null for undefined geo position.
                Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.
                Geo position filter is considered as properly specified if both *origin_longitude* and
                *origin_latitude* are set, and considered as properly empty if neither of *origin_longitude*,
                *origin_latitude*, *longitude_delta*, *latitude_delta* is set.

      example: "55.752"

    origin_latitude_nullable:
      in: query
      name: origin_latitude
      schema:
        oneOf:
          - $ref: '#/components/schemas/latitude'
          - $ref: '#/components/schemas/null_filter'
      description: |
        Latitude origin in degrees, a part of composite geo position filter or null for undefined geo position.
                Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.
                Geo position filter is considered as properly specified if both *origin_longitude* and
                *origin_latitude* are set, and considered as properly empty if neither of *origin_longitude*,
                *origin_latitude*, *longitude_delta*, *latitude_delta* is set.
                Null filter applied only if *origin_longitude* or *origin_latitude* is set to 'null', and
                *longitude_delta* and *latitude_delta* is not set.

      example: "55.752"

    longitude_delta:
      in: query
      name: longitude_delta
      schema:
        $ref: '#/components/schemas/longitude_delta'
      description: |
        Longitude delta in degrees, a part of composite geo position filter.

        Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.

        Geo position filter is considered as properly specified if both *origin_longitude* and
        *origin_latitude* are set, and considered as properly empty if neither of *origin_longitude*,
        *origin_latitude*, *longitude_delta*, *latitude_delta* is set.

        If both *origin_longitude* and *origin_latitude* are set and *longitude_delta* is not set - the default value is applied.

        WARNING: Bounding 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.

        NOTE: highly recommended for citywide use only.
      example: "0.01"

    latitude_delta:
      in: query
      name: latitude_delta
      schema:
        $ref: '#/components/schemas/latitude_delta'
      description: |
        Latitude delta in degrees, a part of composite geo position filter.

        Geo position filter is a bounding box specified by coordinates of its center (origin) and some delta.

        Geo position filter is considered as properly specified if both *origin_longitude* and
        *origin_latitude* are set, and considered as properly empty if neither of *origin_longitude*,
        *origin_latitude*, *longitude_delta*, *latitude_delta* is set.

        If both *origin_longitude* and *origin_latitude* are set and *latitude_delta* is not set - the default value is applied.

        WARNING: Bounding 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.

        NOTE: highly recommended for citywide use only.
      example: "0.01"

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

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

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

    track_ids:
      in: query
      name: track_ids
      schema:
        type: string
        pattern: '^([a-zA-Z0-9_\-](1, 36))(,[a-zA-Z0-9_\-](1, 36))*$'
      description: Comma-separated list of track IDs. Each event from result will contain one of given track IDs. Each track ID can be at most 36 characters.
      example: "track_id_number_1,track_id_number_2"

    track_ids_nullable:
      in: query
      name: track_ids
      schema:
        oneOf:
          - type: string
            pattern: '^([a-zA-Z0-9_\-](1, 36))(,[a-zA-Z0-9_\-](1, 36))*$'
          - $ref: '#/components/schemas/null_filter'
      description: Comma-separated list of track IDs. Each event from result will contain one of given track IDs. Each track ID can be at most 36 characters.
      example: "track_id_number_1,track_id_number_2,null"

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

    detect_face:
      in: query
      name: detect_face
      schema:
        allOf:
          - $ref: '#/components/schemas/detect_face'
          - default: 0
        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_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'

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

    estimate_body_descriptor:
      in: query
      name: estimate_body_descriptor
      schema:
        allOf:
        - $ref: '#/components/schemas/extract_descriptor'
        default: 0
      description: |
        Whether to create human body descriptor(s).

    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).

    estimate_upper_body:
      in: query
      name: estimate_upper_body
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate human upper body on the image (headwear, clothing color, sleeve length).

    estimate_lower_body:
      in: query
      name: estimate_lower_body
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate human lower body on the image (lower garment, shoes).

    estimate_accessories:
      in: query
      name: estimate_accessories
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate human body accessories on the image (backpack presence).

    estimate_body_basic_attributes:
      in: query
      name: estimate_body_basic_attributes
      schema:
        $ref: '#/components/schemas/int01'
      description: |
        Whether to estimate human body basic attributes on the image (age, gender).

    estimate_body_warp:
      in: query
      name: estimate_body_warp
      schema:
        $ref: '#/components/schemas/estimate_body_warp'
      description: |
        Whether to create a human body warped image in the Base64 format.

    estimate_face_warp:
      in: query
      name: estimate_face_warp
      schema:
        $ref: '#/components/schemas/estimate_face_warp'
      description: |
        Whether to create the face warped image in the Base64 format.

    aggregate_liveness:
      in: query
      name: aggregate
      schema:
        type: integer
        enum: [1, 0]
        default: 0
        description: Whether to aggregate liveness estimations.
      example: 1

    description:
      in: query
      name: description
      schema:
        type: string
      description: Records with descriptions similar to this parameter will be processed.

    samples_type:
      in: path
      name: samples_type
      schema:
        type: string
        enum: [faces, bodies]
      description: Samples type.
      required: true

    application_json_or_msgpack_accept:
      in: header
      name: Accept
      schema:
        type: string
        enum:
          - application/json
          - application/msgpack
      description: Accept request header.

    match_response_accept:
      in: header
      name: Accept
      schema:
        type: string
        enum:
          - application/json
          - application/msgpack
        default: application/json
      description: Determines response mime-type which client to expect.

    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.

        *The processed image should have EXIF data, otherwise auto orientation will not be performed.*

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

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

    content_images:
      in: header
      name: Content-Type
      schema:
        type: string
        enum:
          - image/jpeg
          - image/png
          - image/bmp
          - image/tiff
          - image/x-portable-pixmap
      description: Type of transferring image.

    image_id:
      in: path
      name: image_id
      schema:
        $ref: '#/components/schemas/image_id'
      required: true

    object_id:
      in: path
      name: object_id
      schema:
        $ref: '#/components/schemas/object_id'
      required: true

    content_objects:
      in: header
      name: Content-Type
      schema:
        type: string
      required: true
      description: |
        Type of transferring information.
        
        > **WARNING** A value of this header will be used as a `Content-Type` header value for requests 
        ["GET object"](#operation/getObject) and will be use for a mime type calculation. 

    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 is validated and added to the buffer.
        The system does not wait until the event is 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 is stored in the database.

    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.

    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.

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

    raw_or_face_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.

    token_id_path_required:
      in: path
      name: token_id
      schema:
        $ref: '#/components/schemas/uuid'
      description: Token ID.
      required: true
      example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'

    estimate_face_quality:
      in: query
      name: estimate_face_quality
      schema:
        type: integer
        enum: [0, 1]
        default: 0
      description: |
        Whether to estimate face quality.

        It enables you to perform various face quality checks by thresholds which similar to ISO standard.
        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).

        ⚠ **ISO licensing feature is required to be enabled to perform face quality estimation.**
      example: 0

    meta:
      in: query
      name: '* (meta.path.to.field__operator:type)'
      schema:
        oneOf:
          - type: string
          - $ref: '#/components/schemas/null_filter'
      description: |
        User-defined event meta's filters.
        
        Parameter name pattern: `meta.<path.to.field>__<operator>:<type>`
        
        Path to field is a dotted event meta's json field path.
        
        Field comparison **operator** is optional one of `eq` (default), `neq`, `like`, `nlike`, `in`, `nin`, `gt`, `gte`, `lt`, `lte`.
        
        Field data **type** is optional one of `string` (default), `integer`, `numeric`.
        
        Allowed usage of filters is:
        
        |  operator  | type |        |         |         |
        |------------|------|--------|---------|---------|
        |            | null | string | integer | numeric |
        | eq         | +    | +      | +       | +       |
        | neq        | +    | +      | +       | +       |
        | like       | -    | +      | -       | -       |
        | nlike      | -    | +      | -       | -       |
        | in         | +    | +      | +       | +       |
        | nin        | +    | +      | +       | +       |
        | gt         | -    | +      | +       | +       |
        | gte        | -    | +      | +       | +       |
        | lt         | -    | +      | +       | +       |
        | lte        | -    | +      | +       | +       |

      example:
        meta.field_1__gt:numeric: 36.6
        meta.field_2.field_3__in: value,none
        meta.field_4:integer: 5
        meta: null

    geo_position:
      in: query
      name: geo_position
      explode: false
      schema:
        type: object
        properties:
          origin_longitude:
            type: float
            minimum: -180
            maximum: 180
            description: Geo bbox origin longitude, in degrees.
          origin_latitude:
            type: float
            minimum: -90
            maximum: 90
            description: Geo bbox origin latitude, in degrees.
          longitude_delta:
            type: float
            minimum: 0
            maximum: 90
            default: 0.01
            description: Geo bbox longitude delta, in degrees.
          latitude_delta:
            type: float
            minimum: 0
            maximum: 90
            default: 0.01
            description: Geo bbox latitude delta, in degrees.
        required: [ origin_longitude, origin_latitude ]
      description: |
        Geo position filter, i.e. geo bounding box specified by coordinates of its center (origin) and some delta. Each event from result will be covered by bbox specified.
      example:
        origin_longitude: 36.616
        origin_latitude: 55.752

    with_meta:
      in: query
      name: with_meta
      schema:
        type: integer
        enum: [ 0, 1 ]
        default: 0
      description: Whether to retrieve user-defined image metadata.
      example: 1

    meta_headers:
      in: header
      name: '* (X-Luna-Meta-<user_defined_key>)'
      schema:
        type: string
        example: <user_defined_value>
      description: User-defined image metadata key-value. To store metadata values for multiple keys, the multiple headers should be defined.

    schedule_id:
      in: query
      name: schedule_id
      schema:
        $ref: '#/components/schemas/schedule_id'
      description: Schedule according to which the task was created

    schedule_id_path:
      in: path
      name: schedule_id
      required: true
      schema:
        $ref: '#/components/schemas/schedule_id'
      description: Schedule according to which the task was created

    schedule_patch:
      in: query
      name: action
      required: true
      schema:
        type: string
        enum: [ pause, start ]
      description: Pause/start tasks schedule.

    task_type_schedulable:
      in: query
      name: task_type
      schema:
        $ref: '#/components/schemas/task_type_schedulable_reply'
      example: 1
    tail_lines:
      in: query
      name: tail_lines
      schema:
        type: integer
        minimum: 0
        maximum: 4294967296
      description: Number of strings what will be return.

    lambda_type:
      in: query
      name: lambda_type
      schema:
        type: string
        enum: [ standalone, handlers, tasks]
      description: Lambda type.

    application_multipart_content:
      in: header
      name: Content-Type
      schema:
        type: string
        enum:
          - multipart/form-data
      description: The request content type header.
      required: true

    application_json_content:
      in: header
      name: Content-Type
      schema:
        type: string
        enum:
          - application/json
      description: The request content type header.

    login:
      in: query
      name: login
      schema:
        $ref: "#/components/schemas/login"
      description: Account login.
      required: false
      example: "user@visionlabs.ru"

    account_type:
      in: query
      name: account_type
      schema:
        $ref: "#/components/schemas/account_type"
      description: Account type.
      required: false
      example: user

    account_targets:
      in: query
      name: targets
      schema:
        type: string
        enum:
          - account_id
          - login
          - account_type
          - description
          - create_time
          - last_update_time
        default: [ account_id, login, account_type, description, create_time, last_update_time ]
      description: Comma-separated list of account target fields. 
      example: [ login ]

    grant_all_permissions:
      in: query
      name: grant_all_permissions
      schema:
        type: integer
        enum: [ 0, 1 ]
        default: 0
      description: |
        Grant all permissions to token. 1 - give, 0 - do not give.
        If value is `1` then `permissions` field is not required.

        Grant only standart permissions.

    path_task_id:
      in: path
      name: task_id
      schema:
        $ref: '#/components/schemas/task_id'
      required: true
      description: Task ID.

    namespace:
      in: query
      name: namespace
      description: |
        Comma-separated list of lambda namespaces.
        Each namespace must match the pattern `^[a-z0-9][a-z0-9-]*[a-z0-9]$`
      schema:
        type: array
        items:
          $ref: "#/components/schemas/namespace"
      example: "default,no-default-namespace"
  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.
        link:
          type: string
          description: Link to the documentation website with the error description.
      required:
      - error_code
      - detail
      - desc
      - link
      example:
        error_code: 11009
        detail: Internal server error
        desc: Internal server error
        link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11009"

    face_sample:
      type: string
      format: binary
      description: |
        Image generated by VisionLabs algorithms.

    body_sample:
      type: string
      format: binary
      description: |
        Image generated by VisionLabs algorithms.

    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"

    attribute_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: Attribute ID. This ID links the descriptor, basic attributes, and samples extracted from a single image.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    sample_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: Sample ID.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    sample_ids:
      type: array
      maxItems: 8
      minItems: 1
      description: Sample ID list.
      items:
        $ref: '#/components/schemas/sample_id'
      example:
        - f9f03668-27e3-4e23-9b55-681e5927905e
        - 4967ccb7-b521-43b5-93ba-a0d266631bb2
        - dd98cf9c-ddf3-4962-a3c5-e8bd540a4fc7

    result_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: ID of task result, which stored in the Image Store service.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    external_id:
      description: User-defined external ID for the object.
      type: string
      maxLength: 36
      example: "14159261415926"
      default: ""

    face_external_id:
      allOf:
      - $ref: '#/components/schemas/external_id'
      description: User-defined external ID for the face. External ID can be used to link several faces which belong to one person.

    event_external_id:
      allOf:
      - $ref: '#/components/schemas/external_id'
      description: User-defined external ID for the event.

    filter_external_id:
      description: Objects were filtered which `external_id` is not equal to the filter.
      type: string
      maxLength: 36
      example: "14159261415926"
      default: ""

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

    avatar:
      type: string
      maxLength: 256
      format: uri-reference
      example: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg'
      default: ""
      description: |
        Avatar is a visual representation of the face.

        The avatar can be used in the user interface.

        You can use a sample or an external image as the avatar.

    account_id:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: |
            Luna Account Id. Data with the specified "account_id" will be used for the task.

            The value is empty by default for account types "advanced_user" and "admin".
            Data from all accounts is used if the required "account_id" is not specified.
            In this case, processing the task can take considerable time.

            For the "user" account type the value is automatically replaced with the current "account_id" of the account.

    list_id:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: List ID.

    lists:
      type: array
      items:
        $ref: '#/components/schemas/list_id'
      minItems: 0
      description: Comma-separated list of list IDs which contain the face.

    deleted_lists:
      type: object
      properties:
        list_ids:
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          minItems: 1
          description: Comma-separated list of list IDs for removal.
      required: [list_ids]

    samples_list:
      type: array
      items:
        $ref: '#/components/schemas/sample_id'
      minItems: 0
      uniqueItems: true

    attribute_samples:
      type: object
      properties:
        samples:
          $ref: '#/components/schemas/samples_list'
      description: List of all unique samples.
      required: [samples]
      example:
        samples:
          - 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
          - 2f1cbb34-12e5-486c-8f7f-57273053c32d

    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"

    count:
      type: integer
      minimum: 0
      example: 1
      description: Objects count.

    faces_count:
      type: object
      properties:
        faces_count:
          allOf:
            - description: Faces count.
            - $ref: '#/components/schemas/count'
      required: [faces_count]
      example:
        faces_count: 7

    lists_count:
      type: object
      properties:
        lists_count:
          allOf:
            - description: Lists count.
            - $ref: '#/components/schemas/count'
      required: [lists_count]
      example:
        lists_count: 3

    handlers_count:
      type: object
      properties:
        handlers_count:
          allOf:
            - description: Handlers count.
            - $ref: '#/components/schemas/count'
      required: [handlers_count]
      example:
        handlers_count: 5

    verifiers_count:
      type: object
      properties:
        verifiers_count:
          allOf:
            - description: Verifiers count.
            - $ref: '#/components/schemas/count'
      required: [verifiers_count]
      example:
        verifiers_count: 4

    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

    int090:
      type: integer
      minimum: 0
      maximum: 90

    number01:
      type: number
      minimum: 0
      maximum: 1

    url:
      type: string
      description: Face URL.

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

    detect_time:
      allOf:
        - $ref: "#/components/schemas/time"
      description: Detection time.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}))$'
      example: "2018-08-11T09:11:41.674Z"

    detect_ts:
      type: number
      minimum: 0.0
      maximum: 158731466399.999
      description: User-defined timestamp relative to something, such as the start of a video.
      example: 123.456
      nullable: true

    image_origin:
      type: string
      maxLength: 256
      description: URL to the source image.
      nullable: true
      example: |
        /6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e

    image_origin_base64:
      type: string
      description: |
        Image in base64. The specified image will be used as `image_origin` for created events independently of `image_origin_policy`.
      nullable: false

    image_origin_mimetype:
      type: string
      description: Image origin mimetype. Must be set if image origin is provided as base64 image.
      enum: ["image/x-jpeg-base64", "image/x-png-base64", "image/x-bmp-base64", "image/x-tiff-base64",
              "image/x-portable-pixmap-base64"]
      nullable: false

    image_origin_not_nullable_base64_json:
      anyOf:
        - $ref: '#/components/schemas/image_origin_not_nullable'
        - $ref: '#/components/schemas/image_origin_base64'

    image_origin_list_item_json:
      type: object
      properties:
        filename:
          type: string
          description: Image filename. It must be the same as one of 'image' request part filename.
        image_origin:
          oneOf:
            - $ref: '#/components/schemas/image_origin_not_nullable_base64_json'
        mimetype:
          $ref: '#/components/schemas/image_origin_mimetype'
      required: [ filename, image_origin ]

    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

    null_filter:
      type: string
      enum: [ null ]

    image_location:
      type: string
      pattern: '^/6/images/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$'
      description: Resource for managing image.
      example: /6/images/141d2706-8baf-433b-82eb-8c7fada847da

    object_location:
      type: string
      pattern: '^/6/objects/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$'
      description: Resource for managing object.
      example: /6/objects/141d2706-8baf-433b-82eb-8c7fada847da

    image_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: Image ID.
      example: "141d2706-8baf-433b-82eb-8c7fada847da"

    object_id:
      allOf:
      - $ref: '#/components/schemas/uuid'
      - description: Object ID.
      example: "141d2706-8baf-433b-82eb-8c7fada847da"

    images_creation_response:
      type: object
      properties:
        image_id:
          $ref: '#/components/schemas/image_id'
        url:
          type: string
          format: uri-reference
          description: URL to resource.
          example: /6/images/{image_id}
        external_url:
          $ref: '#/components/schemas/external_url'
      required: [image_id, url, external_url]
      example:
        image_id: 141d2706-8baf-433b-82eb-8c7fada847da
        url: /6/images/141d2706-8baf-433b-82eb-8c7fada847da
        external_url: http://127.0.0.1:5000/6/images/141d2706-8baf-433b-82eb-8c7fada847da

    objects_creation_response:
      type: object
      properties:
        object_id:
          $ref: '#/components/schemas/object_id'
        url:
          type: string
          format: uri-reference
          description: URL to resource.
          example: /6/objects/{object_id}
        external_url:
          $ref: '#/components/schemas/external_url'
      required: [object_id, url, external_url]
      example:
        object_id: 141d2706-8baf-433b-82eb-8c7fada847da
        url: /6/objects/141d2706-8baf-433b-82eb-8c7fada847da
        external_url: http://127.0.0.1:5000/6/objects/141d2706-8baf-433b-82eb-8c7fada847da

    location_str:
      type: string
      maxLength: 36
      example: "some place identification"

    city:
      allOf:
        - $ref: '#/components/schemas/location_str'
        - description: City where an event occurred.

    area:
      allOf:
        - $ref: '#/components/schemas/location_str'
        - description: Area where an event occurred.

    district:
      allOf:
        - $ref: '#/components/schemas/location_str'
        - description: District where an event occurred.

    street:
      allOf:
        - $ref: '#/components/schemas/location_str'
        - description: Street where an event occurred.

    house_number:
      allOf:
        - $ref: '#/components/schemas/location_str'
        - description: House number where an event occurred.

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

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

    longitude_delta:
      description: Longitude delta in degrees.
      type: number
      minimum: 0
      maximum: 90
      default: 0.01
      example: 0.01

    latitude_delta:
      description: Latitude delta in degrees.
      type: number
      minimum: 0
      maximum: 90
      default: 0.01
      example: 0.01

    angle:
      type: float
      minimum: -180
      maximum: 180
      description: angle
      example: 90.101

    geo_position:
      type: object
      description: Geo position specified by geographic coordinates - longitude and latitude.
      properties:
        longitude:
          allOf:
            - $ref: '#/components/schemas/longitude'
            - description: Longitude in degrees.
        latitude:
          allOf:
            - $ref: '#/components/schemas/latitude'
            - description: Latitude in degrees.
      required: [longitude, latitude]

    geo_position_bbox:
      description: |
        Geo position filter is bounding box specified by coordinates of its center (origin) and some delta.
        WARNING: Bounding 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.
        Bounding box edges more than 180 degrees are not allowed. Boundaries of valid range are **exclusive**.
        NOTE: highly recommended for citywide use only.
      type: object
      properties:
        origin_longitude:
          $ref: '#/components/schemas/longitude'
        origin_latitude:
          $ref: '#/components/schemas/latitude'
        longitude_delta:
          allOf:
            - $ref: '#/components/schemas/longitude_delta'
          default: 0.01
          description: |
            Longitude delta in degrees.
            WARNING: Bounding 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.
            Bounding box edges more than 180 degrees are not allowed. Boundaries of valid range are **exclusive**.
            NOTE: highly recommended for citywide use only.
        latitude_delta:
          allOf:
            - $ref: '#/components/schemas/latitude_delta'
          default: 0.01
          description: |
            Longitude delta in degrees.
            WARNING: Bounding 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.
            Bounding box edges more than 180 degrees are not allowed. Boundaries of valid range are **exclusive**.
            NOTE: highly recommended for citywide use only.
      required: [origin_longitude, origin_latitude]

    location:
      type: object
      description: Information about place where an event occurred.
      properties:
        city:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/city'
        area:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/area'
        district:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/district'
        street:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/street'
        house_number:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/house_number'
        geo_position:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/geo_position'

    input_event_location:
      type: object
      description: Information about place where an event occurred.
      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:
      allOf:
        - $ref: '#/components/schemas/int02'
        - default: 0
        - type: integer
        - description: |
            multiple face detection policy:

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

            - *`1`* - multiple face detection allowed

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

    estimate_head_pose:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
         Whether to estimate head pose in the image. The pose is defined by yaw, pitch and roll angles.

         *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 in the image.

    estimate_quality:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          Whether to estimate input face image quality. Each of the following probabilities is estimated: "darkness", "light", "blurriness", "illumination", "specularity".

          The quality factor is estimated for each probability. It's value is in the range [0..1] where 0 corresponds to low quality and 1 to high quality.

          Note. Face recognition is not greatly affected by uneven illumination or high specularity.

    estimate_gaze:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          Whether to estimate gaze in the image. The gaze is represented by yaw angle and pitch angle for both eyes at once.

          *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 in the image (iris landmarks and state of the eyes).

    estimate_mouth_attributes:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          Whether to estimate:
            - occlusion of the mouth in the image,
            - the score for the mouth detection confidence,
            - the smile probability.

    estimate_mask:
      allOf:
      - $ref: '#/components/schemas/int01'
      - description: |
          Whether to estimate mask in the image. The probability of the following masks states is estimated: "medical_mask", "missing", "occluded".

          The estimated probability with the highest score is returned in the "predominant mask" parameter.

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

    estimate_body_warp:
      allOf:
        - $ref: '#/components/schemas/int01'
        - type: integer

    estimate_face_warp:
      allOf:
        - $ref: '#/components/schemas/int01'
        - type: integer

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

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

    detect_landmarks68:
      allOf:
      - $ref: '#/components/schemas/int01'
      - type: integer
      - description: |
          Whether to detect basic 68-point facial landmarks in 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 (artist, date, software, orientation, etc.) from input 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.

    pitch_threshold:
      example: 180
      allOf:
        - $ref: '#/components/schemas/int0180'
        - description: |
            Maximum deviation pitch angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

            Remove this parameter from the query, or set the parameter value to 180 if pitch angle filtration is not required.

            When the value is set to "0", all the images are filtered.

    roll_threshold:
      example: 180
      allOf:
        - $ref: '#/components/schemas/int0180'
        - description: |
            Maximum deviation roll angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

            Remove this parameter from the query, or set the parameter value to 180 if roll angle filtration is not required.

            When the value is set to "0", all the images are filtered.

    yaw_threshold:
      example: 180
      allOf:
        - $ref: '#/components/schemas/int0180'
        - description: |
            Maximum deviation yaw angle from 0. If the estimated value is equal or less than the threshold, the image is filtered.

            Remove this parameter from the query, or set the parameter value to 180 if yaw angle filtration is not required.

            When the value is set to "0", all the images are filtered.

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

        | mask state     | value |
        |----------------|-------|
        | missing        |   1   |
        | medical_mask   |   2   |
        | occluded       |   3   |
      example: [2, 3]

    estimate_liveness:
      type: object
      properties:
        estimate:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: |
                Whether to estimate liveness in the image. The "quality" and "score" probabilities are estimated. Based on these probabilities, the following result is returned: "real", "spoof", "unknown".
          default: 0
        liveness_threshold:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Real score threshold for liveness estimation.
          default: 0.5
        quality_threshold:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Image quality threshold for liveness estimation.
          default: 0.5
      description: |
          Liveness estimation configuration.

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

    liveness_states:
      type: array
      items:
        $ref: '#/components/schemas/liveness_state'
      minItems: 1
      description: |
        Filter by liveness states. Only events with an estimated liveness state equal to one of the specified liveness states will be processed. Each event from the result will contain one of given predominant liveness.

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

    deepfake_states:
      type: array
      items:
        $ref: '#/components/schemas/deepfake_state'
      minItems: 1
      description: |
        Filter by deepfake states. Only events with an estimated deepfake state equal to one of the specified deepfake states will be processed. Each event from the result will contain one of given predominant deepfake states.

        | deepfake   | value |
        |----------------|---|
        | fake           | 0 |
        | real           | 1 |

    liveness_candidate_filter:
      type: array
      items:
        type: integer
        nullable: true
        enum: [0, 1, 2 ]
      example: 1
      minItems: 1
      description: |
        Filter by liveness states. Only events with an estimated liveness state equal to one of the specified liveness states will be processed. Each event from the result will contain one of given predominant liveness.

        | liveness        | value |
        |------------------|------|
        | spoof            | 0    |
        | real             | 1    |
        | unknown          | 2    |
        | is not estimated | null |

    estimate_deepfake:
      type: object
      properties:
        estimate:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: Whether to estimate deepfake on the image.
          default: 0
        real_threshold:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Deepfake estimation real score threshold.
          default: 0.5
        mode:
          type: integer
          enum: [ 1,2 ]
          default: 2
          description: Deepfake estimation mode.
      description: |
          Deepfake estimation configuration.

          ⚠ **Deepfake licensing feature is required to be enabled to perform deepfake estimation.**

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

    deepfake_candidate_filter:
      type: array
      items:
        type: integer
        nullable: true
        enum: [0, 1]
      example: 1
      minItems: 1
      description: |
        Filter by deepfake states. Only events with an estimated deepfake state equal to one of the specified deepfake states will be processed. Each event from the result will contain one of given predominant deepfake.

        | deepfake         | value |
        |------------------|------|
        | fake             | 0    |
        | real             | 1    |
        | is not estimated | null |
        

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

    extract_descriptor:
      example: 1
      allOf:
      - $ref: '#/components/schemas/int01'
      - default: 1
      - 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
        description: |
          Whether to aggregate attributes.

          If the value is set to "0", a descriptor and basic attributes are extracted for each sample.

          If the value is set to "1", you can create an aggregated descriptor, receive aggregated basic attributes, or both. The behavior depends on the `extract_basic_attributes` and `extract_descriptor` parameters:

          - If `extract_descriptor` is enabled, all the samples in the request will be used to create a single descriptor. An aggregated descriptor gives you more accurate results upon descriptors comparison.

          - If `extract_basic_attributes` is enabled, all the samples in the request will be used to extract basic attributes. Age, gender and ethnicity values received from several samples are more precise.

          >Make sure that all the samples in the request belong to the same person.

          >If there are several faces in the input image, an error occurs.

    score_threshold:
      type: number
      minimum: 0
      maximum: 1
      example: 0.70
      default: 0
      description: |
        Descriptor quality score threshold. The higher the quality score for the image, the better the extraction results.

        All the attributes with a 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).

        *Consult VisionLabs about the recommended value of this parameter.*

        **Note!** This parameter is **not** related to the image quality estimated in the detect request (`estimate_quality` request parameter).

    similarity_threshold:
      type: number
      minimum: 0.0
      maximum: 1.0
      example: 0.5
      default: 0.0
      description: |
        Matching similarity threshold. The higher the similarity for candidates, the greater the likelihood that this is the same person.

        All the descriptors with a similarity score below the threshold will be ignored, and the corresponding candidate will not be shown in the result. The function will proceed as usual with all the remaining candidates (if left).

        *Consult VisionLabs about the recommended value of this parameter.*

    column:
      anyOf:
        - type: string
          enum: [event_id, external_id, handler_id, source, stream_id, top_matching_candidates_label, top_similar_object_id,
                 top_similar_external_id, create_time, end_time, top_similar_object_similarity, face_id, gender, age,
                 emotion, ethnic_group, user_data, tags, city, area, district, street, house_number, geo_position, mask,
                 track_id, apparent_age, apparent_gender, sleeve_length, headwear_state, headwear_apparent_color, liveness,
                 deepfake, upper_clothing_colors, lower_garment_type, lower_garment_colors, shoes_apparent_color, backpack_state]
        - type: string
          pattern: '^meta.*'
      description: Fields to aggregate.
      example: source

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

    age:
      allOf:
        - $ref: '#/components/schemas/int0100'
        - description: Human age.
        - example: 29

    aggregator:
      type: string
      enum: [count, max, min, avg, group_by]
      example: count
      description: Aggregation function for column.
      default: count

    operator_filter:
      type: string
      enum: [eq, neq, in, nin, like, nlike, gt, gte, lt, lte, covered]
      description: |
        Filter operator. For tags it is required to be `like/nlike` only.
        For geo position filter it is required to be covered only.
      example: eq

    operator_period:
      type: string
      enum: [gt, gte, lt, lte]
      description: Filter operator for event creation time.
      example: gt

    value_period:
      type: string
      example: "2018-01-01T00:00:00Z"
      pattern: ^((\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}))|(now-\d+(y|M|w|d|h|m|s)))$
      description: Filter value for event creation time. In ISO or now-time format.

    value_filter:
      oneOf:
        - type: string
        - type: number
        - type: array
          items:
            oneOf:
              - type: string
              - type: number
        - $ref: '#/components/schemas/geo_position_bbox'
      description: |
        Filter value. It is required to be string, integer, float or its array
        or an object with specific properties in case of geo position filter -
        geo position filter is bounding box specified by coordinates of its center (origin) and some delta.
      example: "London"

    filter_user_data:
      description: |
        User data filter. Objects whose `user_data` values do not include the specified filter as a substring will be
        filtered.
      type: string
      maxLength: 128
      example: "info"

    face_user_data:
      type: string
      description: User data associated with face.
      example: "face of person"
      default: ""
      maxLength: 128

    event_user_data:
      type: string
      description: User data associated with event.
      example: "some event"
      default: ""
      maxLength: 128

    event_meta_common:
      type: object
      additionalProperties: true
      description: |
        User defined metadata (JSON object). Size shouldn't exceed 2MB.

        To be able to further search for meta using GET requests, JSON must have a valid format without spaces in field
        names. Use only latin letters, numbers, and single underscores in field names.
      example:
        key: value

    event_meta_list:
      type: array
      description: Map with image filename and event meta.
      items:
        type: object
        properties:
          filename:
            type: string
            description: Image filename. It must be the same as one of 'image' request part filename.
          meta:
            $ref: '#/components/schemas/event_meta_common'
        required: [ filename, meta ]
      minItems: 1

    event_meta:
      oneOf:
        - $ref: '#/components/schemas/event_meta_common'
        - $ref: '#/components/schemas/event_meta_list'

    list_user_data:
      type: string
      default: ""
      maxLength: 128
      description: User data associated with list.
      example: "list of good persons"

    target:
      type: object
      description: Event field and corresponding function-aggregator for statistic selection.
      properties:
        column:
          $ref: '#/components/schemas/column'
        aggregator:
          $ref: '#/components/schemas/aggregator'
      required: [column , aggregator]
      example:
        column: "age"
        aggregator: "avg"

    targets:
      type: array
      description: |
        You can specify one or several event fields and functions for them for data aggregation.

        The table includes event fields and available functions for them:

        | Column                              | Aggregator |     |     |     |          |
        |-------------------------------------|------------|-----|-----|-----|----------|
        |                                     | count      | max | min | avg | group_by |
        | event_id                            | +          | -   | -   | -   | +        |
        | external_id                         | +          | -   | -   | -   | +        |
        | handler_id                          | +          | -   | -   | -   | +        |
        | stream_id                           | +          | -   | -   | -   | +        |
        | source                              | +          | -   | -   | -   | +        |
        | top_matching_candidates_label       | +          | -   | -   | -   | +        |
        | top_similar_object_id               | +          | -   | -   | -   | +        |
        | top_similar_external_id             | +          | -   | -   | -   | +        |
        | top_similar_object_similarity       | +          | +   | +   | +   | -        |
        | create_time                         | +          | +   | +   | -   | -        |
        | end_time                            | +          | +   | +   | -   | -        |
        | face_id                             | +          | -   | -   | -   | +        |
        | gender                              | +          | +   | +   | +   | +        |
        | age                                 | +          | +   | +   | +   | +        |
        | emotion                             | +          | +   | +   | +   | +        |
        | mask                                | +          | +   | +   | +   | +        |
        | ethnic_group                        | +          | +   | +   | +   | +        |
        | liveness                            | +          | +   | +   | +   | +        |
        | deepfake                            | +          | +   | +   | +   | +        |
        | user_data                           | +          | -   | -   | -   | +        |
        | tags                                | +          | +   | +   | -   | -        |
        | city                                | +          | -   | -   | -   | +        |
        | area                                | +          | -   | -   | -   | +        |
        | district                            | +          | -   | -   | -   | +        |
        | street                              | +          | -   | -   | -   | +        |
        | house_number                        | +          | -   | -   | -   | +        |
        | geo_position                        | +          | -   | -   | -   | -        |
        | track_id                            | +          | -   | -   | -   | +        |
        | apparent_age                        | +          | +   | +   | +   | +        |
        | apparent_gender                     | +          | +   | +   | +   | +        |
        | sleeve_length                       | +          | -   | -   | -   | +        |
        | headwear_state                      | +          | +   | +   | +   | +        |
        | headwear_apparent_color             | +          | -   | -   | -   | +        |
        | upper_clothing_colors               | +          | -   | -   | -   | -        |
        | lower_garment_colors                | +          | -   | -   | -   | -        |
        | lower_garment_type                  | +          | -   | -   | -   | +        |
        | shoes_apparent_color                | +          | -   | -   | -   | +        |
        | backpack_state                      | +          | +   | +   | +   | +        |
        | meta.*                              | +          | +   | +   | +   | -        |


        >Note! There **must** be at least one function different from `group_by` in the `targets`, otherwise an error occurs.

      items:
        $ref: '#/components/schemas/target'
      minItems: 0
      default:
        - {'column': 'event_id', 'aggregator': 'count'}

    filter:
      type: object
      description: Filter for sample restriction.
      properties:
        column:
          $ref: '#/components/schemas/column'
        operator:
          $ref: '#/components/schemas/operator_filter'
        value:
          $ref: '#/components/schemas/value_filter'
      required: [column , operator, value]

    filters:
      type: array
      description: |
        Specifies filters for events.

        Operators available for each filter:

        | Filter                        | Operator    |         |         |                  |         |         |
        |-------------------------------|-------------|---------|---------|------------------|---------|---------|
        |                               | like, nlike | in, nin | eq, neq | gt, gte, lt, lte | covered | eq null |
        | tags                          | +           | -       | -       | -                | -       | -       |
        | source                        | -           | +       | +       | -                | -       | +       |
        | stream_id                     | -           | +       | +       | -                | -       | +       |
        | user_data                     | -           | +       | +       | -                | -       | -       |
        | account_id                    | -           | +       | +       | +                | -       | -       |
        | event_id                      | -           | +       | +       | +                | -       | -       |
        | external_id                   | -           | +       | +       | +                | -       | -       |
        | handler_id                    | -           | +       | +       | +                | -       | -       |
        | top_similar_object_id         | -           | +       | +       | +                | -       | -       |
        | top_similar_external_id       | -           | +       | +       | +                | -       | -       |
        | top_matching_candidates_label | -           | +       | +       | -                | -       | -       |
        | top_similar_object_similarity | -           | -       | -       | +                | -       | -       |
        | face_id                       | -           | +       | +       | +                | -       | -       |
        | gender                        | -           | +       | +       | +                | -       | +       |
        | age                           | -           | +       | +       | +                | -       | +       |
        | emotion                       | -           | +       | +       | +                | -       | +       |
        | mask                          | -           | +       | +       | +                | -       | +       |
        | ethnic_group                  | -           | +       | +       | +                | -       | +       |
        | liveness                      | -           | +       | +       | +                | -       | +       |
        | deepfake                      | -           | +       | +       | +                | -       | +       |
        | city                          | -           | +       | +       | -                | -       | +       |
        | area                          | -           | +       | +       | -                | -       | +       |
        | district                      | -           | +       | +       | -                | -       | +       |
        | street                        | -           | +       | +       | -                | -       | +       |
        | house_number                  | -           | +       | +       | -                | -       | +       |
        | geo_position                  | -           | -       | -       | -                | +       | +       |
        | track_id                      | -           | +       | +       | -                | -       | +       |
        | apparent_age                  | -           | +       | +       | +                | -       | +       |
        | apparent_gender               | -           | +       | +       | +                | -       | +       |
        | sleeve_length                 | -           | +       | +       | -                | -       | +       |
        | headwear_state                | -           | +       | +       | +                | -       | +       |
        | upper_clothing_colors         | -           | +       | -       | -                | -       | +       |
        | backpack_state                | -           | +       | +       | +                | -       | +       |
        | lower_garment_colors          | -           | +       | -       | -                | -       | +       |
        | headwear_apparent_color       | -           | +       | +       | -                | -       | +       |
        | lower_garment_type            | -           | +       | +       | -                | -       | +       |
        | shoes_apparent_color          | -           | +       | +       | -                | -       | +       |
        | meta.*                        | +           | +       | +       | +                | -       | +       |

      items:
        $ref: '#/components/schemas/filter'
      minItems: 0

    period:
      type: object
      properties:
        operator:
          $ref: '#/components/schemas/operator_period'
        value:
          $ref: '#/components/schemas/value_period'
      required: [operator, value]

    periods:
      type: array
      description: |
        Specifies the period of event creation. All the events created during this period will be included in the statistics.

        You can set the start and end of the period or only one of the bounds.

        >**Note!** You can specify **only one** period!
      items:
        $ref: '#/components/schemas/period'
      minItems: 0

    group_by:
      type: string
      description: |
        Enables you to group events by creation time according to one of two ways:

        1) Grouping by time intervals - number and dimension

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

        2) The frequency grouping - one of the following

        | Parameter value | Description        |
        |---------------------|--------------------|
        | `monthOfYear`       | by month of year   |
        | `weekOfYear`        | by week of year    |
        | `dayOfYear`         | by day of year     |
        | `dayOfMonth`        | by day of month    |
        | `dayOfWeek`         | by day of week     |
        | `hourOfDay`         | by hours of day    |
        | `minuteOfHour`      | by minutes of hour |

      example: "dayOfWeek"

    is_dynamic:
      description: |
        Dynamic handler flag. If the value is set to "true", the handler is created without predefined policies.

        Use this flag to specify policies for each event created using resource "/handlers/{handler_id}/event".
        Use the request body schema "multipart/form-data" to specify policies.
      type: boolean
      deprecated: true
      default: false

    handler_type:
      description: |
        Whether to get only non-dynamic (0), dynamic (1) or lambda (2) handlers.
        
        If type is non-dynamic:
          - Handler will use policies what assigned to it.
        
        If type is dynamic:
          - Handler will use given policies for each event generation request.
        
        If type is lambda:
          - All requests will be sent to lambda handler using `lambda_id`.
          - The format of the request and response body may not match what is specified for canonical handlers.
          - Logic of the request behavior completely depends on the lambda, written by the user.
          - For a description, see documentation of the lambda.
      type: integer
      enum: [0, 1, 2]
      default: 0

    image_format_threshold:
      type: array
      items:
        type: string
        enum: [ JPEG, JPEG2000, PNG ]
      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'

    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

    base_float_max_threshold:
      type: number
      nullable: false
      description: Exclusive upper bound of the allowed range.
      example: 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_int_max_threshold_nullable:
      type: integer
      nullable: true
      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'
            - minimum: 0

    check_threshold_inclusive_int_positive_max_nullable:
      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'
            - minimum: 0

    check_thresold_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_thresold_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_thresold_float_positive:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - type: number
                - minimum: 0.0
                - description: Inclusive lower bound of the allowed range.
                - $ref: '#/components/schemas/base_float_min_threshold'
            max:
              allOf:
                - type: number
                - minimum: 0.0
                - description: Inclusive upper bound of the allowed range.
                - $ref: '#/components/schemas/base_float_min_threshold'

    check_thresold_float_positive_max_nullable:
      allOf:
        - $ref: '#/components/schemas/base_float_threshold'
        - properties:
            min:
              allOf:
                - type: number
                - minimum: 0.0
                - description: Inclusive lower bound of the allowed range.
                - $ref: '#/components/schemas/base_float_min_threshold'
            max:
              allOf:
                - type: number
                - minimum: 0.0
                - nullable: true
                - description: Inclusive upper bound of the allowed range.
                - $ref: '#/components/schemas/base_float_min_threshold'

    illumination_quality_threshold:
      allOf:
        - $ref: '#/components/schemas/check_thresold_float_0_1'
        - default:
            min: 0.3
            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_thresold_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_thresold_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_thresold_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_thresold_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_thresold_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_thresold_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: 0.0
                - maximum: 1.0
            max:
              allOf:
                - description: Inclusive upper bound of the allowed range.
                - $ref: '#/components/schemas/base_float_max_threshold'
                - minimum: 0.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.5
        - 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.5
        - 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" ]
      default: ["no_glasses", "eyeglasses"]
      description: List of image formats allowed by standard.

    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" ]
      default: ["open"]
      description: List of image formats allowed by standard.

    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_thresold_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_thresold_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_thresold_float_0_1'
        - 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_thresold_float_0_1'
        - 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_thresold_float_positive_max_nullable'
        - 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_thresold_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_max_nullable'
        - default:
            min: 180
            max: 1920

    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_max_nullable'
        - 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_max_nullable'
        - 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_max_nullable'
        - 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_max_nullable'
        - 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_max_nullable'
        - 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/check_thresold_float_0_1'
        - 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/check_thresold_float_0_1'
        - 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

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

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

    smile_threshold:
      type: array
      items:
        $ref: '#/components/schemas/smile'
      default: ["none"]
      description: List of successful values.
      minItems: 1

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

    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'
      default: ["none"]
      description: List of values to consider successful.
      minItems: 1

    headwear_type_check:
      type: object
      description: Headwear type check.
      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"]

    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.
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: integer
          enum: [ 0, 1 ]
          default: 0
          description: Value to consider successful.

    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.
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: integer
          enum: [ 0, 1 ]
          default: 0
          description: Value to consider successful.

    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.
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: integer
          enum: [ 0, 1 ]
          default: 1
          description: Value to consider successful.

    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'
      default: ["neutral"]
      description: List of values to consider successful.
      minItems: 1

    eyebrows_state_check:
      type: object
      description: Eyebrows state check.
      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"]

    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 ]

    shoulders_position:
      type: string
      enum: ["non-parallel", "parallel", "hidden"]

    shoulders_position_threshold:
      type: array
      items:
        $ref: '#/components/schemas/shoulders_position'
      description: List of values to consider successful.
      minItems: 1

    shoulders_position_check:
      type: object
      description: Shoulders position status check.
      properties:
        estimate:
          $ref: '#/components/schemas/estimate_flag'
        threshold:
          type: array
          items:
            $ref: '#/components/schemas/shoulders_position'
          description: List of values to consider successful.
          minItems: 1
          default: ["parallel"]

    shoulders_position_check_required:
      allOf:
        - $ref: '#/components/schemas/shoulders_position_check'
        - required:
            - estimate
            - threshold


    shoulders_position_status_iso:
      title: shoulders_position
      description: Shoulders position status check.
      type: object
      properties:
        name:
          type: string
          enum: ["shoulders_position"]
          description: Unique estimation name.
        object_value:
          allOf:
            - $ref: '#/components/schemas/shoulders_position'
            - nullable: true
              description: Shoulders position estimated value.
        threshold_value:
          type: array
          items:
            type: string
            enum: ["parallel"]
          description: List of values to consider successful.
        result:
          $ref: '#/components/schemas/check_result'
      required: [ name, object_value, threshold_value, result ]

    shoulders_position_status:
      title: shoulders_position
      description: Shoulders position status check.
      type: object
      properties:
        name:
          type: string
          enum: ["shoulders_position"]
          description: Unique estimation name.
        object_value:
          allOf:
            - $ref: '#/components/schemas/shoulders_position'
            - nullable: true
              description: Eyebrows state estimated value.
        threshold_value:
          $ref: '#/components/schemas/shoulders_position_threshold'
        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'
      default: ["color"]
      description: List of values to consider successful.
      minItems: 1

    face_color_type_check:
      type: object
      description: Face color type check.
      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"]

    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:
      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 ]


    background_lightness_threshold:
      allOf:
        - $ref: '#/components/schemas/check_thresold_float_0_1'
        - default:
            min: 0.2
            max: 1.0
        - description: Background uniformity threshold, 1 - background is light, 0 - background is dark

    background_lightness_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/background_lightness_threshold'
        - description: Face detection background lightness check | not available for warped images.

    background_lightness_check_required:
      allOf:
        - $ref: '#/components/schemas/background_lightness_check'
        - required:
            - estimate
            - threshold

    background_lightness:
      allOf:
      - $ref: '#/components/schemas/face_check_element_score'
      - properties:
          name:
            enum: [background_lightness]
      - title: background_lightness
      - description: Face detection background lightness check.


    background_uniformity_threshold:
      allOf:
        - $ref: '#/components/schemas/check_thresold_float_0_1'
        - default:
            min: 0.5
            max: 1.0
        - description: Background uniformity threshold, 1 - background is uniformity, 0 - background is non uniformity

    background_uniformity_check:
      allOf:
        - $ref: '#/components/schemas/check_base'
        - properties:
            threshold:
              $ref: '#/components/schemas/background_uniformity_threshold'
        - description: Face detection background uniformity check | not available for warped images.

    background_uniformity:
      allOf:
      - $ref: '#/components/schemas/face_check_element_score'
      - properties:
          name:
            enum: [background_uniformity]
      - title: background_uniformity
        description: Face detection background uniformity check.

    background_uniformity_check_required:
      allOf:
        - $ref: '#/components/schemas/background_uniformity_check'
        - required:
            - estimate
            - threshold


    face_quality_checks:
      type: object
      description: |
        Face quality checks and filters.

        Default thresholds are set by VisionLabs specialists in accordance with the standard. This values can be changed to suit specific needs.
      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'
        background_uniformity:
          $ref: '#/components/schemas/background_uniformity_check'
        background_lightness:
          $ref: '#/components/schemas/background_lightness_check'
        shoulders_position:
          $ref: '#/components/schemas/shoulders_position_check'

    face_quality_checks_required:
      type: object
      description: |
        Face quality checks and filters.

        Default thresholds are set by VisionLabs specialists in accordance with the standard. This values can be changed to suit specific needs.
      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'
        background_uniformity:
          $ref: '#/components/schemas/background_uniformity_check_required'
        background_lightness:
          $ref: '#/components/schemas/background_lightness_check_required'
        shoulders_position:
          $ref: '#/components/schemas/shoulders_position_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,
                 background_lightness, background_uniformity, shoulders_position]

    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'

    estimate_basic_attributes:
      allOf:
        - default: 0
        - $ref: '#/components/schemas/int01'
        - description: Whether to estimate basic body attributes (apparent_gender, apparent_age) from the image.

    estimate_upper_body:
      allOf:
        - default: 0
        - $ref: '#/components/schemas/int01'
        - description: |
            Whether to estimate upper body attributes (headwear, upper_clothing_color, sleeve_length) from the image.

    estimate_lower_body:
      allOf:
        - default: 0
        - $ref: '#/components/schemas/int01'
        - description: |
            Whether to estimate lower body attributes (lower_garment, shoes) from the image.

    estimate_accessories:
      allOf:
        - default: 0
        - $ref: '#/components/schemas/int01'
        - description: Whether to estimate basic accessories attributes (backpack_state) from the image.

    detect_policy_body_attributes:
      type: object
      description: |
        Body attributes estimation configuration.

        ⚠ **Body attributes licensing feature is required to be enabled to perform body attributes estimation.**
      properties:
        estimate_basic_attributes:
          $ref: "#/components/schemas/estimate_basic_attributes"
        estimate_upper_body:
          $ref: "#/components/schemas/estimate_upper_body"
        estimate_lower_body:
          $ref: "#/components/schemas/estimate_lower_body"
        estimate_accessories:
          $ref: "#/components/schemas/estimate_accessories"

    detect_policy_body_attributes_required:
      allOf:
        - $ref: "#/components/schemas/detect_policy_body_attributes"
      required:
        - estimate_basic_attributes
        - estimate_upper_body
        - estimate_lower_body
        - estimate_accessories

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

        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_glasses:
          $ref: '#/components/schemas/estimate_glasses'

        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:
            - nullable: true
            - $ref: '#/components/schemas/yaw_threshold'

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

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

        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

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

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

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

        body_attributes:
          $ref: '#/components/schemas/detect_policy_body_attributes'

      description: |
        The policy specifies face and/or body detection parameters.

        This policy execution depends on the status of the `image_type` parameter in the "generate events" request:

        - If `image_type` is set to "0" (raw image), then images are processed according to the `detect_policy`, and new face samples are created for them.

        - If `image_type` is set to "1" (face warp):
          Body estimations are ignored.
          Face sample is directly saved in the Image Store.
          E.g. if face estimations are not set in `detect_policy`, then images are not processed at all and are just saved into Image Store as face samples.

        - If `image_type` is set to "2" (body warp):
          Face estimations are ignored.
          Body sample is directly saved in the Image Store.
          E.g. if body estimations are not set in `detect_policy`, then images are not processed at all and are just saved into Image Store as body samples.

        > The estimated face properties are not stored in the Events database (except emotion). The properties are only returned in the response.

        > **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`*, *`extract_face_descriptor`*, *`extract_basic_attributes`*, *`mask_states`* ,
        *`estimate_liveness`*, *`liveness_states`*, *`estimate_deepfake`*, *`deepfake_states`*, *`face_quality`*)
        will be ignored. Same for body: if *`detect_body`* parameter is set to 0, all body detection targets & filters (i.e. *`extract_body_descriptor`*).

    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:
            estimate_people_count:
              required: [ estimate ]
            face_quality:
              $ref: '#/components/schemas/face_quality_required'
            body_attributes:
              $ref: '#/components/schemas/detect_policy_body_attributes_required'
        - required:
          - estimate_people_count
          - detect_face
          - detect_body
          - multiface_policy
          - estimate_head_pose
          - estimate_emotions
          - estimate_mask
          - estimate_quality
          - estimate_gaze
          - estimate_glasses
          - estimate_eyes_attributes
          - estimate_mouth_attributes
          - detect_landmarks68
          - extract_exif
          - yaw_threshold
          - pitch_threshold
          - roll_threshold
          - mask_states
          - estimate_liveness
          - liveness_states
          - estimate_deepfake
          - deepfake_states
          - face_quality
          - body_attributes

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

        extract_face_descriptor:
          allOf:
          - $ref: '#/components/schemas/extract_descriptor'
          - default: 1

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

        extract_body_descriptor:
          $ref: '#/components/schemas/extract_body_descriptor'
      description: |
        Specifies parameters for the extraction of descriptors and basic attributes.

    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

    gender_candidate_filter:
      type: integer
      nullable: true
      enum: [ 0, 1 ]
      description: Gender. 1 - male, 0 - female, `null` - is not estimated.
      example: 1

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

    age_gte_filter:
      allOf:
        - $ref: '#/components/schemas/age'
        - description: Lower included bound for age.
        - example: 22

    liveness_filter:
      type: array
      description: |
            Array of allowed liveness states.

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

      items:
        $ref: '#/components/schemas/liveness_state'

    deepfake_filter:
      type: array
      description: |
        Array of allowed deepfake states.
        
        | deepfake   | value |
        |----------------|---|
        | fake           | 0 |
        | real           | 1 |

      items:
        $ref: '#/components/schemas/deepfake_state'

    ethnicities_enum:
      type: integer
      enum: [1, 2, 3, 4]
      example: 4
      description: |
        Ethnicity.

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

    ethnicities_enum_nullable:
      type: integer
      nullable: true
      enum: [1, 2, 3, 4]
      example: 4
      description: |
        Ethnicity.

        | ethnicity       | value |
        |------------------|------|
        | AfricanAmerican  | 1    |
        | Indian           | 2    |
        | Asian            | 3    |
        | Caucasian        | 4    |
        | is not estimated | null |

    ethnicities_filter:
      example: [4, 3]
      type: array
      items:
        $ref: '#/components/schemas/ethnicities_enum'
      description: |
        List of ethnicities. Each event from result will contain one of given ethnicities.

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

    ethnicities_candidate_filter:
      example: [ 4, 3 ]
      type: array
      items:
        type: integer
        nullable: true
      description: |
        List of ethnicities. Each event from result will contain one of given ethnicities.
        
        | ethnicity       | value |
        |------------------|------|
        | AfricanAmerican  | 1    |
        | Indian           | 2    |
        | Asian            | 3    |
        | Caucasian        | 4    |
        | is not estimated | null |
      minItems: 1

    emotion_enum:
      description: |
        Predominant emotion.

        | emotions    | value |
        |-----------------|---|
        | anger           | 1 |
        | disgust         | 2 |
        | fear            | 3 |
        | happiness       | 4 |
        | neutral         | 5 |
        | sadness         | 6 |
        | surprise        | 7 |
      type: integer
      enum: [1, 2, 3, 4, 5, 6, 7]

    emotion_enum_nullable:
      description: |
        Predominant emotion.
        
        | emotions        | value |
        |------------------|------|
        | anger            | 1    |
        | disgust          | 2    |
        | fear             | 3    |
        | happiness        | 4    |
        | neutral          | 5    |
        | sadness          | 6    |
        | surprise         | 7    |
        | is not estimated | null |
      type: integer
      nullable: true
      enum: [ 1, 2, 3, 4, 5, 6, 7 ]

    liveness_state:
      description: |
        Prediction of the image to be a photo of a real person (0 - spoof, 1 - real, 2 - unknown).

        | liveness | value |
        |--------------|---|
        | spoof        | 0 |
        | real         | 1 |
        | unknown      | 2 |
      type: integer
      enum: [0, 1, 2]
      example: 1

    liveness_state_nullable:
      description: |
        Prediction of the image to be a photo of a real person (0 - spoof, 1 - real, 2 - unknown).

        | liveness        | value |
        |------------------|------|
        | spoof            | 0    |
        | real             | 1    |
        | unknown          | 2    |
        | is not estimated | null |
      type: integer
      nullable: true
      enum: [ 0, 1, 2 ]
      example: 1

    deepfake_state:
      description: |
        Prediction that a person in the image created via deepfake (or not).

        | deepfake | value |
        |--------------|---|
        | fake         | 0 |
        | real         | 1 |
      type: integer
      enum: [0, 1]
      example: 1

    deepfake_state_nullable:
      description: |
        Prediction that a person in the image created via deepfake (or not).

        | deepfake        | value |
        |------------------|------|
        | fake             | 0    |
        | real             | 1    |
        | is not estimated | null |
      type: integer
      nullable: true
      enum: [ 0, 1]
      example: 1


    mask_enum:
      description: |
        Predominant mask.

        | mask state     | value |
        |----------------|-------|
        | missing        |   1   |
        | medical_mask   |   2   |
        | occluded       |   3   |

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

    mask_enum_nullable:
      description: |
        Predominant mask.

        | mask state       | value |
        |------------------|-------|
        | missing          |   1   |
        | medical_mask     |   2   |
        | occluded         |   3   |
        | is not estimated | null  |
      nullable: true
      type: integer
      enum: [ 1, 2, 3 ]

    masks:
      type: array
      items:
        $ref: '#/components/schemas/mask_enum'
      description: |
        List of masks. Each event from result will contain one of given mask states.

        | mask state     | value |
        |----------------|-------|
        | missing        |   1   |
        | medical_mask   |   2   |
        | occluded       |   3   |
      minItems: 1

    masks_filter:
      type: array
      items:
        type: integer
        nullable: true
        enum: [ 1, 2, 3 ]
      description: |
        List of masks. Each event from result will contain one of given mask states.
        
        | mask state       | value |
        |------------------|-------|
        | missing          |   1   |
        | medical_mask     |   2   |
        | occluded         |   3   |
        | is not estimated | null  |
      minItems: 1

    face_occlusion:
      type: object
      description: Estimated face occlusion.
      properties:
        predominant_occlusion:
          type: string
          enum: ["full", "clear", "correct", "partially", "mouth", "chin"]
          description: The most likely face occlusion state.
        estimations:
          type: object
          description: Raw face occlusion estimations scores.
          properties:
            full:
              allOf:
              - $ref: '#/components/schemas/number01'
              description: The probability that the mask occlude whole face.
            clear:
              allOf:
              - $ref: '#/components/schemas/number01'
              description: The probability that the mask absent.
            correct:
              allOf:
              - $ref: '#/components/schemas/number01'
              description: The probability that the mask is put on correctly.
            partially:
              allOf:
              - $ref: '#/components/schemas/number01'
              description: The probability that the mask is put on partially correct.
            mouth:
              allOf:
              - $ref: '#/components/schemas/number01'
              description: The probability that the mask is put on mouth only.
            chin:
              allOf:
              - $ref: '#/components/schemas/number01'
              description: The probability that the mask is put on chin only.
          required: [full, clear, correct, partially, mouth, chin]
      required: [predominant_occlusion, estimations]

    base_masks_estimation:
      type: object
      description: Estimated face mask state.
      properties:
        estimations:
          $ref: '#/components/schemas/mask_estimations'
        predominant_mask:
          $ref: '#/components/schemas/mask_predominant'
        face_occlusion:
          $ref: '#/components/schemas/face_occlusion'
      required: [estimations, predominant_mask]

    input_masks_estimation:
      allOf:
        - $ref: '#/components/schemas/base_masks_estimation'

    masks_estimation:
      allOf:
        - $ref: '#/components/schemas/base_masks_estimation'
        - required: [estimations, predominant_mask, face_occlusion]

    emotion_filter:
      example: [4, 7]
      type: array
      items:
        $ref: '#/components/schemas/emotion_enum_nullable'
      description: |
        List of emotions. Each event from result will contain one of given emotions.

        | emotions        | value |
        |------------------|------|
        | anger            |  1   |
        | disgust          |  2   |
        | fear             |  3   |
        | happiness        |  4   |
        | neutral          |  5   |
        | sadness          |  6   |
        | surprise         |  7   |
        | is not estimated | null |
      minItems: 1

    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
      description: List of track ids. Item can be `null` it means is not estimated. Each event from result will contain one of given track IDs.
      items:
        allOf:
          - nullable: true
          - $ref: '#/components/schemas/track_id'
      minItems: 1
      maxItems: 1000
      example: ["track_id_number_1", "track_id_number_2", null]

    match_origin_faces:
      type: string
      enum: ["faces"]
      description: Candidate type - `faces`.

    match_origin_events:
      type: string
      enum: ["events"]
      description: Candidate type – `events`.

    face_ids:
      type: array
      items:
        $ref: '#/components/schemas/uuid'
      description: List of face IDs. Each event from result will contain one of given 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.

    descriptor_info:
      type: object
      description: Descriptor object filter.
      properties:
        type:
          type: string
          description: Descriptor type.
          enum: ["face", "body"]
          default: "face"
      required: [type]

    external_ids:
      type: array
      items:
        $ref: '#/components/schemas/filter_external_id'
      description: List of external IDs. Each event from result will contain one of given external IDs.
      minItems: 1
      maxItems: 1000

    create_time__gte:
      allOf:
        - $ref: '#/components/schemas/time'
      description: Create time lower included boundary.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}))$'

    create_time__lt:
      allOf:
        - $ref: '#/components/schemas/time'
      description: Create time upper excluded boundary.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}))$'

    end_time__gte:
      allOf:
        - $ref: '#/components/schemas/time'
      description: End time lower included boundary.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}))$'

    end_time__lt:
      allOf:
        - $ref: '#/components/schemas/time'
      description: End time upper excluded boundary.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}))$'

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

    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:

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

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

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

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

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

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

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

    match_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:
          allOf:
          - $ref: '#/components/schemas/account_id'
          description: |
            Account ID.
            > **WARNING** Handler's *account id* will be automaically use for matching filters for requests with limited visibility or requests using dynamic handlers.
        external_ids:
          $ref: '#/components/schemas/external_ids'
        user_data:
          allOf:
            - $ref: '#/components/schemas/filter_user_data'
          description: User data associated with face. Search by substring (operator - `like/nlike`).
        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

    match_candidate_face_filters:
      allOf:
      - $ref: '#/components/schemas/match_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'

    match_candidate_face_filters_for_request:
      allOf:
      - $ref: '#/components/schemas/match_candidate_face_filters_without_time_filters'
      - properties:
          create_time__gte:
            description: Create time lower excluded 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'

    tags:
      description: List of tags.
      type: array
      items:
        type: string
        maxLength: 36
      example: ['tag1', 'tag2']
      minItems: 0
      maxItems: 1000

    areas:
      description: List of areas. Item can be `null` it means is not estimated. Each event from result will contain one of given areas in "location" parameter.
      type: array
      items:
        allOf:
          - nullable: true
          - $ref: '#/components/schemas/area'
      example: ['area1', 'area2', null]
      minItems: 1
      maxItems: 1000

    cities:
      type: array
      items:
        allOf:
          - nullable: true
          - $ref: '#/components/schemas/city'
      description: List of cities. Item can be `null` it means is not estimated. Each event from result will contain one of given cities in "location" parameter.
      example: ["moscow", "New-York", null]
      minItems: 1
      maxItems: 1000

    districts:
      type: array
      items:
        allOf:
          - nullable: true
          - $ref: '#/components/schemas/district'
      description: List of districts. Item can be `null` it means is not estimated. Each event from result will contain one of given districts in "location" parameter.
      example: ["mitino", "central park", null]
      minItems: 1
      maxItems: 1000

    streets:
      type: array
      items:
        allOf:
          - nullable: true
          - $ref: '#/components/schemas/street'
      description: List of streets. Item can be `null` it means is not estimated. Each event from result will contain one of given streets in "location" parameter.
      example: ["arbat, schepkina", null]
      minItems: 1
      maxItems: 1000

    house_numbers:
      type: array
      items:
        allOf:
          - nullable: true
          - $ref: '#/components/schemas/house_number'
      description: List of house numbers. Item can be `null` it means is not estimated. Each event from result will contain one of given house numbers in "location" parameter.
      example: ["1", "1/2str3", null]
      minItems: 1
      maxItems: 1000

    source:
      type: string
      description: Additional information that user provides with event.
      example: "3rd Avenue"
      maxLength: 128

    sources:
      type: array
      items:
        allOf:
          - $ref: '#/components/schemas/source'
          - nullable: true
      description: List of sources. Item can be `null` it means is not estimated. Each event from result will contain one of given sources in "location" parameter.
      example: ['cam1', 'cam2', null]
      minItems: 1
      maxItems: 1000

    stream_id:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: Stream ID.
      example: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"

    stream_ids:
      type: array
      items:
        $ref: '#/components/schemas/stream_id'
      description: List of stream IDs. Each event from result will contain one of given stream IDs.
      minItems: 1
      maxItems: 1000

    event_ids:
      type: array
      items:
        $ref: '#/components/schemas/event_id'
      description: List of event IDs. Each event from result will contain one of given event IDs.
      minItems: 1
      maxItems: 1000

    event_id__gte:
      allOf:
        - $ref: '#/components/schemas/event_id'
      description: Event ID lower included boundary.

    event_id__lt:
      allOf:
        - $ref: '#/components/schemas/event_id'
      description: Event ID upper excluded boundary.

    top_similar_object_ids:
      type: array
      items:
        $ref: '#/components/schemas/face_id'
      description: List of top similar object IDs. Each event from result will contain one of given similar object IDs.
      minItems: 1
      maxItems: 1000

    top_similar_external_ids:
      type: array
      items:
        $ref: '#/components/schemas/external_id'
      description: List of top similar external IDs. Each event from result will contain one of given similar external IDs.
      minItems: 1
      maxItems: 1000

    similarity:
      type: number
      minimum: 0
      maximum: 1
      example: 0.5

    face_similarity:
      type: number
      description: Face similarity.
      minimum: 0
      maximum: 1

    event_similarity:
      allOf:
        - $ref: '#/components/schemas/face_similarity'
      description: Event similarity.

    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.

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

    apparent_gender:
      type: array
      items:
        type: integer
        nullable: true
        enum: [ 0, 1, 2 ]
      description: |
        Apparent gender filter: 0 - female, 1 - male, 2 - undefined, `null` - is not estimated. Each event from result will contain one of the given states.
      example: [ 1 ]

    apparent_age__lt:
      type: integer
      minimum: 0
      maximum: 100
      description: Apparent age upper excluded bound.
      example: 50

    apparent_age__gte:
      type: integer
      minimum: 0
      maximum: 100
      description: Apparent age lower included bound.
      example: 50

    headwear_states:
      type: array
      items:
        type: integer
        nullable: true
        enum: [ 0, 1, 2 ]
      description: |
        Headwear state filter: 0 - absent, 1 - present, 2 - undefined, `null` - is not estimated. Each event from result will contain one of the given states.
      example: [ 1 ]

    headwear_color:
      type: string
      enum: [ undefined, black, white, other ]
      description: |
        Headwear apparent color.
        > **WARNING** This enum can be expanded. The field must be interpret as arbitrary string which can be equal to one element from enum.

    headwear_colors:
      type: array
      minItems: 1
      items:
        type: string
        nullable: true
        enums: [ undefined, black, white, other ]
      description: |
        Headwear apparent color filter. Item can be `null` it means is not estimated. Each event from result will contain one of the given states.
      example: [ black ]

    sleeve_lengths:
      type: array
      items:
        type: string
        nullable: true
        enum: [ short, long, undefined ]
      description: |
        Sleeve length state filter. Item can be `null` it means is not estimated. Each event from result will contain one of the given states.
      example: [ short ]

    clothing_color:
      type: string
      enum: [ undefined, black, blue, green, gray, orange, purple, red, white, yellow, pink, brown, beige, khaki, multicolored ]
      description: |
        Clothing color.
        > **WARNING** This enum can be expanded. The field must be interpret as arbitrary string which can be equal to one element from enum.

    upper_clothing_colors:
      type: array
      items:
        type: string
        nullable: true
        enum: [ undefined, black, blue, green, gray, orange, purple, red, white, yellow, pink, brown, beige, khaki, multicolored ]
        description: Clothing color.
      description: |
        Upper clothing color filter. Item can be `null` it means is not estimated. Each event from result will contain at least one of the given clothing colors.
      example: [ black, white ]

    lower_garment_colors:
      type: array
      items:
        type: string
        nullable: true
        enum: [ undefined, black, blue, green, gray, orange, purple, red, white, yellow, pink, brown, beige, khaki, multicolored ]
        description: Clothing color.
      description: |
        Lower garment color filter. Item can be `null` it means is not estimated. Each event from result will contain at least one of the given clothing colors.
      example: [ black, white ]

    lower_garment_type:
      type: string
      enum: [ undefined, trousers, shorts, skirt ]
      description: |
        Lower garment type.
        > **WARNING** This enum can be expanded. The field must be interpret as arbitrary string which can be equal to one element from enum.

    lower_garment_types:
      type: array
      minItems: 1
      items:
        type: string
        nullable: true
        enum: [ undefined, trousers, shorts, skirt ]
      description: |
        Lower garment type filter. Item can be `null` it means is not estimated. Each event from result will contain one of the given states.
      example: [ trousers ]

    shoes_color:
      type: string
      enum: [ undefined, black, white, other ]
      description: |
        Shoes apparent color.
        > **WARNING** This enum can be expanded. The field must be interpret as arbitrary string which can be equal to one element from enum.

    shoes_colors:
      type: array
      minItems: 1
      items:
        type: string
        nullable: true
        enum: [ undefined, black, white, other ]
        description: Shoes apparent color.
      description: |
        Shoes apparent color filter. Item can be `null` it means is not estimated. Each event from result will contain one of the given states.
      example: [ black ]

    backpack_states:
      type: array
      items:
        nullable: true
        enum: [ 0, 1, 2 ]
      description: |
        Backpack state filter: 0 - absent, 1 - present, 2 - undefined, `null` - is not estimated. Each event from result will contain one of the given states.
      example: [ 1 ]

    meta:
      type: object
      additionalProperties: true
      description: |
        User-defined event meta's filters.

        Key pattern: `path.to.field[__operator]`.

        Value defines type.

        Path to field is an event meta's json field path. To navigate through nested objects the dot (.) is used.

        Field comparison **operator** is optional one of `eq` (default), `neq`, `like`, `nlike`, `in`, `nin`, `gt`, `gte`, `lt`, `lte`.

        Allowed usage of filters is:

        |  operator  | type |        |         |         |
        |------------|------|--------|---------|---------|
        |            | none | string | integer | numeric |
        | eq         | +    | +      | +       | +       |
        | neq        | +    | +      | +       | +       |
        | like       | -    | +      | -       | -       |
        | nlike      | -    | +      | -       | -       |
        | in         | +    | +      | +       | +       |
        | nin        | +    | +      | +       | +       |
        | gt         | -    | +      | +       | +       |
        | gte        | -    | +      | +       | +       |
        | lt         | -    | +      | +       | +       |
        | lte        | -    | +      | +       | +       |
      example: {"user.age__gt": 18}

    match_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:
          allOf:
          - $ref: '#/components/schemas/account_id'
          description: |
            Account ID.
            > **WARNING** Handler's *account id* will be automaically use for matching filters for requests with limited visibility or requests using dynamic handlers.
        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/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_filter'
        age__lt:
          $ref: '#/components/schemas/age_lt_filter'
        gender:
          $ref: '#/components/schemas/gender_candidate_filter'
        emotions:
          $ref: '#/components/schemas/emotion_filter'
        liveness:
          $ref: '#/components/schemas/liveness_candidate_filter'
        deepfake:
          $ref: '#/components/schemas/deepfake_candidate_filter'
        masks:
          $ref: '#/components/schemas/masks_filter'
        ethnic_groups:
          $ref: '#/components/schemas/ethnicities_candidate_filter'
        face_ids:
          $ref: '#/components/schemas/face_ids'
        user_data:
          $ref: '#/components/schemas/filter_user_data'
        sources:
          $ref: '#/components/schemas/sources'
        stream_ids:
          $ref: '#/components/schemas/stream_ids'
        tags:
          allOf:
            - $ref: '#/components/schemas/tags'
          description: List of tags. Each event from result will contain all of given 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:
          allOf:
            - $ref: '#/components/schemas/geo_position_bbox'
          nullable: true
        track_ids:
          $ref: '#/components/schemas/track_ids'
        apparent_gender:
          $ref: '#/components/schemas/apparent_gender'
        apparent_age__gte:
          $ref: '#/components/schemas/apparent_age__gte'
        apparent_age__lt:
          $ref: '#/components/schemas/apparent_age__lt'
        headwear_states:
          $ref: '#/components/schemas/headwear_states'
        headwear_apparent_colors:
          $ref: '#/components/schemas/headwear_colors'
        sleeve_lengths:
          $ref: '#/components/schemas/sleeve_lengths'
        upper_clothing_colors:
          $ref: '#/components/schemas/upper_clothing_colors'
        lower_garment_colors:
          $ref: '#/components/schemas/lower_garment_colors'
        lower_garment_types:
          $ref: '#/components/schemas/lower_garment_types'
        shoes_apparent_colors:
          $ref: '#/components/schemas/shoes_colors'
        backpack_states:
          $ref: '#/components/schemas/backpack_states'
        meta:
          allOf:
            - $ref: '#/components/schemas/meta'
            - nullable: true
      required: [origin]
      minProperties: 1

    match_candidate_event_filters:
      allOf:
      - $ref: '#/components/schemas/match_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'

    match_candidate_event_filters_for_request:
      allOf:
      - $ref: '#/components/schemas/match_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'

    label:
      type: string
      description: |

                  Label for matching candidates.

                  The label specifies a set of matching results that are received according to the matching filters and parameters.
                  Each relevant result will be assigned a label.
                  Several labels with their matching filters and parameters can be created to specify different sets of matching results.

                  The label is used to distinguish the matching results for further processing in "storage_policy" and "conditional_tags_policy".
                  It is required to specify the corresponding label when setting the "match" filter in these policies.

                  The label is used only during the execution of handler policies.

      example: "good guys"
      maxLength: 36

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

    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 specified for the handler.
        similarity__lte:
          type: number
          maximum: 1
          minimum: 0
          example: 0.90
          description: Upper included bound for the best match by the list.
        similarity__gte:
          type: number
          maximum: 1
          minimum: 0
          example: 0.78
          description: Lower included bound for the best match by the list.
      required: [label]

    match_policy_filters:
      type: object
      properties:
        gender:
          $ref: '#/components/schemas/gender_filter'
        ethnicities:
          $ref: '#/components/schemas/ethnicities_filter'
        age__lt:
          $ref: '#/components/schemas/age_lt_filter'
        age__gte:
          $ref: '#/components/schemas/age_gte_filter'
        liveness:
          $ref: '#/components/schemas/liveness_filter'
        deepfake:
          $ref: '#/components/schemas/deepfake_filter'
      description: Filters for matching are based on the results of the extraction.

    face_matching_descriptor:
      description: Candidate descriptor parameters.
      type: object
      properties:
        descriptor_type:
          description: Candidate descriptor type.
          type: string
          enum: [ 'face' ]
          default: face

    event_matching_descriptor:
      description: Candidate descriptor parameters.
      type: object
      properties:
        descriptor_type:
          description: Candidate descriptor type.
          type: string
          enum: [ 'face', 'body' ]
          default: face

    match_policy_face_without_candidates:
      type: object
      properties:
        label:
          allOf:
            - $ref: '#/components/schemas/label'
          default: ""
        filters:
          $ref: '#/components/schemas/match_policy_filters'
        descriptor:
          $ref: '#/components/schemas/face_matching_descriptor'
        limit:
          $ref: '#/components/schemas/candidate_limit'
        targets:
          $ref: '#/components/schemas/faces_targets'
        threshold:
          $ref: '#/components/schemas/similarity_threshold'
      required: [candidates]

    match_policy_face:
      allOf:
      - $ref: '#/components/schemas/match_policy_face_without_candidates'
      - properties:
          candidates:
            $ref: '#/components/schemas/match_candidate_face_filters'

    match_policy_face_for_request:
      allOf:
      - $ref: '#/components/schemas/match_policy_face_without_candidates'
      - properties:
          candidates:
            $ref: '#/components/schemas/match_candidate_face_filters_for_request'

    match_policy_event_without_candidates:
      type: object
      properties:
        label:
          allOf:
            - $ref: '#/components/schemas/label'
          default: ""
        filters:
          $ref: '#/components/schemas/match_policy_filters'
        descriptor:
          $ref: '#/components/schemas/event_matching_descriptor'
        limit:
          $ref: '#/components/schemas/candidate_limit'
        targets:
          $ref: '#/components/schemas/events_targets'
        threshold:
          $ref: '#/components/schemas/similarity_threshold'
      required: [candidates]

    match_policy_event:
      allOf:
      - $ref: '#/components/schemas/match_policy_event_without_candidates'
      - properties:
          candidates:
            $ref: '#/components/schemas/match_candidate_event_filters'

    match_policy_event_for_request:
      allOf:
      - $ref: '#/components/schemas/match_policy_event_without_candidates'
      - properties:
          candidates:
            $ref: '#/components/schemas/match_candidate_event_filters_for_request'

    match_policy:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/match_policy_face'
          - $ref: '#/components/schemas/match_policy_event'
      minItems: 0
      description: |
        This policy enables you to match the received event descriptor with faces or events according to the specified filters.

        If there are no candidates that correspond filters or the descriptor was not extracted, matching is not performed.

    match_policy_for_request:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/match_policy_face_for_request'
          - $ref: '#/components/schemas/match_policy_event_for_request'
      minItems: 0
      description: |
        This policy enables you to match the received event descriptor with faces or events according to the specified filters.

        If there are no candidates that correspond filters or the descriptor was not extracted, matching is not performed.

    face_storage_policy:
      type: object
      description: Whether to store the face and link it to lists. Is disabled by default.
      properties:
        store_face:
          allOf:
            - $ref: '#/components/schemas/int01'
          description: |
           Whether to store the face.

           *If `extract_basic_attributes` or `extract_face_descriptor` is not set, then no descriptor or basic attributes will be attached to the saved face.*

          default: 0
        filters:
          allOf:
            - $ref: '#/components/schemas/emit_events_filters'
            - description: Filters determine whether to store the face. Only the samples 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.

            *If `store_sample:0` and `set_sample_as_avatar:1`, then the avatar will not be saved.*

          default: 1
        link_to_lists_policy:
          $ref: '#/components/schemas/link_to_lists_policy'

    face_storage_policy_required:
      type: object
      description: Whether to store the face and link it to lists. Is disabled by default.
      properties:
        store_face:
          allOf:
            - $ref: '#/components/schemas/int01'
          description: |
           Whether to store the face.

           *If `extract_basic_attributes` or `extract_face_descriptor` is disabled, then no descriptor or basic attributes will be attached to the saved face.*

          default: 0
        filters:
          allOf:
            - $ref: '#/components/schemas/emit_events_filters'
            - description: Filters determine whether to store the face. Only the samples 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.

            *If `store_sample:0` and `set_sample_as_avatar:1`, then the avatar will not be saved.*

          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. Is enabled by default.
      properties:
        store_sample:
          allOf:
          - $ref: '#/components/schemas/int01'
          - description: Whether to store the face sample.
          - default: 1
        filters:
          allOf:
            - $ref: '#/components/schemas/emit_events_filters'
            - description: Filters determine whether to store the 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. Is disabled by default.
      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_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]

    attribute_storage_policy:
      type: object
      description: Attribute storing policy. Is enabled by default.
      properties:
        store_attribute:
          allOf:
            - $ref: '#/components/schemas/int01'
          description: Whether to store an attribute.
          default: 0
        filters:
          allOf:
            - $ref: '#/components/schemas/emit_events_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. Is enabled by default.
      properties:
        store_event:
          allOf:
          - $ref: '#/components/schemas/int01'
          - description: Whether to store an event.
          - default: 1
        filters:
          allOf:
            - $ref: '#/components/schemas/emit_events_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]

    callback_basic_authorization:
      type: object
      properties:
        type:
          type: string
          description: Authorization type.
          enum: [basic]
        login:
          type: string
          maxLength: 128
          description: Login.
        password:
          type: string
          maxLength: 128
          description: Password.
      required: [ type, login, password]
      description: Callback basic authorization parameters.

    task_http_callback:
      type: object
      properties:
        type:
          type: string
          enum: [http]
        authorization:
          $ref: '#/components/schemas/callback_basic_authorization'
        url:
          type: string
          description: Request URL.
          format: uri-reference
        params:
          type: object
          properties:
            timeout:
              type: integer
              default: 60
              description: Callback request timeout.
            content_type:
              type: string
              default: application/json
              enum: [application/json, application/msgpack]
              description: Callback request content type.
            headers:
              type: object
              description: Callback request headers.
          description: Callback request parameters.
        enable:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: Whether callback enabled or not.
            - default: 1
      required: [ type, url ]

    http_callback:
      allOf:
        - $ref: '#/components/schemas/task_http_callback'
        - properties:
            filters:
              allOf:
                - $ref: '#/components/schemas/emit_events_filters'
                - description: Filters determine whether to send a callback or not. Only the callbacks corresponding to the specified filters will be sent.

    http_callback_required:
      allOf:
        - $ref: '#/components/schemas/http_callback'
        - required: [type, url, params, filters, enable]

    task_callbacks:
      type: array
      items:
        $ref: '#/components/schemas/task_http_callback'
      description: |
        Callbacks for sending tasks id and status to third party system. Callbacks are executed after task status changed.
        
        **Sample Output for successful task**
        ```
        {
          "task_id": 123, 
          "task_status": "done", 
          "result_id": "00000000-0000-4000-a000-000000658854",
          "result_url": "http://127.0.0.1:5000/6/tasks/00000000-0000-4000-a000-000000658854/result"
        }
        ```
        
        **Sample Output for failed task**
        ```
        {"task_id": 123, "task_status": "failed"}
        ```
                
        **Sample Output for cancelled task**
        ```
        {"task_id": 123, "task_status": "cancelled"}
        ```

    subtask_callbacks:
      type: array
      items:
        $ref: '#/components/schemas/task_http_callback'
      description: |
        Callbacks for sending subtasks id, status and number of completed subtasks to third party system.
        Callbacks are executed after task status changed.
        
        ** Sample Output for start subtask **
        ```
        {"subtask_id": 123, "subtask_status": "in_progress", "completed_subtasks": 0}
        ```
        
        ** Sample Output for successful subtask **
        ```
        {"subtask_id": 123, "subtask_status": "done", "completed_subtasks": 1}
        ```
        
        ** Sample Output for failed subtask **
        ```
        {"subtask_id": 123, "subtask_status": "failed", "completed_subtasks": 0}
        ```
                
        ** Sample Output for cancelled subtask **
        ```
        {"subtask_id": 123, "subtask_status": "cancelled", "completed_subtasks": 0}

    callbacks:
      type: array
      items:
        $ref: '#/components/schemas/http_callback'
      description: |
        Callbacks for sending generated events to third party system. Callbacks are executed after all storage policies.
        Events sent using callback have corresponding format with ones from `generate event` resource
        
        **Sample Output**
        ```
        {
          "events": [
            {
              "aggregate_estimations": {
                "body": {
                  "attributes": {}
                },
                "face": {
                  "attributes": {}
                }
              },
              "body_attributes": null,
              "detections": [...],
              "event_id": ...,
              "external_id": "",
              "face": null,
              "face_attributes": {
                "attribute_id": null,
                "basic_attributes": {...},
                "samples": [...],
                "score": ...,
                "url": null
              },
              "location": {...},
              "matches": [...],
              "meta": {...},
              "source": null,
              "stream_id": null,
              "tags": [...],
              "track_id": null,
              "url": "/6/events/...",
              "user_data": ""
            }
          ]
        }
        ```

    callbacks_required:
      allOf:
        - $ref: '#/components/schemas/callbacks'
        - items:
            $ref: '#/components/schemas/http_callback_required'

    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_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 ]

    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
              too large (more than 256 symbols), the service will store the image to Image Store.
          - default: 1
        filters:
          allOf:
          - $ref: '#/components/schemas/emit_events_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]

    link_to_list_object:
      type: object
      properties:
        list_id:
          $ref: '#/components/schemas/list_id'
        filters:
          allOf:
            - $ref: '#/components/schemas/emit_events_filters'
            - description: Filters determine whether to link the stored face to the list.
      required: [list_id]

    link_to_lists_policy:
      type: array
      items:
        $ref: '#/components/schemas/link_to_list_object'
      minItems: 0
      maxItems: 30
      description: |
        The policy specifies filters for linking the attached faces to specified lists. You can specify filters by age, gender, and ethnicity as well as filters by matching results.

        The `extract_basic_attributes` parameter in the `extraction_policy` must be enabled for filtration by basic attributes.

        Matching results must be received in the `match_policy` to use the `match` section of the filters.

    link_to_lists_policy_required:
      type: array
      items:
        allOf:
          - $ref: '#/components/schemas/link_to_list_object'
          - required: [list_id, filters]
      minItems: 0
      maxItems: 30
      description: A set of lists with filters for attaching stored faces.

    tag:
      type: string
      maxLength: 36
      example: "good"
      description: Tag.

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

    conditional_tags_policy:
      type: array
      items:
        $ref: '#/components/schemas/conditional_tag_policy'
      minItems: 0
      description: Event tags for adding to the event according to filters.

    conditional_tags_policy_required:
      type: array
      items:
        allOf:
          - $ref: '#/components/schemas/conditional_tag_policy'
          - required: [tag, filters]
      minItems: 0
      description: Event tags for adding to the event according to filters.

    int_version:
      type: integer
      minimum: 0

    platform_version:
      type: object
      properties:
        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: [major, minor, patch]

    version:
      allOf:
        - properties:
            api:
              allOf:
                - $ref: '#/components/schemas/int_version'
                - description: An API version of service.
        - $ref: '#/components/schemas/platform_version'
        - required: [api, major, minor, patch]
      example:
        api: 1
        major: 0
        minor: 0
        patch: 0

    aggregation_count:
      type: integer
      minimum: 0
      example: 13
      description: Max number of bestshots an attribute estimation is required to be based on.

    probe_count:
      type: integer
      minimum: 0
      description: |
        Minimal number of some feature probe before analytics start event tracking. This parameter is intended to 
        prevent false positives from analytics.

    rate:
      type: object
      properties:
        period:
          type: integer
          minimum: 1
          description: Period length.
        unit:
          type: string
          enum:
            - frame
            - second
          description: Unit for a period calculation (every `n` seconds or every `n` frames).

    roi_int_coordinates:
      type: integer
      minimum: 0
      default: 0
      maximum: 65536
      example: 3327

    roi_float_percent:
      type: number
      format: float
      minimum: 0
      default: 0.0
      maximum: 100.0
      example: 87.4

    roi_float_percent_size:
      type: number
      format: float
      minimum: 0.00001
      maximum: 100.0
      example: 66.4

    roi_abs:
      type: object
      properties:
        x:
          $ref: '#/components/schemas/roi_int_coordinates'
        y:
          $ref: '#/components/schemas/roi_int_coordinates'
        width:
          $ref: '#/components/schemas/roi_int_coordinates'
        height:
          $ref: '#/components/schemas/roi_int_coordinates'
        mode:
          type: string
          enum: [abs]
          example: "abs"
          description: Coordinates and size are set in pixels.
      required: [x, y, width, height, mode]

    roi_percent:
      type: object
      properties:
        x:
          $ref: '#/components/schemas/roi_float_percent'
        y:
          $ref: '#/components/schemas/roi_float_percent'
        width:
          $ref: '#/components/schemas/roi_float_percent_size'
        height:
          $ref: '#/components/schemas/roi_float_percent_size'
        mode:
          type: string
          enum: [ percent ]
          example: "percent"
          description: Coordinates and size are set in percentage.
      required: [x, y, width, height, mode]

    roi:
      oneOf:
        - $ref: '#/components/schemas/roi_abs'
        - $ref: '#/components/schemas/roi_percent'

    image_retain_policy:
      type: object
      properties:
        mimetype:
          type: string
          enum:
            - PNG
            - JPEG
          default: JPEG
          description: image format
        quality:
          allOf:
            - $ref: '#/components/schemas/number01'
            - default: 1
          description: image quality, on a scale from 0 (worst) to 1 (best). Has no effect on `PNG`
        max_size:
          type: integer
          minimum: 0
          default: 640
          description: image max size, in pxl. Neither the width nor the height will exceed this value
      description: Image retain configuration.

    human_tracking_parameters:
      type: object
      properties:
        roi:
          allOf:
            - $ref: '#/components/schemas/roi'
            - description: |
                Region of interest on a frame. Boundaries of the area are described in `x`, `y` coordinates 
                of the top left point and `width`, `height` properties
                **Region must not be any bigger than the original frame**
        probe_count:
          allOf:
            - default: 3
            - $ref: '#/components/schemas/probe_count'
        image_retain_policy:
          $ref: '#/components/schemas/image_retain_policy'
        tracking:
          type: object
          properties:
            detector_type:
              type: string
              enum: [ face, body, human ]
              default: face
              description: |
                Human tracking detector type.

                | detector type | tracking |
                |---------------|----------|
                | face  | based on faces |
                | body  | based on bodies |
                | human | based on both faces and bodies |
                
                **Detector type must be compatible with selected targets**
            body_reid:
              allOf:
                - $ref: '#/components/schemas/int01'
                - default: 0
              description: |
                Whether to use body re-identification.

                ReId feature is used to increase tracking accuracy by merging different tracks of one human. 
                Significantly increases estimation time.
          description: Human tracking configuration.
        face_samples:
          type: object
          properties:
            count:
              allOf:
                - $ref: '#/components/schemas/aggregation_count'
              default: 5
            filters:
              type: object
              properties:
                score:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  default: 0.6
                  description: Detection score threshold.
                head_pitch:
                  allOf:
                    - $ref: '#/components/schemas/int090'
                  default: 15
                  description: Head pitch absolute angle threshold.
                head_roll:
                  allOf:
                    - $ref: '#/components/schemas/int090'
                  default: 15
                  description: Head roll absolute angle threshold.
                head_yaw:
                  allOf:
                    - $ref: '#/components/schemas/int090'
                  default: 15
                  description: Head yaw absolute angle threshold.
              description: Face sample filters.
          description: Configuration for choosing detections for face attributes estimation.
        body_samples:
          type: object
          properties:
            count:
              allOf:
                - $ref: '#/components/schemas/aggregation_count'
              default: 5
            filters:
              type: object
              properties:
                score:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  default: 0.3
                  description: Detection score threshold.
              description: Body sample filters.
          description: Configuration for choosing detections for body attributes estimation

    people_count_parameters:
      type: object
      description: Parameters of the `people_count` video analytics.
      properties:
        roi:
          allOf:
            - $ref: '#/components/schemas/roi'
            - description: |
                Region of interest on a frame. Boundaries of the area are described in `x`, `y` coordinates 
                of the top left point and `width`, `height` properties. 
                **Region must not be any bigger than the original frame.**
        rate:
          allOf:
            - $ref: '#/components/schemas/rate'
            - description: |
                Frame rate parameters.
            - default:
                unit: frame
                period: 10
        probe_count:
          allOf:
          - default: 3
            description: |
              A number of consecutive `people count` estimations where people count more or equal 
              `people_count_threshold` before start `crowd event` generation. This parameter is intended to
              prevent false positives from analytics.
          - $ref: '#/components/schemas/probe_count'
        image_retain_policy:
          $ref: '#/components/schemas/image_retain_policy'
        people_count_threshold:
          type: integer
          minimum: 0
          default: 1
          description: Minimal human count for an analytics event generation.

    rescaled_people_coordinates:
      type: array
      description: People coordinates estimation
      items:
        type: array
        items:
          type: number
        minItems: 2
        maxItems: 2
        description: Human x, y coordinates rescaled to original frame
      example: [[530.0869565217391, 201.7391304347826], [272.69565217391306, 191.30434782608694]]

    people_count_analytics:
      type: object
      properties:
        name:
          type: string
          enum:
            - people_count
          description: analytics name.
        targets:
          type: array
          items:
            type: string
            enum:
              - coordinates
              - overview
          default: []
          description: |
            Estimations to perform on the video. 
            - `overview` to receive aggregated frames overview, 
            - `coordinates` to add `people_coordinates` parameter to frames estimations.
            - An empty list to perform base analysis.
        parameters:
          $ref: '#/components/schemas/people_count_parameters'
      required: [ name ]

    human_tracking_analytics:
      type: object
      properties:
        name:
          type: string
          enum:
            - people_count
            - human_tracking
          description: analytics name.
        targets:
          type: array
          items:
            type: string
            minItems: 1
            enum:
              - face_detection
              - landmarks5
              - head_pose
              - ags
              - warp_quality
              - emotions
              - glasses
              - eyes
              - gaze
              - mouth
              - mask
              - aggregated_liveness
              - aggregated_deepfake
              - aggregated_face_samples
              - aggregated_face_thumbnail
              - aggregated_face_basic_attributes
              - aggregated_face_descriptor
              - body_detection
              - aggregated_body_samples
              - aggregated_body_thumbnail
              - aggregated_body_attributes
              - aggregated_body_descriptor
              - overview
          default: [ face_detection ]
          description: Estimations to perform on the video
        parameters:
          $ref: '#/components/schemas/human_tracking_parameters'
      required: [ name ]

    video_analytics_params:
      type: object
      properties:
        video:
          type: object
          properties:
            url:
              type: string
              example: "https://example.com/"
          required: [ url ]
          description: Video URL.
        analytics:
          type: array
          items:
            discriminator:
              propertyName: name
              mapping:
                people_count: '#/components/schemas/people_count_analytics'
                human_tracking: '#/components/schemas/human_tracking_analytics'
            oneOf:
              - $ref: '#/components/schemas/people_count_analytics'
              - $ref: '#/components/schemas/human_tracking_analytics'
          description: A list of parameters for comprehensive video analytics.
      description: Video URL and a list of parameters required for video analysis.
      required: [ video, analytics ]

    analytic_event_id:
      allOf:
        - $ref: '#/components/schemas/uuid'
        - description: Unique analytic event ID.

    video_segment:
      type: object
      properties:
        start_time_offset:
          type: number
          example: 0.123
          description: Start video segment offset(seconds).
        end_time_offset:
          type: number
          example: 1.234
          description: Eng video segment offset(seconds).
        start_frame_offset:
          type: integer
          example: 15
          description: First frame of segment.
        last_frame_offset:
          type: integer
          example: 35
          description: Last frame of segment.
      required: [start_time_offset, end_time_offset, start_frame_offset, last_frame_offset]

    time_offset:
      type: number
      example: 1.234
      description: frame time offset(seconds)

    frame_offset:
      type: integer
      example: 35
      description: frame number

    people_coordinates:
      type: array
      description: People coordinates estimation
      items:
        type: array
        items:
          type: integer
        minItems: 2
        maxItems: 2
        description: Human x, y coordinates
        example: [64, 128]

    people_count_frame_estimation:
      type: object
      properties:
        people_count:
          type: integer
          minimum: 0
          description: people count on a frame
        time_offset:
          $ref: '#/components/schemas/time_offset'
        frame_offset:
          $ref: '#/components/schemas/frame_offset'
        people_coordinates:
          $ref: '#/components/schemas/people_coordinates'
      required: [people_count, time_offset, frame_offset]

    shot_info:
      type: object
      properties:
        frame_offset:
          $ref: '#/components/schemas/frame_offset'
        time_offset:
          $ref: '#/components/schemas/time_offset'
        image:
          $ref: '#/components/schemas/shot'
      required: [ frame_offset, time_offset, image ]

    shot_info_with_coordinates:
      type: object
      properties:
        frame_offset:
          $ref: '#/components/schemas/frame_offset'
        time_offset:
          $ref: '#/components/schemas/time_offset'
        image:
          $ref: '#/components/schemas/shot'
        people_coordinates:
          $ref: '#/components/schemas/rescaled_people_coordinates'
      required: [frame_offset, time_offset, image, people_coordinates]

    people_count_aggregated_estimation:
      type: object
      properties:
        overview:
          allOf:
            - $ref: '#/components/schemas/shot_info_with_coordinates'
          description: Shot from the video where max people count was detected

    people_count_frame_aggregated:
      type: object
      properties:
        event_id:
          $ref: '#/components/schemas/analytic_event_id'
        max_people_count:
          type: integer
          minimum: 0
          description: max people count during event
        video_segment:
          allOf:
            - $ref: '#/components/schemas/video_segment'
            - description: video segment with event
        frames_estimations:
          type: array
          items:
            $ref: '#/components/schemas/people_count_frame_estimation'
        aggregated_estimations:
          $ref: '#/components/schemas/people_count_aggregated_estimation'
      description: aggregated result for frames assigned to event
      required: [ event_id, max_people_count, video_segment, frames_estimations ]

    people_count_analytics_aggregated:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/people_count_frame_aggregated'
      required: [ events ]

    people_count_analytics_estimation:
      type: object
      properties:
        crowd:
          $ref: '#/components/schemas/people_count_analytics_aggregated'
      required: [crowd]

    people_count_analytics_result:
      type: object
      properties:
        name:
          type: string
          description: video analytics name
          enum:
            - people_count
        result:
          $ref: '#/components/schemas/people_count_analytics_estimation'
      required: [ name, result ]

    people_count_analytics_result_msgpack:
      allOf:
        - properties:
            result:
              properties:
                crowd:
                  properties:
                    events:
                      items:
                        properties:
                          aggregated_estimations:
                            properties:
                              overview:
                                properties:
                                  image:
                                    format: binary
        - $ref: '#/components/schemas/people_count_analytics_result'

    human_tracking_frame_estimation:
      type: object
      properties:
        time_offset:
          $ref: '#/components/schemas/time_offset'
        frame_offset:
          $ref: '#/components/schemas/frame_offset'
        estimated:
          type: object
          description: Track estimations.
          properties:
            face:
              type: object
              nullable: true
              properties:
                detection:
                  $ref: '#/components/schemas/human_track'
                landmarks5:
                  $ref: '#/components/schemas/landmarks5'
                head_pose:
                  $ref: '#/components/schemas/head_pose'
                ags:
                  $ref: '#/components/schemas/number01'
                warp_quality:
                  $ref: '#/components/schemas/quality'
                emotions:
                  $ref: '#/components/schemas/emotions'
                mask:
                  $ref: '#/components/schemas/masks_base'
                glasses:
                  $ref: '#/components/schemas/glasses'
                eyes:
                  $ref: '#/components/schemas/eyes_attributes'
                gaze:
                  $ref: '#/components/schemas/gaze_direction'
                mouth:
                  $ref: '#/components/schemas/mouth_attributes'
            body:
              type: object
              nullable: true
              properties:
                detection:
                  $ref: '#/components/schemas/human_track'
          required: [ face, body ]
      required: [ time_offset, frame_offset, estimated ]

    shot:
      type: string
      format: byte
      description: Shot from a video

    human_tracking_body_attributes:
      description: Human body attributes.
      type: object
      properties:
        upper_body:
          $ref: "#/components/schemas/estimated_upper_body_attributes"
        lower_body:
          $ref: "#/components/schemas/lower_body_attributes_not_nullable"
        basic_attributes:
          $ref: "#/components/schemas/body_basic_attributes_not_nullable"
        accessories:
          $ref: "#/components/schemas/body_accessories_not_nullable"

    human_tracking_descriptor:
      description: SDK descriptor.
      type: object
      properties:
        descriptor:
          $ref: '#/components/schemas/sdk_descriptor'
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Descriptor score (always 1 for body descriptor).
        version:
          type: integer
          description: Descriptor version.

    human_track_aggregated:
      type: object
      description: aggregated analytics result on a track
      properties:
        event_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Unique analytics event ID.
        track_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Unique human track ID.
        video_segment:
          allOf:
            - $ref: '#/components/schemas/video_segment'
            - description: video segment with event
        frames_estimations:
          type: array
          description: track frames estimations
          items:
            $ref: '#/components/schemas/human_tracking_frame_estimation'
        aggregated_estimations:
          type: object
          description: Human aggregated estimations.
          properties:
            face:
              type: object
              nullable: true
              properties:
                samples:
                  type: array
                  items:
                    $ref: '#/components/schemas/shot_info'
                  description: |
                    List of face warps from the video ranked by detection score and used for aggregated estimations
                thumbnail:
                  allOf:
                    - $ref: '#/components/schemas/shot_info'
                  description: Face warp from the video with the best detection score
                descriptor:
                  $ref: '#/components/schemas/human_tracking_descriptor'
                basic_attributes:
                  $ref: "#/components/schemas/basic_attributes"
                liveness:
                  $ref: "#/components/schemas/liveness"
                deepfake:
                  $ref: "#/components/schemas/deepfake"
              description: Face aggregated estimations.
            body:
              type: object
              nullable: true
              properties:
                samples:
                  type: array
                  items:
                    $ref: '#/components/schemas/shot_info'
                  description: |
                    List of body warps from the video ranked by detection score and used for aggregated estimations
                thumbnail:
                  allOf:
                    - $ref: '#/components/schemas/shot_info'
                    - description: Body warp from the video with the best detection score
                descriptor:
                  $ref: '#/components/schemas/human_tracking_descriptor'
                attributes:
                  allOf:
                    - $ref: "#/components/schemas/human_tracking_body_attributes"
                    - required: [ basic_attributes, upper_body, lower_body, accessories ]
              description: Body aggregated estimations.
            overview:
              allOf:
                - $ref: '#/components/schemas/shot_info'
                - properties:
                    detection:
                      type: object
                      properties:
                        face:
                          allOf:
                            - $ref: '#/components/schemas/human_track'
                          nullable: true
                        body:
                          allOf:
                            - $ref: '#/components/schemas/human_track'
                          nullable: true
                      required: [ face, body ]
                  required: [ detection ]
              description: Shot from the video with the best detection score
          required: [ body, face ]
      required: [ event_id, track_id, video_segment, frames_estimations, aggregated_estimations ]

    track_status:
      type: string
      enum:
        - started
        - in_process
        - finished

    human_track:
      type: object
      properties:
        bbox:
          $ref: '#/components/schemas/rect'
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
            - nullable: true
          description: Detection confidence.
            If `score` is `null`, there was actually no detection, but detector expected the object to be within the specified area.
      description: Human detection.
      required: [ bbox, score ]

    human_tracking_aggregated_result:
      type: object
      properties:
        tracking:
          type: object
          properties:
            events:
              type: array
              items:
                $ref: '#/components/schemas/human_track_aggregated'
            track_count:
              type: integer
              minimum: 0
              description: Track count.
          required: [ events, track_count ]
      required: [ tracking ]

    human_tracking_analytics_result:
      type: object
      properties:
        name:
          type: string
          description: video analytics name
          enum:
            - human_tracking
        result:
          $ref: '#/components/schemas/human_tracking_aggregated_result'
      required: [name, result]

    human_tracking_analytics_result_msgpack:
      allOf:
        - properties:
            result:
              properties:
                tracking:
                  properties:
                    events:
                      items:
                        properties:
                          aggregated_estimations:
                            properties:
                              face:
                                properties:
                                  samples:
                                    items:
                                      properties:
                                        image:
                                          format: binary
                                  thumbnail:
                                    properties:
                                      image:
                                        format: binary
                                  descriptor:
                                    properties:
                                      descriptor:
                                        format: binary
                              body:
                                properties:
                                  samples:
                                    items:
                                      properties:
                                        image:
                                          format: binary
                                  thumbnail:
                                    properties:
                                      image:
                                        format: binary
                                  descriptor:
                                    properties:
                                      descriptor:
                                        format: binary
                              overview:
                                properties:
                                  image:
                                    format: binary
        - $ref: '#/components/schemas/human_tracking_analytics_result'

    video_analytics_results:
      type: object
      properties:
        video_data:
          type: object
          description: Video metadata.
          properties:
            frames_count:
              type: integer
              minimum: 0
              description: Frames count.
            frame_rate:
              type: number
              description: Frame rate.
            duration:
              type: number
              description: Video duration.
        analytics:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/people_count_analytics_result'
              - $ref: '#/components/schemas/human_tracking_analytics_result'
      required: [video_data, analytics]

    video_analytics_results_msgpack:
      type: object
      properties:
        video_data:
          type: object
          description: video metadata
          properties:
            frames_count:
              type: integer
              minimum: 0
              description: frames count
            frame_rate:
              type: number
              description: frame rate
            duration:
              type: number
              description: video duration
        analytics:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/people_count_analytics_result_msgpack'
              - $ref: '#/components/schemas/human_tracking_analytics_result_msgpack'
      required: [video_data, analytics]

    plugin_status:
      type: object
      properties:
        name:
          type: string
          description: Plugin name.
        running:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: Whether plugin is running or not.
      required: [name, running]

    plugins:
      type: object
      properties:
        plugins:
          type: array
          items:
            $ref: '#/components/schemas/plugin_status'
      description: List of imported plugins.

    feature_status:
      type: boolean
      description: Platform feature status (true - enabled, false - disabled).

    descriptor_version:
      type: integer
      description: Descriptor version.
      enum: [46, 52, 54, 56, 57, 58, 59, 60, 62, 64]
      example: 56

    body_descriptor_version:
      type: integer
      description: Body descriptor version.
      enum: [102, 103, 104, 105, 106, 107, 110]
      example: 104

    raw_descriptor:
      type: string
      format: byte
      description: Raw descriptor encoded in Base64.
      example: 2xQ2gprbMUePw1s9gw9fvA==

    raw_descriptor_binary:
      type: string
      format: binary
      description: Binary raw descriptor.

    raw_descriptor_base64:
      type: string
      format: byte
      description: Raw descriptor encoded in Base64.

    descriptor_base64:
      oneOf:
        - $ref: '#/components/schemas/descriptor_data'
        - $ref: '#/components/schemas/raw_descriptor_base64'

    descriptor_binary:
      oneOf:
        - $ref: '#/components/schemas/descriptor_data_binary'
        - $ref: '#/components/schemas/sdk_descriptor_binary'

    descriptor_data_ver:
      type: object
      description: Face descriptor and its version.
      properties:
        descriptor:
          $ref: '#/components/schemas/raw_descriptor_base64'
        descriptor_version:
          $ref: '#/components/schemas/descriptor_version'
      required: [descriptor, descriptor_version]


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

    body_descriptor_data:
      type: object
      description: Body descriptor and its version.
      properties:
        descriptor:
          $ref: '#/components/schemas/raw_descriptor'
        version:
          $ref: '#/components/schemas/body_descriptor_version'
      required: [descriptor, version]

    descriptor_data_binary:
      allOf:
        - type: object
          properties:
            descriptor:
              $ref: '#/components/schemas/raw_descriptor_binary'
        - $ref: '#/components/schemas/descriptor_data'

    face_descriptor_data_binary:
      allOf:
        - type: object
          properties:
            descriptor:
              $ref: '#/components/schemas/raw_descriptor_binary'
        - $ref: '#/components/schemas/descriptor_data'

    body_descriptor_data_binary:
      allOf:
        - type: object
          properties:
            descriptor:
              $ref: '#/components/schemas/raw_descriptor_binary'
        - $ref: '#/components/schemas/body_descriptor_data'

    attributes_samples:
      type: array
      items:
        $ref: '#/components/schemas/sample_id'
      minItems: 0
      uniqueItems: true
      description: |
        List of *uniqie* sample IDs which are resources for the estimated attributes.

        > **WARNING**: if the user does not set any attributes samples, faces with such attributes will be skipped during
        the process of updating attributes using new estimation algorithm.
      default: []
      example: [ee4c42b6-23ae-410e-a2aa-a4220e64ba4b, e909cfbe-29d3-44ed-a949-6cb700b89eba]

    face_descriptors_base:
      description: |
        List of descriptors with versions. Each descriptor is aggregated from the provided samples.
      type: array
      minItems: 1

    face_descriptors:
      allOf:
        - $ref: '#/components/schemas/face_descriptors_base'
        - items:
            $ref: '#/components/schemas/descriptor_base64'
          minItems: 1
          example:
            - descriptor: 2xQ2gprbMUePw1s9gw9fvA==
              version: 46
            - descriptor: 1xWqdsdwew32fsdsdw1s9gw9fvA==
              version: 56

    face_descriptors_binary:
      allOf:
        - $ref: '#/components/schemas/face_descriptors_base'
        - items:
            # replaced property:
            $ref: '#/components/schemas/descriptor_binary'

    attribute_with_descriptors_no_account:
      type: object
      properties:
        face_descriptors:
          $ref: '#/components/schemas/face_descriptors'
        face_descriptor_samples:
          $ref: '#/components/schemas/attributes_samples'
      required: [face_descriptors]

    attribute_with_descriptors_no_account_binary:
      type: object
      properties:
        face_descriptors:
          $ref: '#/components/schemas/face_descriptors_binary'
        face_descriptor_samples:
          $ref: '#/components/schemas/attributes_samples'
      required: [face_descriptors]

    basic_attributes_without_defaults:
      type: object
      description: Basic attributes.
      properties:
        age:
          $ref: '#/components/schemas/age'
        gender:
          type: integer
          enum: [0, 1]
          description: Gender, 0 - female, 1 - male.
        ethnicity:
          allOf:
            - $ref: '#/components/schemas/ethnicities_enum'
      required: [age, gender, ethnicity]

    attribute_with_basic_attributes_no_account:
      type: object
      properties:
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes_without_defaults'
        basic_attributes_samples:
          $ref: '#/components/schemas/attributes_samples'
      required: [basic_attributes]

    attribute_with_descriptors_and_basic_attributes_no_account:
      allOf:
        - $ref: '#/components/schemas/attribute_with_basic_attributes_no_account'
        - $ref: '#/components/schemas/attribute_with_descriptors_no_account'

    attribute_with_descriptors_and_basic_attributes_no_account_binary:
      allOf:
        - $ref: '#/components/schemas/attribute_with_basic_attributes_no_account'
        - $ref: '#/components/schemas/attribute_with_descriptors_no_account_binary'

    attribute_with_descriptors_and_basic_attributes:
      allOf:
        - $ref: '#/components/schemas/attribute_with_descriptors_no_account'
        - $ref: '#/components/schemas/attribute_with_basic_attributes_no_account'

    attribute_no_account:
      oneOf:
        - $ref: '#/components/schemas/attribute_with_descriptors_and_basic_attributes_no_account'
        - $ref: '#/components/schemas/attribute_with_basic_attributes_no_account'
        - $ref: '#/components/schemas/attribute_with_descriptors_no_account'

    attribute_no_account_binary:
      oneOf:
        - $ref: '#/components/schemas/attribute_with_descriptors_and_basic_attributes_no_account_binary'
        - $ref: '#/components/schemas/attribute_with_basic_attributes_no_account'
        - $ref: '#/components/schemas/attribute_with_descriptors_no_account_binary'

    created_attribute:
      oneOf:
        - $ref: '#/components/schemas/attribute_with_descriptors_and_basic_attributes'
        - $ref: '#/components/schemas/attribute_with_descriptors_no_account'
        - $ref: '#/components/schemas/attribute_with_basic_attributes_no_account'

    output_face_attribute:
      type: object
      properties:
        attributes:
          type: object
          properties:
            create_time:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/time'
              description: Face attribute create time.
            basic_attributes:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/basic_attributes'
            face_descriptor:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/descriptor_data_ver'
            basic_attributes_samples:
              $ref: '#/components/schemas/attributes_samples'
            face_descriptor_samples:
              $ref: '#/components/schemas/attributes_samples'
      required: [attributes]

    attribute_set_by_attribute_id:
      type: object
      properties:
        attribute_id:
          $ref: '#/components/schemas/attribute_id'
      required: [attribute_id]

    face_attribute:
      oneOf:
        - $ref: '#/components/schemas/attribute_set_by_attribute_id'
        - $ref: '#/components/schemas/attribute_no_account'
      description: |
         Face attributes.

         You can specify attributes for the face using one of several ways:

          - by specifying the attribute ID of a temporary attribute

          - by specifying descriptors and basic attributes (with or without samples)

          - by specifying descriptors (with or without samples)

          - by specifying basic attributes (with or without samples)

          The last three ways are used when you need to create the face using data stored in external storage.

    face_attribute_binary:
      # face_attribute with binary descriptor
      oneOf:
        - $ref: '#/components/schemas/attribute_set_by_attribute_id'
        - $ref: '#/components/schemas/attribute_no_account_binary'
      description: |
         Face attributes.

         You can specify attributes for the face using one of several ways:

          - by specifying the attribute ID of a temporary attribute

          - by specifying descriptors and basic attributes (with or without samples)

          - by specifying descriptors (with or without samples)

          - by specifying basic attributes (with or without samples)

          The last three ways are used when you need to create the face using data stored in external storage.

    output_attribute:
      type: object
      properties:
        basic_attributes:
          allOf:
          - $ref: '#/components/schemas/basic_attributes_without_defaults'
          - description: '`null` if descriptor of the corresponding version was not extracted'
          - nullable: true
        face_descriptor:
          allOf:
          - $ref: '#/components/schemas/raw_descriptor_base64'
          - description: '`null` if descriptor of the corresponding version was not extracted'
          - nullable: true
        face_descriptor_samples:
          $ref: '#/components/schemas/attributes_samples'
        basic_attributes_samples:
          $ref: '#/components/schemas/attributes_samples'
        attribute_id:
          $ref: '#/components/schemas/attribute_id'
        account_id:
          $ref: '#/components/schemas/account_id'
        create_time:
          allOf:
          - $ref: '#/components/schemas/time'
          - description: The attribute create time.

    New_Face_base:
      type: object
      properties:
        external_id:
          $ref: '#/components/schemas/face_external_id'
        user_data:
          $ref: '#/components/schemas/face_user_data'
        avatar:
          $ref: '#/components/schemas/avatar'
        lists:
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          minItems: 1
          description: Lists for linking face with them.
        event_id:
          allOf:
          - description: The event ID associated with the face creation.
          - $ref: '#/components/schemas/event_id'

    New_Face:
      allOf:
        - properties:
            # replaced property:
            attribute:
              $ref: '#/components/schemas/face_attribute'
        - $ref: '#/components/schemas/New_Face_base'

    New_Face_binary:
      allOf:
        - properties:
            # replaced property:
            attribute:
              $ref: '#/components/schemas/face_attribute_binary'
        - $ref: '#/components/schemas/New_Face_base'

    Update_Face:
      type: object
      properties:
        external_id:
          description: User-defined external ID for the face.
          type: string
          maxLength: 36
          example: "14159261415926"
        event_id:
          allOf:
            - $ref: '#/components/schemas/event_id'
            - description: The event ID associated with the face creation.
            - nullable: true
        user_data:
          type: string
          description: User data associated with face.
          example: "face of person"
          maxLength: 128
        avatar:
          $ref: '#/components/schemas/avatar'
      example:
        external_id: 2xQ2gprbMUePw1s9gw9fvA==
        event_id: 'b668c4a5-2191-476e-a261-3b4f9ce2e25e'
        user_data: some_string
        avatar: 'https://upload.wikimedia.org/wikipedia/commons/7/7f/Emma_Watson_2013.jpg'

    faces_to_be_deleted:
      type: object
      properties:
        face_ids:
          type: array
          items:
            $ref: '#/components/schemas/face_id'
          minItems: 1
          description: Comma-separated list of face IDs for removal.
      required: [face_ids]

    xpk_file:
      type: string
      format: byte
      description:  XPK file with descriptors and basic attributes.

    created_attribute_xpk:
      type: object
      properties:
        xpk_file:
          allOf:
          - description: |
              XPK file with descriptors. This part must have valid Content-Type
              header `application/x-vl-xpk`.

              > **WARNING**: basic attributes will be ignored.
          - $ref: '#/components/schemas/xpk_file_binary'
        meta:
          type: object
          properties:
            face_descriptor_samples:
              $ref: '#/components/schemas/attributes_samples'
            basic_attributes_samples:
              $ref: '#/components/schemas/attributes_samples'
          description: This part must have valid Content-Type header `application/json`.
      required: [xpk_file, meta]

    base_face:
      type: object
      properties:
        face_id:
          $ref: '#/components/schemas/face_id'
        external_id:
          $ref: '#/components/schemas/face_external_id'
        user_data:
          $ref: '#/components/schemas/face_user_data'
        avatar:
          $ref: '#/components/schemas/avatar'
        lists:
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          minItems: 0
          description: Comma-separated list of list IDs which contain the face.
        event_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/event_id'
            - description: The event ID associated with the face creation.

    output_face:
      description: Face object.
      allOf:
        - $ref: '#/components/schemas/base_face'
        - properties:
            account_id:
              $ref: '#/components/schemas/account_id'
            create_time:
              allOf:
                - $ref: "#/components/schemas/time"
                - description: Time of the face creation.
      example:
        face_id: "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
        account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
        event_id: "f9687459-986b-406d-9c1f-0d6289be5256"
        user_data: "fox1991"
        create_time: "2018-08-11T09:11:41.674Z"
        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"]

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

    input_event_face:
      description: Face associated with event.
      type: object
      properties:
        face_id:
          $ref: '#/components/schemas/face_id'
        external_id:
          $ref: '#/components/schemas/face_external_id'
        user_data:
          $ref: '#/components/schemas/face_user_data'
        avatar:
          $ref: '#/components/schemas/avatar'
        lists:
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          minItems: 0
          description: Comma-separated list of list IDs which contain the face.
        event_id:
          allOf:
            - $ref: '#/components/schemas/event_id'
          description: The event ID associated with the face creation.
        url:
          type: string
          format: uri-reference
          description: Face location url.
          nullable: true
      required: [face_id]
      example:
        face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6
        event_id: f9687459-986b-406d-9c1f-0d6289be5256
        external_id: 2xQ2gprbMUePw1s9gw9fvA==
        user_data: "fox1991"
        avatar: 'https://st.kp.yandex.net/images/actor_iphone/iphone360_460188.jpg'
        lists: ["429b0e78-4616-426a-b57f-02baa72d638d", "6d037c33-31ec-4d73-b3b3-ec80b09446c2"]
        url: "/6/faces/426542d6-5509-4e5b-8a01-e2abd5c0a8c6"

    get_faces:
      type: object
      properties:
        faces:
          type: array
          items:
            $ref: '#/components/schemas/output_face'
          description: Array of faces.
      example:
        faces:
          - face_id: "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
            account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
            event_id: "f9687459-986b-406d-9c1f-0d6289be5256"
            user_data: "fox1991"
            create_time: "2018-08-11T09:11:41.674Z"
            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"]

    Link:
      type: object
      properties:
        action:
          type: string
          enum:
          - attach
          - detach
          description: Expected action with list and faces.
        face_ids:
          type: array
          items:
            $ref: '#/components/schemas/face_id'
          minItems: 1
          description: Faces to attach or detach to/from list.
      required:
      - action
      - face_ids

    New_List:
      type: object
      properties:
        user_data:
          $ref: '#/components/schemas/list_user_data'

    update_list:
      type: object
      properties:
        user_data:
          type: string
          maxLength: 128
          description: User data associated with list.
          example: "list of good persons"

    List:
      type: object
      description: Lists object.
      properties:
        list_id:
          allOf:
            - $ref: '#/components/schemas/list_id'
            - readOnly: true
        user_data:
          $ref: '#/components/schemas/list_user_data'
        account_id:
          $ref: '#/components/schemas/account_id'
        create_time:
          type: string
          format: date-time
          readOnly: true
          description: List creation time.
        last_update_time:
          type: string
          format: date-time
          readOnly: true
          description: List update time (face was attached or detached, user_data was changed).
      required: [list_id, user_data, account_id, create_time, last_update_time]
      example:
        list_id: "c004aae2-f191-4a1a-9d2a-e5894f8cecbf"
        user_data: "good guys"
        account_id: "c004aae2-f191-4a1a-9d2a-e5894f8cecbf"
        create_time: "2018-08-11T09:11:41.674Z"
        last_update_time: "2018-08-11T09:11:41.674Z"

    get_lists:
      type: object
      properties:
        lists:
          type: array
          items:
            $ref: '#/components/schemas/List'
          description: Array with nested list.
      example:
        lists:
          - list_id: "c004aae2-f191-4a1a-9d2a-e5894f8cecbf"
            user_data: "good guys"
            account_id: "c004aae2-f191-4a1a-9d2a-e5894f8cecbf"
            create_time: "2018-08-11T09:11:41.674Z"
            last_update_time: "2018-08-11T09:11:41.674Z"

          - list_id: "a30f4c1d-976e-439b-82ce-16b99779f906"
            account_id: "c004aae2-f191-4a1a-9d2a-e5894f8cecbf"
            user_data: ""
            create_time: "2021-06-18T21:50:40.953301+03:00"
            last_update_time: "2021-06-18T21:50:40.953301+03:00"

    emit_events_filters:
      allOf:
        - $ref: '#/components/schemas/match_policy_filters'
        - properties:
            match:
              type: array
              items:
                $ref: '#/components/schemas/match_filter'
              minItems: 0
              description: |
                Filtering using matching results, received in the `match_policy`.

                If there are no matching results for any event, the event is skipped.

                You can specify several lists with similarity boundaries. All the events with similarity within the specified boundaries are processed by the policy.

    storage_policy:
      description: Objects storage policy.
      type: object
      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'
        callbacks:
          $ref: '#/components/schemas/callbacks'

    storage_policy_required:
      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'
        callbacks:
          $ref: '#/components/schemas/callbacks_required'
      required: [face_sample_policy, body_sample_policy, attribute_policy, face_policy, event_policy,
                 image_origin_policy, notification_policy, callbacks]

    Policies:
      type: object
      description: |
        The set of rules, which determine input images processing.
        The absence of policies indicates that the handler is dynamic.
      properties:
        detect_policy:
          $ref: '#/components/schemas/detect_policy'
        extract_policy:
          allOf:
            - description: Extract attributes policy.
            - $ref: '#/components/schemas/extract_policy'
        match_policy:
          $ref: '#/components/schemas/match_policy_for_request'
        storage_policy:
          $ref: '#/components/schemas/storage_policy'
        conditional_tags_policy:
          $ref: '#/components/schemas/conditional_tags_policy'

    PoliciesWithRequired:
      type: object
      description: |
        The set of rules, which determine input images processing.
        The absence of policies indicates that the handler is dynamic.
      properties:
        detect_policy:
          allOf:
            - $ref: '#/components/schemas/detect_policy_required'
            - description: Face detection policy.
        extract_policy:
          allOf:
            - $ref: '#/components/schemas/extract_policy_required'
            - description: Extract attributes policy.
        match_policy:
          $ref: '#/components/schemas/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:
        policies:
          $ref: '#/components/schemas/Policies'
      required: [policies]

    New_Handler:
      type: object
      properties:
        description:
          type: string
          maxLength: 128
          description: |
            Description of the handler. Use it to distinguish the handler from other
            created handlers and filter handlers using ["get handlers"](#operation/getHandlers) and
            ["get handler count"](#operation/getHandlerCount) requests.
          example: Handler example
        policies:
          $ref: '#/components/schemas/Policies'
        handler_type:
          $ref: '#/components/schemas/handler_type'
        is_dynamic:
          $ref: '#/components/schemas/is_dynamic'
        lambda_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: Lambda 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.
        handler_type:
          $ref: '#/components/schemas/handler_type'
        is_dynamic:
          $ref: '#/components/schemas/is_dynamic'
      required: [handler_id, account_id, description, create_time, last_update_time, policies, handler_type]

    body_basic_attributes:
      type: object
      description: Body basic attributes.
      properties:
        apparent_age:
          type: integer
          maximum: 100
          minimum: 0
          example: 33
          description: Apparent age.
        apparent_gender:
          type: integer
          enum: [ 0, 1, 2 ]
          example: 1
          description: Apparent gender (0 - female, 1 - male, 2 - undefined).
      required: [ apparent_age, apparent_gender ]

    body_basic_attributes_not_nullable:
      allOf:
        - $ref: "#/components/schemas/body_basic_attributes"
      nullable: false

    upper_body_attributes:
      type: object
      description: Upper body attributes.
      properties:
        headwear:
          type: object
          properties:
            state:
              type: integer
              enum: [ 0, 1, 2 ]
              example: 1
              description: Headwear state (0 - absent, 1 - present, 2 - undefined).
            apparent_color:
              $ref: '#/components/schemas/headwear_color'
          required: [ state, apparent_color ]
          description: Headwear attributes.
        sleeve:
          type: object
          properties:
            length:
              type: string
              enum: [ short, long, undefined ]
              example: long
              description: Sleeve length.
          required: [ length ]
          description: Sleeve attributes.
        upper_clothing:
          type: object
          properties:
            colors:
              type: array
              items:
                $ref: '#/components/schemas/clothing_color'
              example: [ black, white ]
              description: |
                Upper clothing color set.
                > **WARNING** This enum can be expanded. Each item must be interpret as arbitrary string which can be equal to one element from enum.
          required: [ colors ]
          description: Upper clothing attributes.
      required: [ headwear, sleeve, upper_clothing ]

    estimated_upper_body_attributes:
      allOf:
        - $ref: "#/components/schemas/upper_body_attributes"
        - properties:
            headwear:
              required: [ state, apparent_color ]
      nullable: false

    lower_body_attributes:
      type: object
      description: Lower body attributes.
      properties:
        lower_garment:
          type: object
          properties:
            type:
              $ref: '#/components/schemas/lower_garment_type'
            colors:
              type: array
              items:
                $ref: '#/components/schemas/clothing_color'
              example: [ black, white ]
              description: |
                Lower clothing color set.
                > **WARNING** This enum can be expanded. Each item must be interpret as arbitrary string which can be equal to one element from enum.
          required: [ type, colors ]
          description: Lower clothing attibutes.
        shoes:
          type: object
          properties:
            apparent_color:
              $ref: '#/components/schemas/shoes_color'
          required: [ apparent_color ]
          description: Shoes attributes.
      required: [ lower_garment, shoes ]

    lower_body_attributes_not_nullable:
      allOf:
        - $ref: "#/components/schemas/lower_body_attributes"
      nullable: false

    body_accessories:
      type: object
      description: Body accessories.
      properties:
        backpack:
          type: object
          properties:
            state:
              type: integer
              enum: [ 0, 1, 2 ]
              example: 1
              description: Backpack state (0 - absent, 1 - present, 2 - undefined).
          description: Backpack attributes.
          required: [ state ]
      required: [ backpack ]

    body_accessories_not_nullable:
      allOf:
        - $ref: "#/components/schemas/body_accessories"
      nullable: false

    base_event_aggregate_estimations:
      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"
                deepfake:
                  $ref: "#/components/schemas/deepfake"
                mask:
                  $ref: '#/components/schemas/base_masks_estimation'
                emotions:
                  $ref: '#/components/schemas/emotions'
          required: [attributes]
        body:
          type: object
          description: Aggregated body estimations.
          properties:
            attributes:
              type: object
              description: Body extra attributes.
              properties:
                basic_attributes:
                  $ref: "#/components/schemas/body_basic_attributes"
                upper_body:
                  $ref: "#/components/schemas/upper_body_attributes"
                lower_body:
                  $ref: '#/components/schemas/lower_body_attributes'
                accessories:
                  $ref: "#/components/schemas/body_accessories"
          required: [ attributes ]
      required: [ face, body ]

    event_aggregate_estimations:
      allOf:
      - $ref: "#/components/schemas/base_event_aggregate_estimations"
      - properties:
          face:
            properties:
              attributes:
                properties:
                  mask:
                    $ref: "#/components/schemas/masks_estimation"

    input_event_aggregate_estimations:
      allOf:
        - $ref: "#/components/schemas/base_event_aggregate_estimations"
        - properties:
            face:
              properties:
                attributes:
                  mask:
                    $ref: '#/components/schemas/input_masks_estimation'

    event_from_handler:
      type: object
      description: Event format from handler.
      properties:
        face_attributes:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/Attribute'
          description: Face attributes extracted from samples.
        aggregate_estimations:
          $ref: '#/components/schemas/event_aggregate_estimations'
        body_attributes:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/BodyAttribute'
          description: Body attributes extracted from samples.
        source:
          type: string
          description: Additional information that the user provided with the event.
          nullable: true
          example: "Main_hall_camera"
        stream_id:
          allOf:
           - $ref: '#/components/schemas/stream_id'
           - nullable: true
        tags:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/tags'
        external_id:
          $ref: '#/components/schemas/event_external_id'
        user_data:
          $ref: '#/components/schemas/event_user_data'
        face:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/output_event_face'
        event_id:
          $ref: '#/components/schemas/event_id'
        url:
          type: string
          format: uri-reference
          nullable: true
          description: Location of event, `null` if event was not stored.
          example: /6/events/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
        matches:
          $ref: '#/components/schemas/matches'
        location:
          $ref: '#/components/schemas/location'
        detections:
          description: List of body and face related detections.
          type: array
          items:
            type: object
            properties:
              filename:
                $ref: '#/components/schemas/filename'
              samples:
                type: object
                description: |
                  Samples related to the body and face that refer to the same 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,
                  except for [stream events](#operation/generateStreamEvents)
                properties:
                  body:
                    allOf:
                      - nullable: true
                      - $ref: '#/components/schemas/body_detection_sample'
                  face:
                    allOf:
                      - nullable: true
                      - $ref: '#/components/schemas/face_detection_sample'
                required: [body, face]
              detect_time:
                $ref: "#/components/schemas/detect_time"
              detect_ts:
                $ref: "#/components/schemas/detect_ts"
              image_origin:
                $ref: "#/components/schemas/image_origin"
            required: [filename, samples, detect_time, image_origin, detect_ts]
        track_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/track_id'
        meta:
          allOf:
            - $ref: "#/components/schemas/event_meta_common"
          nullable: true
      required: [matches, url, event_id, face, tags, source, stream_id, face_attributes, aggregate_estimations, body_attributes,
                 location, user_data, external_id, detections, track_id, meta]

    image_detection_status:
      type: integer
      enum: [0, 1]
      description: Image status. 0 - detection failed, 1 - detection succeeded.

    images:
      type: array
      items:
        type: object
        description: Image.
        properties:
          filename:
            allOf:
            - $ref: '#/components/schemas/filename'
            description: Source image file name.
          status:
            $ref: '#/components/schemas/image_detection_status'
          error:
            $ref: '#/components/schemas/Error'
          exif:
            $ref: '#/components/schemas/exif'
          image_estimations:
            type: object
            description: Image estimations.
            properties:
              people:
                type: object
                properties:
                  count:
                    type: integer
                    description: |
                      People count estimation. As an approximate value, it may differ from a face and body detection count per image for images with a lot of people.
                      See the [Crowd Estimation](https://docs.visionlabs.ai/sdk/latest/) section in the LUNA SDK documentation.
                  coordinates:
                    allOf:
                      - $ref: '#/components/schemas/people_coordinates'
                    nullable: true
        required: [filename, status, error]

    detection_filter_reason:
      type: object
      properties:
        filter_name:
          type: string
          enum: ['pitch_threshold', 'roll_threshold', 'yaw_threshold', 'score_threshold', 'mask_states', 'liveness_states',
                 'deepfake_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',
                 'background_lightness', 'background_uniformity', 'shoulders_position']
          description: |
            Filter name. For resource */detector* available values are: 'pitch_threshold', 'roll_threshold',
            'yaw_threshold', For resource  */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.
                nullable: true
              max:
                type: number
                description: Maximum allowed value.
                nullable: true

      required:
      - filter_name
      - object_value
      - threshold_value

    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'
                    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/event_from_handler'
        images:
          $ref: '#/components/schemas/images'
        filtered_detections:
          $ref: '#/components/schemas/event_filtered_detections'
      required: [events, images, filtered_detections]

    Source:
      description: Additional information that the user provided with the event.
      type: string
      example: "Main_hall_camera"

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

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

    event:
      type: object
      description: Event.
      properties:
        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.
        event_id:
          $ref: '#/components/schemas/event_id'
        handler_id:
          allOf:
            - $ref: '#/components/schemas/handler_id'
          description: ID of the handler that raised the event.
        account_id:
          $ref: '#/components/schemas/account_id'
        external_id:
          $ref: '#/components/schemas/event_external_id'
        source:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/Source'
        stream_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/stream_id'
        top_match:
          nullable: true
          oneOf:
            - $ref: '#/components/schemas/top_match_face'
            - $ref: '#/components/schemas/top_match_event'
        match_result:
          type: array
          items:
            type: object
            properties:
              candidates:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/match_candidates_face_in_event_candidates_in_target_match_result'
                    - $ref: '#/components/schemas/match_candidates_events_in_event_candidates_in_target_match_result'
                minItems: 0
              label:
                $ref: '#/components/schemas/label'
            required: [ candidates, label ]
          nullable: true
        face_detections:
          description: List of all face detection and corresponding sample IDs.
          type: array
          nullable: true
          items:
            type: object
            properties:
              sample_id:
                allOf:
                - nullable: true
                - $ref: '#/components/schemas/sample_id'
              detection:
                type: object
                description: Detection.
                properties:
                  rect:
                    $ref: '#/components/schemas/rect'
                required: [rect]
              detect_time:
                $ref: '#/components/schemas/detect_time'
              detect_ts:
                $ref: '#/components/schemas/detect_ts'
              image_origin:
                $ref: '#/components/schemas/image_origin'
            required: [sample_id, detect_time, image_origin, detect_ts]
        body_detections:
          description: List of all body detection and corresponding sample IDs.
          type: array
          nullable: true
          items:
            type: object
            properties:
              sample_id:
                allOf:
                - nullable: true
                - $ref: '#/components/schemas/sample_id'
              detection:
                type: object
                description: Detection.
                properties:
                  rect:
                    $ref: '#/components/schemas/rect'
                required: [rect]
              detect_time:
                $ref: '#/components/schemas/detect_time'
              detect_ts:
                $ref: '#/components/schemas/detect_ts'
              image_origin:
                $ref: '#/components/schemas/image_origin'
            required: [sample_id, detect_time, image_origin, detect_ts]
        face_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/face_id'
        attach_result:
          description: Contains attached lists IDs.
          type: array
          items:
            $ref: '#/components/schemas/list_id'
          minItems: 0
        gender:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/gender'
        age:
          description: Age.
          type: integer
          nullable: true
          maximum: 100
          minimum: 0
        emotion:
          $ref: '#/components/schemas/emotion_enum_nullable'
        mask:
          $ref: '#/components/schemas/mask_enum_nullable'
        ethnic_group:
          $ref: '#/components/schemas/ethnicities_enum_nullable'
        liveness:
          $ref: '#/components/schemas/liveness_state_nullable'
        deepfake:
          $ref: '#/components/schemas/deepfake_state_nullable'
        tags:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/tags'
        user_data:
          $ref: '#/components/schemas/event_user_data'
        meta:
          allOf:
            - $ref: "#/components/schemas/event_meta_common"
          nullable: true
        location:
          allOf:
            - $ref: '#/components/schemas/location'
            - required: [city, area, district, street, house_number, geo_position]
        track_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/track_id'
        body_basic_attributes:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/body_basic_attributes'
        upper_body:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/upper_body_attributes'
            - properties:
                headwear:
                  properties:
                    apparent_color:
                      nullable: True
        lower_body:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/lower_body_attributes'
        accessories:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/body_accessories'

    event_list:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/event'
          maxItems: 1000

    get_event_stats:
      type: object
      properties:
        targets:
          $ref: '#/components/schemas/targets'
        filters:
          $ref: '#/components/schemas/filters'
        period:
          $ref: '#/components/schemas/periods'
        group_by:
          $ref: '#/components/schemas/group_by'

    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. Always 1 now.
        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]

    base_attributes_without_liveness:
      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/base_masks_estimation'
        head_pose:
          allOf:
          - $ref: '#/components/schemas/head_pose'
          - description: Head pose estimation.
        gaze:
          allOf:
          - $ref: '#/components/schemas/gaze_direction'
          - description: Gaze direction estimation.
        glasses:
          $ref: '#/components/schemas/glasses'
      example:
        mouth_attributes:
          occluded: 0.0
          score: 0.999999165534973
          smile: 0.0
        mask:
          estimations:
            medical_mask: 0.7108324766
            missing: 0.0700698048
            occluded: 0.2190976739
          predominant_mask: medical_mask
          face_occlusion:
            predominant_occlusion: correct
            estimations:
              full: 0.019
              clear: 0.02
              correct: 0.6108324766
              partially: 0.310
              mouth: 0.0209
              chin: 0.019097
        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"
        head_pose:
          pitch: 18.6827487945557
          roll: -10.3542232513428
          yaw: 15.4102487564087
        gaze:
          pitch: 9.26744079589844
          yaw: -19.4657287597656
        glasses:
          glasses: no_glasses

    base_attributes:
      allOf:
        - $ref: '#/components/schemas/base_attributes_without_liveness'
        - properties:
            liveness:
              $ref: '#/components/schemas/liveness_result'
            deepfake:
              $ref: '#/components/schemas/deepfake_result'

    attributes:
      allOf:
        - $ref: '#/components/schemas/base_attributes'
        - properties:
            mask:
              $ref: '#/components/schemas/masks_estimation'

    rect:
      type: object
      description: Bounding box.
      properties:
        height:
          type: integer
          description: Bounding box height.
          example: 200
        width:
          type: integer
          description: Bounding box 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 underexposed face area (i.e. due to backlight, poor lighting, sensor underexposure).
        light:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Low value means overexposed face area (i.e. overbright lighting, sensor overexposure).
        illumination:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Illumination uniformity corresponds to the face illumination in the image. The lower the difference between light and dark zones of the face, the higher the estimated value. Low value means illumination nonuniformity.
        specularity:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Specularity is the face possibility to reflect light. The higher the estimated value, the lower the specularity, and the better the image quality. 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
      default: 0
      enum:
      - 0
      - 1

    extractor_filter:
      type: object
      properties:
        is_filtered:
          type: boolean
          description: True if sample is filtered by a threshold otherwise false.
        filter_reasons:
          type: array
          description: Filtration reason array.
          items:
            type: object
            properties:
              filter_name:
                type: string
                enum: ['score_threshold']
                description: Filter name.
              object_value:
                example: 0.75
                type: number
                description: Estimated parameter value.
              threshold_value:
                example: 0.8
                type: number
                description: Current threshold value.
            required:
              - filter_name
              - object_value
              - threshold_value
      description: Extractor filters.

    exif:
      description: |
        Select image EXIF tags.
        See [CIPA DC-008-2016]( http://www.cipa.jp) 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
          properties:
            latitude:
              type: string
              description: |
                GPSLatitude tag (IFD GPS).

                GPSLatitudeRef tag (0x0001) + GPSLatitude tag (0x0002).
            longitude:
              type: string
              description: |
                GPSLongitude tag (IFD GPS).

                GPSLongitudeRef tag (0x0003) + GPSLongitude tag (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:
        make: Apple
        model: iPhone 11
        gps:
          latitude: 55.0, 45.0, 18.29
          longitude: 37.0, 39.0, 16.32
        software: 13.6.1
        orientation: 6

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

    face_detection_sample:
      allOf:
        - $ref: '#/components/schemas/face_detection_sample_base'
        - properties:
            detection:
              $ref: '#/components/schemas/face_detection'
      required:
        - detection

    detector_face_detection_sample:
      allOf:
        - $ref: '#/components/schemas/face_detection_sample_base'
        - properties:
            detection:
              $ref: '#/components/schemas/detector_face_detection'
      required:
        - detection

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

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

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


    face_detection_base:
      type: object
      description: Face detection.
      properties:
        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.

    base_face_detection:
      allOf:
        - $ref: '#/components/schemas/face_detection_base'
        - properties:
            attributes:
              allOf:
                - $ref: '#/components/schemas/base_attributes'
                - description: Face attributes estimation.

    detector_base_face_detection:
      allOf:
        - $ref: '#/components/schemas/face_detection_base'
        - properties:
            attributes:
              allOf:
                - $ref: '#/components/schemas/base_attributes_without_liveness'
                - description: Face attributes estimation.


    face_detection:
      allOf:
      - $ref: '#/components/schemas/base_face_detection'
      - properties:
          attributes:
            properties:
              mask:
                $ref: '#/components/schemas/masks_estimation'
          face_quality:
            allOf:
            - $ref: '#/components/schemas/face_quality_checks_estimations'
            description: Face quality checks estimations.

    detector_face_detection:
      allOf:
      - $ref: '#/components/schemas/detector_base_face_detection'
      - properties:
          attributes:
            properties:
              mask:
                $ref: '#/components/schemas/masks_estimation'
          face_quality:
            allOf:
            - $ref: '#/components/schemas/face_quality_checks_estimations'
            description: Face quality checks estimations.

    face_quality_checks_request:
      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_request'
          - $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'
          - $ref: '#/components/schemas/background_uniformity'
          - $ref: '#/components/schemas/background_lightness'
          - $ref: '#/components/schemas/shoulders_position_status'
      minItems: 0
      maxItems: 44
      uniqueItems: true

    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'
          - $ref: '#/components/schemas/background_uniformity'
          - $ref: '#/components/schemas/background_lightness'
          - $ref: '#/components/schemas/shoulders_position_status'
      minItems: 0
      maxItems: 44
      uniqueItems: true

    input_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_request'
      required: [ status, checks ]

    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 ]

    input_face_detection:
      allOf:
        - $ref: '#/components/schemas/base_face_detection'
        - properties:
            face_quality:
              allOf:
              - $ref: '#/components/schemas/input_face_quality_checks_estimations'
              description: Face quality checks estimations.

    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/detector_face_detection'
            required: [filter_reasons, detection]
      required: [face_detections]

    verification_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
                    description: Filtered sample.
                    properties:
                      detection:
                        $ref: '#/components/schemas/face_detection'
                    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 the error
        is contained in field `error`.
        `Success` means that the 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:
          $ref: '#/components/schemas/Error'
        exif:
          $ref: '#/components/schemas/exif'
      required: [filename, status, error]
      example:
        filename: "penelope.jpeg"
        status: 1
        error:
          error_code: 0
          desc: "Success"
          detail: "Success"
          link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"

    detector_samples:
      type: object
      properties:
        face:
          allOf:
          - $ref: '#/components/schemas/detector_face_detection_sample'
          - description: Face detection.
      description: Only face sample now.

    detector_detections:
      description: |
        All detections in image which are separated on samples (entity for following a descriptor extraction) and
        filtered detections (it is debug information).
      type: object
      properties:
        samples:
          type: array
          items:
            $ref: '#/components/schemas/detector_samples'
          description: Detections list which satisfy filters criteria.
        filtered_detections:
          $ref: '#/components/schemas/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

    predominant_ethnicity:
      type: string
      enum: [african_american, asian, caucasian, indian]
      description: The most likely ethnicity state.

    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]

    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: The most likely mask state.

    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]

    masks_base:
      type: object
      description: Estimated face mask state.
      properties:
        estimations:
          $ref: '#/components/schemas/mask_estimations'
        predominant_mask:
          $ref: '#/components/schemas/mask_predominant'
        face_occlusion:
          type: object
          description: Estimated face occlusion.
          properties:
            predominant_occlusion:
              type: string
              enum: ["full", "clear", "correct", "partially", "mouth", "chin"]
              description: The most likely face occlusion state.
            estimations:
              type: object
              description: Raw face occlusion estimations scores.
              properties:
                full:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  description: The probability that the mask occlude whole face.
                clear:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  description: The probability that the mask absent.
                correct:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  description: The probability that the mask is put on correctly.
                partially:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  description: The probability that the mask is put on partially correct.
                mouth:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  description: The probability that the mask is put on mouth only.
                chin:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                  description: The probability that the mask is put on chin only.
              required: [full, clear, correct, partially, mouth, chin]
          required: [predominant_occlusion, estimations]
      example:
        mask:
          estimations:
            medical_mask: 0.7108324766
            missing: 0.0700698048
            occluded: 0.2190976739
          predominant_mask: "medical_mask"
          face_occlusion:
            predominant_occlusion: "correct"
            estimations:
              full: 0.1
              correct: 0.25
              clear: 0.05
              mouth: 0.2
              partially: 0.2
              chin: 0.2

    basic_attributes:
      type: object
      description: Basic attributes.
      properties:
        age:
          $ref: '#/components/schemas/age'
        gender:
          allOf:
            - $ref: '#/components/schemas/gender'
            - example: 1
        ethnicity:
          allOf:
            - $ref: '#/components/schemas/ethnicities_enum'
      required: [age, gender, ethnicity]

    basic_attribute_with_estimations:
      type: object
      description: Basic attributes.
      properties:
        age:
          $ref: '#/components/schemas/age'
        gender:
          allOf:
            - $ref: '#/components/schemas/gender'
            - example: 1
        ethnicities:
          type: object
          description: Ethnicities estimations.
          properties:
            predominant_ethnicity:
              $ref: '#/components/schemas/predominant_ethnicity'
            estimations:
              $ref: '#/components/schemas/ethnicities_estimations'
          required: [estimations, predominant_ethnicity]
      required: [age, gender, ethnicities]

    Attribute:
      type: object
      properties:
        attribute_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/attribute_id'
            - description: Attribute ID. The value is set to `null` if the descriptor score is lower than the score threshold.
        basic_attributes:
          $ref: '#/components/schemas/basic_attribute_with_estimations'
        score:
          type: number
          minimum: 0
          maximum: 1
          description: Face descriptor quality score.
        url:
          type: string
          format: uri-reference
          example: /6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34
          description: Location of attributes, `null` if attribute was not stored.
          nullable: true
        samples:
          type: array
          items:
            allOf:
              - nullable: true
              - $ref: '#/components/schemas/sample_id'
          minItems: 0
          example: ['a3e8716f-70dc-42ad-8428-7a552e800a37']
          description: Resources for attributes.
        filter:
          $ref: '#/components/schemas/extractor_filter'
      required: [attribute_id, url, samples]

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

      required: [samples]

    Extracted_Attributes:
      type: array
      items:
        allOf:
        - $ref: '#/components/schemas/Attribute'
        - properties:
            external_url:
              allOf:
              - $ref: '#/components/schemas/external_url'
              nullable: true

    reference:
      type: object
      description: Reference for matching.
      properties:
        type:
          description: Type of reference.
        id:
          description: Reference ID.
      required: [id, type]

    face_reference:
      allOf:
        - $ref: '#/components/schemas/reference'
        - properties:
            type:
              type: string
              enum:
              - face
            id:
              $ref: '#/components/schemas/face_id'

    event_reference:
      allOf:
        - $ref: '#/components/schemas/reference'
        - properties:
            type:
              type: string
              enum:
              - event
            id:
              $ref: '#/components/schemas/event_id'

    attribute_reference:
      allOf:
        - $ref: '#/components/schemas/reference'
        - properties:
            type:
              enum:
              - attribute
            id:
              allOf:
              - $ref: '#/components/schemas/attribute_id'

    external_face_reference:
      allOf:
        - $ref: '#/components/schemas/reference'
        - properties:
            type:
              type: string
              enum:
              - face_external_id
            id:
              $ref: '#/components/schemas/face_external_id'

    external_event_reference:
      allOf:
        - $ref: '#/components/schemas/reference'
        - properties:
            type:
              type: string
              enum: ["event_external_id"]
            id:
              $ref: '#/components/schemas/event_external_id'

    track_event_reference:
      allOf:
        - $ref: '#/components/schemas/reference'
        - properties:
            type:
              type: string
              enum: ["event_track_id"]
            id:
              $ref: '#/components/schemas/track_id'

    targets_faces_match:
      type: array
      items:
        type: string
        enum: ["face_id", "account_id", "event_id", "user_data", "create_time", "external_id", "avatar", "lists",
               "similarity"]
      description: |
        List of face fields.
        If set, each face from result will contain only specified fields, otherwise, faces with all fields will be returned.

    targets_events_match:
      type: array
      items:
        type: string
        enum: ["event_id", "account_id", "create_time", "end_time", "external_id", "handler_id", "stream_id", "source",
               "top_match", "match_result", "face_detections", "face_id", "attach_result", "gender", "age", "emotion",
               "mask", "ethnic_group", "tags", "user_data", "location", "liveness", "deepfake", "track_id",
               "body_basic_attributes", "upper_body", "lower_body", "accessories", "similarity", "meta"]
      description: |
        List of event fields.
        If set, each event from result will contain only specified fields, otherwise, events with all fields will be returned.

    faces_targets:
      type: array
      items:
        type: string
        enum: ["face_id", "account_id", "event_id", "user_data", "create_time", "external_id", "avatar", "lists"]
      description: |
        List of face fields.
        If set, each face from result will contain only specified fields, otherwise, faces with all fields will be returned.

    events_targets:
      type: array
      items:
        type: string
        enum: ["event_id", "account_id", "create_time", "end_time", "external_id", "handler_id", "stream_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", "deepfake", "track_id",
               "body_basic_attributes", "upper_body", "lower_body", "accessories", "meta"]
      description: |
        List of event fields.
        If set, each event from result will contain only specified fields, otherwise, events with all fields will be returned.

    targets_attributes:
      type: array
      items:
        type: string
        enum: ["attribute_id", "account_id", "basic_attributes", "basic_attributes_samples", "face_descriptor_samples", "create_time", "similarity"]
      description: |
        List of temporary attributes fields.

        If set, each attribute from result will contain only specified fields, otherwise, attribute with all fields will be returned.

        The default targets are: `"attribute_id", "account_id", "basic_attributes", "basic_attributes_samples", "face_descriptor_samples", "create_time", "similarity"`

    candidate_sort_order:
      type: string
      enum: [ similarity, create_time_asc, create_time_desc ]
      description: Matching sort order.
      default: similarity

    candidate_limit:
      type: integer
      minimum: 1
      default: 3
      maximum: 100
      description: Maximum count of match candidates in result.

    candidate_face:
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/match_candidate_face_filters'
        order:
          $ref: '#/components/schemas/candidate_sort_order'
        limit:
          $ref: '#/components/schemas/candidate_limit'
        targets:
          $ref: '#/components/schemas/targets_faces_match'
        threshold:
          $ref: '#/components/schemas/similarity_threshold'
      required: [filters]

    candidate_event:
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/match_candidate_event_filters'
        order:
          $ref: '#/components/schemas/candidate_sort_order'
        limit:
          $ref: '#/components/schemas/candidate_limit'
        targets:
          $ref: '#/components/schemas/targets_events_match'
        threshold:
          $ref: '#/components/schemas/similarity_threshold'
      required: [filters]

    attribute_ids:
      type: array
      items:
        $ref: '#/components/schemas/attribute_id'
      description: List of attribute IDs.
      minItems: 1

    attribute_filters:
      type: object
      description: Candidate filters for temporary attribute.
      properties:
        origin:
          type: string
          enum: ["attributes"]
          description: Filters type discriminator.
        account_id:
          $ref: '#/components/schemas/account_id'
        attribute_ids:
          $ref: '#/components/schemas/attribute_ids'
      required: [origin, attribute_ids]

    candidate_attribute:
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/attribute_filters'
        order:
          $ref: '#/components/schemas/candidate_sort_order'
        limit:
          $ref: '#/components/schemas/candidate_limit'
        targets:
          $ref: '#/components/schemas/targets_attributes'
        threshold:
          $ref: '#/components/schemas/similarity_threshold'
      required: [filters]

    match_faces_request_json:
      type: object
      properties:
        candidates:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/candidate_face'
              - $ref: '#/components/schemas/candidate_event'
              - $ref: '#/components/schemas/candidate_attribute'
          minItems: 0
          maxItems: 30
          description: Candidates for matching.
        references:
          type: array
          items:
            oneOf:
            - $ref: '#/components/schemas/face_reference'
            - $ref: '#/components/schemas/event_reference'
            - $ref: '#/components/schemas/attribute_reference'
            - $ref: '#/components/schemas/external_face_reference'
            - $ref: '#/components/schemas/external_event_reference'
            - $ref: '#/components/schemas/track_event_reference'
            - $ref: '#/components/schemas/xpk_file_entity'
            - $ref: '#/components/schemas/sdk_descriptor_entity'
            - $ref: '#/components/schemas/raw_face_descriptor_entity'
            discriminator:
              propertyName: type
              mapping:
                face: '#/components/schemas/face_reference'
                event: '#/components/schemas/event_reference'
                attribute: '#/components/schemas/attribute_reference'
                face_external_id: '#/components/schemas/external_face_reference'
                event_external_id: '#/components/schemas/external_event_reference'
                event_track_id: '#/components/schemas/track_event_reference'
                xpk_file: '#/components/schemas/xpk_file_entity'
                sdk_descriptor: '#/components/schemas/sdk_descriptor_entity'
                raw_descriptor: '#/components/schemas/raw_face_descriptor_entity'
          description: |
            References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types.
          minItems: 1
          maxItems: 30
      required: [references, candidates]

    match_faces_request_msgpack:
      type: object
      properties:
        candidates:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/candidate_face'
              - $ref: '#/components/schemas/candidate_event'
              - $ref: '#/components/schemas/candidate_attribute'
          minItems: 0
          maxItems: 30
          description: Candidates for matching.
        references:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/face_reference'
              - $ref: '#/components/schemas/event_reference'
              - $ref: '#/components/schemas/attribute_reference'
              - $ref: '#/components/schemas/external_face_reference'
              - $ref: '#/components/schemas/external_event_reference'
              - $ref: '#/components/schemas/track_event_reference'
              - $ref: '#/components/schemas/xpk_file_entity_binary'
              - $ref: '#/components/schemas/sdk_descriptor_entity_binary'
              - $ref: '#/components/schemas/raw_face_descriptor_entity_binary'
            discriminator:
              propertyName: type
              mapping:
                face: '#/components/schemas/face_reference'
                event: '#/components/schemas/event_reference'
                attribute: '#/components/schemas/attribute_reference'
                face_external_id: '#/components/schemas/external_face_reference'
                event_external_id: '#/components/schemas/external_event_reference'
                event_track_id: '#/components/schemas/track_event_reference'
                xpk_file: '#/components/schemas/xpk_file_entity_binary'
                sdk_descriptor: '#/components/schemas/sdk_descriptor_entity_binary'
                raw_descriptor: '#/components/schemas/raw_face_descriptor_entity_binary'
          description: |
            References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types.
          minItems: 1
          maxItems: 30
      required: [ references, candidates ]

    matches:
      nullable: true
      description: Sorted list with match result for the event.
      type: array
      items:
        type: object
        properties:
          candidates:
            type: array
            items:
              oneOf:
                - $ref: '#/components/schemas/face_candidates_in_target_match_result'
                - $ref: '#/components/schemas/event_candidates_in_target_match_result'
            minItems: 0
          label:
            $ref: '#/components/schemas/label'
        required: [candidates, label]
      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"
              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
                stream_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c7
              similarity: 0.3

    base_candidate_match_result:
      type: object
      properties:
        similarity:
          $ref: '#/components/schemas/similarity'
      description: Match result for the *reference_id* and a luna list or a list of faces.

    face_candidate_match_result:
      allOf:
        - $ref: '#/components/schemas/base_candidate_match_result'
        - properties:
            face:
              type: object
              properties:
                face_id:
                  $ref: '#/components/schemas/face_id'
                account_id:
                  $ref: '#/components/schemas/account_id'
                avatar:
                  $ref: '#/components/schemas/avatar'
                lists:
                  type: array
                  items:
                    $ref: '#/components/schemas/list_id'
                  minItems: 0
                  description: Comma-separated list of list IDs which contain the face.
                event_id:
                  allOf:
                    - nullable: true
                    - $ref: '#/components/schemas/event_id'
                  description: The event ID associated with the face creation.
                user_data:
                  $ref: '#/components/schemas/face_user_data'
                create_time:
                  $ref: '#/components/schemas/create_time'
                external_id:
                  $ref: '#/components/schemas/face_external_id'
        - required: [face]

    event_candidate_match_result:
      allOf:
        - $ref: '#/components/schemas/base_candidate_match_result'
        - properties:
            event:
              $ref: '#/components/schemas/event'
        - required: [event]

    face_match_result:
      type: object
      properties:
        result:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/face_candidate_match_result'
            description: Candidate match result.
        filters:
          allOf:
            - $ref: '#/components/schemas/match_candidate_face_filters'
          description: Candidate filters.
      required: [result, filters]

    event_match_result:
      type: object
      properties:
        result:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/event_candidate_match_result'
            description: Candidate match result.
        filters:
          allOf:
            - $ref: '#/components/schemas/match_candidate_event_filters'
          description: Candidate filters.
      required: [result, filters]

    attribute:
      type: object
      description: Temporary attribute.
      properties:
        create_time:
          allOf:
            - $ref: '#/components/schemas/time'
            - description: Attribute creation time.
        attribute_id:
          allOf:
            - $ref: '#/components/schemas/attribute_id'
            - description: Attribute ID.
        account_id:
          $ref: '#/components/schemas/account_id'
        basic_attributes:
          $ref: '#/components/schemas/basic_attributes'
        basic_attributes_samples:
          $ref: '#/components/schemas/attributes_samples'
        face_descriptor_samples:
          $ref: '#/components/schemas/attributes_samples'

    attribute_candidate_match_result:
      allOf:
        - $ref: '#/components/schemas/base_candidate_match_result'
        - properties:
            attribute:
              $ref: '#/components/schemas/attribute'
        - required: [attribute]

    attribute_match_result:
      type: object
      properties:
        result:
          type: array
          description: Array of matched candidates sorted by estimated similarity.
          items:
            allOf:
              - $ref: '#/components/schemas/attribute_candidate_match_result'
            description: Candidate match result.
        filters:
          $ref: '#/components/schemas/attribute_filters'
      required: [result, filters]

    matches_success:
      type: array
      description: List with success match result for the *reference_id*.
      items:
        description: Sorted list with success match result for the *reference_id* vs candidate batch.
        oneOf:
          - $ref: '#/components/schemas/face_match_result'
          - $ref: '#/components/schemas/event_match_result'
          - $ref: '#/components/schemas/attribute_match_result'
      minItems: 1

    matches_error:
      type: array
      description: Sorted list with match result for the *reference_id* with error.
      items:
        type: object
        properties:
          filters:
            oneOf:
              - $ref: '#/components/schemas/match_candidate_face_filters'
              - $ref: '#/components/schemas/match_candidate_event_filters'
            description: Candidate filters.
          error:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                description: Matching error.
        required: [filters, error]
      minItems: 1

    match_result:
      type: array
      items:
        type: object
        properties:
          reference:
            type: object
            description: Reference object.
            properties:
              id:
                allOf:
                  - $ref: '#/components/schemas/match_reference_id'
                  - description: Reference ID.
              type:
                type: string
                enum: ["descriptor", "attribute", "event", "face", "face_external_id", "sdk_descriptor", "event_external_id", "event_track_id"]
                description: Match reference type.
              face_id:
                allOf:
                  - $ref: '#/components/schemas/uuid'
                description: Reference face ID if reference type is `face_external_id`.
              event_id:
                allOf:
                  - $ref: '#/components/schemas/uuid'
                description: Reference event id if reference type is one of (`event_external_id`, `event_track_id`).
            required: [id, type]
          matches:
            oneOf:
              - $ref: '#/components/schemas/matches_success'
              - $ref: '#/components/schemas/matches_error'
            description: Reference vs candidates matches.
        required: [reference, matches]
      description: List of matches.

    match_reference_id:
      description: Reference ID - face ID or user-defined external ID for face or attribute ID or event ID.
      type: string
      maxLength: 36

    common_id:
      description: User-defined ID.
      type: string
      maxLength: 36
      example: "3.1415926"

    xpk_file_binary:
      type: string
      format: binary
      description: XPK file.

    sdk_descriptor_binary:
      type: string
      format: binary
      description: LUNA SDK descriptor in bytes. Descriptor version, signature and descriptor.

    identification_id:
      allOf:
      - $ref: '#/components/schemas/common_id'
      - description:  ID for identification in the match results.

    raw_descriptor_entity:
      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_face_descriptor_entity:
      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_body_descriptor_entity:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/identification_id'
        type:
          type: string
          enum: [ "raw_descriptor" ]
        data:
          $ref: '#/components/schemas/body_descriptor_data'
      required: [ id, type, data ]

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

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

    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_binary'
      required: [id, type, data]

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

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

    sdk_descriptor_entity_binary:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/identification_id'
        type:
          type: string
          enum: ["sdk_descriptor"]
        data:
          $ref: '#/components/schemas/sdk_descriptor_binary'
      required: [id, type, data]

    xpk_file_entity_binary:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/identification_id'
        type:
          type: string
          enum: ["xpk_file"]
        data:
          $ref: '#/components/schemas/xpk_file_binary'
      required: [id, type, data]

    BodySample:
      type: object
      properties:
        sample_id:
          $ref: '#/components/schemas/sample_id'
        url:
          type: string
          format: uri-reference
          description: Location of new sample.
      required: [sample_id, url]
      example:
        sample_id: b5d6fd45-fcca-453d-ac05-3e594054b813
        url: /6/samples/bodies/b5d6fd45-fcca-453d-ac05-3e594054b813

    error_code:
      type: integer
      description: Error code.

    errorId:
      type: integer
      example: 10

    errorIds:
      type: string
      format: comma-separate task ids
      minItems: 1
      example: 4,5,6

    taskStatus:
      type: integer
      enum: [0, 1, 2, 3, 4, 5]
      example: 1
      description: |
        Task status.

        | task status | value |
        |-----------------|---|
        | pending         | 0 |
        | in progress     | 1 |
        | cancelled       | 2 |
        | failed          | 3 |
        | collect results | 4 |
        | done            | 5 |

    subtaskStatus:
      type: integer
      enum: [0, 1, 2, 3, 4]
      example: 2

    taskCount:
      type: object
      description: Task count result.
      properties:
        count:
          type: integer
          minimum: 0
          example: 152
          description: Number of tasks.
      example:
        count: 13

    errorCount:
      type: object
      properties:
        count:
          type: integer
          minimum: 0
          example: 101
          description: Errors count.
      example:
        count: 18

    task_type:
      type: integer
      enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      example: 3
      description: |
        Task type.

        | task type         | value |
        |----------------------|----|
        | unknown              | 0  |
        | linker               | 1  |
        | clusterization       | 2  |
        | report               | 3  |
        | garbage collection   | 4  |
        | additional extract   | 5  |
        | cross match          | 6  |
        | roc-curve calculation| 7  |
        | export objects       | 8  |
        | estimate data        | 9  |
        | lambda task          | 10 |

    taskIds:
      type: string
      format: comma-separate task ids
      description: Task IDs.
      example: 1,2,3

    task_template_reply:
      type: object
      properties:
        task_id:
          $ref: '#/components/schemas/task_id'
        create_time:
          allOf:
            - description: Task create time.
            - $ref: '#/components/schemas/time'
        end_time:
          allOf:
            - nullable: true
            - description: Task end time.
            - $ref: '#/components/schemas/time_end'
        last_update_time:
          allOf:
            - description: Task last update time.
            - $ref: '#/components/schemas/time_end'
        task_status:
          $ref: '#/components/schemas/taskStatus'
        result_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/result_id'
        count_task_parts_done:
          $ref: '#/components/schemas/count_task_parts_done'
        count_task_parts_all:
          $ref: '#/components/schemas/count_task_parts_all'
        description:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/task_description'
        account_id:
          $ref: '#/components/schemas/account_id'
        schedule_id:
          $ref: '#/components/schemas/schedule_id'
        notification_policy:
          $ref: '#/components/schemas/task_notification_policy_response'
      required: [ task_id, create_time, last_update_time, task_type, task_status, count_task_parts_done,
                  count_task_parts_all, content, result_id, end_time, description, account_id, notification_policy ]

    task_linker_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [1]
        content:
          $ref: "#/components/schemas/linker_task_content_reply"

    task_clustering_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [2]
        content:
          $ref: "#/components/schemas/clustering_task_content_reply"

    task_report_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [3]
        content:
          $ref: "#/components/schemas/reporter_task_content_reply"

    task_gc_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      description: GC task content
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [ 4 ]
        content:
          description: Garbage collection task content
          oneOf:
            - $ref: '#/components/schemas/gc_face_descriptors_task_content_reply'
            - $ref: '#/components/schemas/gc_faces_task_content_reply'
            - $ref: '#/components/schemas/gc_event_descriptors_task_content_reply'
            - $ref: '#/components/schemas/gc_events_task_content_reply'
          discriminator:
            propertyName: target
            mapping:
              face_descriptors: '#/components/schemas/gc_face_descriptors_task_content_reply'
              faces: '#/components/schemas/gc_faces_task_content_reply'
              event_descriptors: '#/components/schemas/gc_event_descriptors_task_content_reply'
              events: '#/components/schemas/gc_events_task_content_reply'

    task_cross_match_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [6]
        content:
          $ref: "#/components/schemas/cross_match_task_content_reply"

    task_roc_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [7]
        content:
          $ref: "#/components/schemas/roc_task_content"

    task_exporter_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [8]
        content:
          $ref: "#/components/schemas/exporter_task_content"

    task_estimator_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [9]
        content:
          $ref: "#/components/schemas/estimator_task_content_required"

    task_reply:
      oneOf:
        - $ref: "#/components/schemas/task_linker_reply"
        - $ref: "#/components/schemas/task_clustering_reply"
        - $ref: "#/components/schemas/task_report_reply"
        - $ref: "#/components/schemas/task_gc_reply"
        - $ref: "#/components/schemas/task_additional_extract_reply"
        - $ref: "#/components/schemas/task_cross_match_reply"
        - $ref: "#/components/schemas/task_roc_reply"
        - $ref: "#/components/schemas/task_exporter_reply"
        - $ref: "#/components/schemas/task_estimator_reply"
        - $ref: "#/components/schemas/task_lambda_reply"
      discriminator:
        propertyName: task_type
        mapping:
          1: '#/components/schemas/task_linker_reply'
          2: '#/components/schemas/task_clustering_reply'
          3: '#/components/schemas/task_report_reply'
          4: '#/components/schemas/task_gc_reply'
          5: '#/components/schemas/task_additional_extract_reply'
          6: '#/components/schemas/task_cross_match_reply'
          7: '#/components/schemas/task_roc_reply'
          8: '#/components/schemas/task_exporter_reply'
          9: '#/components/schemas/task_estimator_reply'
          10: '#/components/schemas/task_lambda_reply'

    tasks_reply:
      type: object
      description: Tasks container.
      properties:
        tasks:
          type: array
          description: Found tasks.
          items:
            $ref: '#/components/schemas/task_reply'
      required: [tasks]

    task_results:
      anyOf:
        - $ref: '#/components/schemas/GCTaskResult'
        - $ref: '#/components/schemas/ClusteringTaskResult'
        - $ref: '#/components/schemas/LinkerTaskResult'
        - $ref: '#/components/schemas/CrossMatchTaskResult'
        - $ref: '#/components/schemas/ROCTaskResult'
        - $ref: '#/components/schemas/EstimatorTaskResult'
        - $ref: '#/components/schemas/AdditionalExtractTaskResult'

    ReportTaskResult:
      type: string
      format: binary
      description: |
        Zip archive with task result (now zip is supported in tasks on reports).

        Csv file and optional a folder with images in the case clusterization report.

        | cluster | event_id                             | create_time                      | end_time                         | external_id | handler_id                           | attribute_id                         | source | stream_id                            | top_match                                                                                                                                      | face_id                              | gender | age | emotion | ethnic_group | user_data                         | city   | area | district | street | house_number | latitude | longitude | mask | apparent_gender | apparent_age | headwear_state | sleeve_length | upper_clothing_colors | backpack_state | headwear_apparent_color | lower_garment_type    | lower_garment_colors | shoes_apparent_color | meta             |
        |---------|--------------------------------------|----------------------------------|----------------------------------|-------------|--------------------------------------|--------------------------------------|--------|--------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|--------|-----|---------|--------------|-----------------------------------|--------|------|----------|--------|--------------|----------|-----------|------|-----------------|--------------|----------------|---------------|-----------------------|----------------|-------------------------|-----------------------|----------------------|----------------------|------------------|
        | 0       | 6a4053de-17ab-40b5-bf2b-a1495df39085 | 2019-02-13T18:04:40.723800+03:00 | 2019-02-13T18:04:40.723800+03:00 |             | d727b3f5-e8ca-4fca-b092-d170ef5f9e49 | b3f9e82d-1654-4250-b39e-f8bbbca9880c |        | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': '23978f64-305f-4c43-8c01-c40bafabe554', 'label': '3a118ebc-18e2-4ed0-a0f0-3a50db652729', 'similarity': 0.6, 'external_id': 'e0'}" | cfb8ca11-4901-4296-a71d-0783d61ccf05 | 1      | 28  |         | 2            | vl test events_with_created_faces | Moscow | CAA  | Arbat    | Arbat  | 1            | 12.34    |   56.78   |  1   | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 1       | 110cc2d3-0350-418e-b956-90ef4dacbd23 | 2019-02-13T18:04:40.723800+03:00 | 2019-02-13T18:04:40.723800+03:00 |             | d727b3f5-e8ca-4fca-b092-d170ef5f9e49 | 3e1d0ffb-1fa6-449e-8c8b-8f9b56bfff6d |        | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': 'ad008886-942c-4c13-934c-8232dc7eefb2', 'label': '15859afa-37d3-41e2-8bc2-cb6f970dc6a0', 'similarity': 0.5, 'external_id': 'e1'}" | f4f17cbe-9197-4347-b214-692fa4ca9f26 | 0      | 24  |         | 2            | vl test events_with_created_faces | Moscow | CAA  | Arbat    | Arbat  | 1            | 12.34    |   56.78   |  1   | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 2       | 9a9c9445-6a3d-4f4d-b22a-64601f4c8675 | 2019-02-13T18:04:40.723800+03:00 | 2019-02-13T18:04:40.723800+03:00 |             | d727b3f5-e8ca-4fca-b092-d170ef5f9e49 | 91a7fd34-0877-46f5-844c-e88fd28d68f0 |        | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': 'c77bda6b-74ea-412f-989f-f27fd5be1e20', 'label': '3ac8c676-c717-4da4-8ed3-6ca9e6139c6d', 'similarity': 0.4, 'external_id': 'e2'}" | 83086070-bce2-40b9-a5c4-9df36a52fe4f | 0      | 19  |         | 4            | vl test events_with_created_faces | Moscow | CAA  | Arbat    | Arbat  | 1            | 12.34    |   56.78   |  1   | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 2       | 979be9cd-6363-431a-a8a6-3f3fff806abf | 2019-02-13T18:04:40.723800+03:00 | 2019-02-13T18:04:40.723800+03:00 |             | d727b3f5-e8ca-4fca-b092-d170ef5f9e49 | 2cfacb32-fc7a-4abd-8518-0bf759acc4f9 |        | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': '477a4ef7-16dc-4189-ab3b-91b1d342e101', 'label': '64058eac-eff1-4efc-b6c3-982133523a31', 'similarity': 0.3, 'external_id': 'e3'}" | e09228a7-8a7e-4581-b550-d5c0818c871f | 0      | 28  |         | 4            | vl test events_with_created_faces | Moscow | CAA  | Arbat    | Arbat  | 1            | 12.34    |   56.78   |  1   | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 3       | 60b86bf7-3395-40cf-90f0-4e0756f50b9e | 2019-02-13T18:04:40.723800+03:00 | 2019-02-13T18:04:40.723800+03:00 |             | d727b3f5-e8ca-4fca-b092-d170ef5f9e49 | 67c823db-8e3c-4638-abf9-63078d2687d5 |        | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': '7f5bf6fb-2ad0-42bf-98f2-fe949516db7d', 'label': 'be309d4d-deaa-479e-ba70-026a712f39e2', 'similarity': 0.2, 'external_id': 'e4'}" | 301e8eb8-b6af-4c33-b5a1-6861509d2df4 | 1      | 56  |         | 4            | vl test events_with_created_faces | Moscow | CAA  | Arbat    | Arbat  | 1            | 12.34    |   56.78   |  1   | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |

    ExportTaskResult:
      type: string
      format: binary
      description: |
        Zip archive with task result (now zip is supported in tasks on export).

        Csv file and optional a folder with images in the case export.

        | event_id                             | create_time                      | end_time                         | external_id                          | handler_id                           | source                               | stream_id                            | top_match                                                                                                                                      | face_id                              | gender | age | emotion | ethnic_group | user_data                            | mask | track_id                             | city   | area | district | street | house_number | geo_position     | mask | apparent_gender | apparent_age | headwear_state | sleeve_length | upper_clothing_colors | backpack_state | headwear_apparent_color | lower_garment_type    | lower_garment_colors | shoes_apparent_color | meta             |
        |--------------------------------------|----------------------------------|----------------------------------|--------------------------------------|--------------------------------------|--------------------------------------|--------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|--------|-----|---------|--------------|--------------------------------------|------|--------------------------------------|--------|------|----------|--------|--------------| -----------------|------|-----------------|--------------|----------------|---------------|-----------------------|----------------|-------------------------|-----------------------|----------------------|----------------------|------------------|
        | 0370f6b6-643a-4ad6-8c30-57849d7b070d | 2021-06-18T09:01:45.115401+03:00 | 2021-06-18T09:01:45.115401+03:00 | a2c4ef84-8ed6-4b9c-b4ac-b96e7ae4d973 | 0f474053-8b2c-4d62-bfd0-b2f6072464cd | a7f009a9-3a98-4e5b-8e45-0c43290c84df | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': '23978f64-305f-4c43-8c01-c40bafabe554', 'label': '3a118ebc-18e2-4ed0-a0f0-3a50db652729', 'similarity': 0.6, 'external_id': 'e0'}" | f687a4d1-0d25-4940-bbda-192b7b964fed | 1      | 33  | 7       | 1            | 1111632d-70fc-4e2e-b336-d5a68e1deb14 | 1    | 09e6642b-1ebe-405d-9bcd-86bbe254dc4f | Moscow | CAA  | Arbat    | Arbat  | 1            | "55.752, 36.616" | 1    | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 0370f6b6-643a-4ad6-8c30-57849d7b070c | 2021-06-18T09:01:45.115206+03:00 | 2021-06-18T09:01:45.115401+03:00 | 2ba4dcb3-0ca6-43b2-a588-42cd776a09ab | 2daa17f1-a5e6-4d7b-bae4-a224eec35eee | c038bede-f002-4c74-98fe-d3686b043fcd | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': 'ad008886-942c-4c13-934c-8232dc7eefb2', 'label': '15859afa-37d3-41e2-8bc2-cb6f970dc6a0', 'similarity': 0.5, 'external_id': 'e1'}" | ed5ea7ce-02b3-4129-b3e8-4721b678c463 | 1      | 33  | 7       | 1            | 42d908a4-52c5-4f46-87bd-4903ee315260 | 1    | b152f0a9-2fe7-458d-9107-9783cf14e491 | Moscow | CAA  | Arbat    | Arbat  | 1            | "55.752, 36.616" | 1    | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 0370f6b6-643a-4ad6-8c30-57849d7b070b | 2021-06-18T09:01:45.115014+03:00 | 2021-06-18T09:01:45.115401+03:00 | ca23bb19-6c15-4466-a89c-b1181adaf874 | 757318b2-3570-496a-b3c2-5d8a024e0ae1 | 4fd91006-d51a-4491-8923-1c6341a579c4 | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': 'c77bda6b-74ea-412f-989f-f27fd5be1e20', 'label': '3ac8c676-c717-4da4-8ed3-6ca9e6139c6d', 'similarity': 0.4, 'external_id': 'e2'}" | ae6381e6-0341-47bb-9989-3a3706ae99f9 | 1      | 33  | 7       | 1            | 079c8ecc-d29b-4ab5-aa65-d1954b5101d6 | 1    | e6495a29-7c25-45bd-b9f6-17d954f5a485 | Moscow | CAA  | Arbat    | Arbat  | 1            | "55.752, 36.616" | 1    | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 0370f6b6-643a-4ad6-8c30-57849d7b070a | 2021-06-18T09:01:45.114805+03:00 | 2021-06-18T09:01:45.115401+03:00 | 7e1c37d0-74f1-4ca7-8fbe-f5c26b6a5fb7 | 7c57c339-4fc3-4a1a-90e3-e932eb4b022d | 8391e7c7-a8b1-4466-8b1e-76433f3e92a7 | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': '477a4ef7-16dc-4189-ab3b-91b1d342e101', 'label': '64058eac-eff1-4efc-b6c3-982133523a31', 'similarity': 0.3, 'external_id': 'e3'}" | 830bc063-d5ca-4eba-a8c3-2094d9e4bd32 | 1      | 33  | 7       | 1            | 5068d60e-5f50-4e45-bdbf-d68a3020097c | 1    | b3b780ea-76f2-4147-ae4e-674bbf8c8aa0 | Moscow | CAA  | Arbat    | Arbat  | 1            | "55.752, 36.616" | 1    | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |
        | 0370f6b6-643a-4ad6-8c30-57849d7b0709 | 2021-06-18T09:01:45.114531+03:00 | 2021-06-18T09:01:45.115401+03:00 | 3a95f340-9b02-4b4d-b56c-bc6aeaae46db | aa7d4de1-d4fb-4052-acb4-1ccb5be99ece | c1275d2f-95d1-4034-870f-da0a8f9d02b8 | 91a7fd34-0877-46f5-844c-e88fd28d68f0 | "{'face_id': '7f5bf6fb-2ad0-42bf-98f2-fe949516db7d', 'label': 'be309d4d-deaa-479e-ba70-026a712f39e2', 'similarity': 0.2, 'external_id': 'e4'}" | 64c4f42e-e7e3-4a72-93d8-399e5c8451c9 | 1      | 33  | 7       | 1            | 7bcc784c-d699-492e-99e5-5c3cdea79764 | 1    | d0e339e3-472a-4da0-b90a-43693ca5fb47 | Moscow | CAA  | Arbat    | Arbat  | 1            | "55.752, 36.616" | 1    | 1               | 33           | 0              | "long"        | ["black", "white"]    | 2              | "black"                 | "shorts"              | ["black", "blue"]    | "black"              | "{'foo':'bar1'}" |

    task_results_zip:
      anyOf:
        - $ref: '#/components/schemas/ReportTaskResult'
        - $ref: '#/components/schemas/ExportTaskResult'

    subtask_content:
      type: object
      description: Content of subtask.
      example: content
      additionalProperties: true

    error_description:
      type: string
      description: Error description.
      example: Faces not found

    error_link:
      type: string
      description: Link to the documentation website with the error description.
      example: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"

    error_detail:
      type: string
      description: Error detail.
      example: One or more faces not found, including face with id '8f4f0070-c464-460b-bf78-fac225df72e9'

    errors_additional_info:
      type: string
      description: Additional error info.
      example: 8f4f0070-c464-460b-bf78-fac225df72e9
      nullable: true

    tasks_objects_type:
      type: string
      description: Objects type - faces or events.
      enum: ["faces", "events"]

    common_objects_type:
      type: string
      description: Objects type - faces, attributes or events.
      enum: [ "faces", "events", "attributes" ]

    count_task_parts_done:
      type: integer
      minimum: 0
      description: Number of finished subtasks.
      example: 10

    count_task_parts_all:
      type: integer
      minimum: 1
      description: Number of subtasks.
      example: 100

    status_code:
      type: integer
      minimum: 400
      maximum: 599
      description: Error status code.
      example: 500

    task_id:
      type: integer
      minimum: 1
      description: Task ID.
      example: 123

    subtask_id:
      type: integer
      minimum: 1
      description: Subtask ID.
      example: 5

    time_end:
      type: string
      format: date-time
      example: "2018-08-11T10:11:41.674Z"

    SubTask:
      type: object
      properties:
        subtask_id:
          $ref: '#/components/schemas/subtask_id'
        task_id:
          $ref: '#/components/schemas/task_id'
        result_id:
          allOf:
          - nullable: true
          - $ref: '#/components/schemas/result_id'
        create_time:
          allOf:
          - description: Subtask create time.
          - $ref: '#/components/schemas/time'
        end_time:
          allOf:
          - description: Subtask end time.
          - $ref: '#/components/schemas/time_end'
        subtask_status:
          allOf:
          - description: |
              Subtask status.

              | subtask status| value |
              |-------------------|---|
              | pending           | 0 |
              | in progress       | 1 |
              | cancelled         | 2 |
              | failed            | 3 |
              | done              | 4 |
          - type: integer
          - $ref: '#/components/schemas/subtaskStatus'
        content:
          $ref: '#/components/schemas/subtask_content'
      required: [subtask_id, task_id, create_time, subtask_status, content, result_id]

    SubTasks:
      type: object
      properties:
        subtasks:
          type: array
          items:
            $ref: '#/components/schemas/SubTask'
          minItems: 0
      required: [subtasks]

    TaskError:
      type: object
      properties:
        error_id:
          allOf:
          - type: integer
          - $ref: '#/components/schemas/errorId'
        task_id:
          $ref: '#/components/schemas/task_id'
        subtask_id:
          allOf:
          - nullable: true
          - $ref: '#/components/schemas/subtask_id'
        error_code:
          $ref: '#/components/schemas/error_code'
        description:
          $ref: '#/components/schemas/error_description'
        detail:
          $ref: '#/components/schemas/error_detail'
        link:
          $ref: '#/components/schemas/error_link'
        additional_info:
          allOf:
          - nullable: true
          - $ref: '#/components/schemas/errors_additional_info'
        error_time:
          allOf:
          - description: Error time.
          - $ref: '#/components/schemas/time'
      required: [error_id, task_id, subtask_id, error_code, description, detail, link, error_time, additional_info]

    TaskErrorsArray:
      type: array
      items:
        $ref: '#/components/schemas/TaskError'
      minItems: 0
      maxItems: 100000
      description: Array of errors occurred while task processing.

    TaskErrors:
      description: Task errors.
      type: object
      properties:
        errors:
          $ref: '#/components/schemas/TaskErrorsArray'
      required: [errors]

    task_face_filters_no_account:
      description: Faces filters mapping.
      allOf:
        - $ref: '#/components/schemas/faces_filters_no_create_time'
      type: object
      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'

    faces_filters_no_create_time:
      type: object
      properties:
        face_ids:
          $ref: '#/components/schemas/face_ids'
        external_ids:
          $ref: '#/components/schemas/external_ids'
        user_data:
          $ref: '#/components/schemas/filter_user_data'
        face_id__gte:
          $ref: '#/components/schemas/face_id__gte'
        face_id__lt:
          $ref: '#/components/schemas/face_id__lt'
        list_id:
          allOf:
            - description: List ID filter. Only the faces linked to the specified list will be processed.
            - $ref: '#/components/schemas/uuid'

    faces_filters_no_account_reply:
      allOf:
        - $ref: '#/components/schemas/faces_filters_no_create_time'
      properties:
        create_time__gte:
          description: Create time lower included boundary.
          $ref: '#/components/schemas/create_time__gte'
        create_time__lt:
          description: Create time upper excluded boundary.
          $ref: '#/components/schemas/create_time__lt'

    faces_filters_regular_create_time:
      allOf:
        - $ref: '#/components/schemas/faces_filters_no_create_time'
      type: object
      properties:
        create_time__gte:
          description: Create time lower included boundary.
          $ref: '#/components/schemas/create_time__gte'
        create_time__lt:
          description: Create time upper excluded boundary.
          $ref: '#/components/schemas/create_time__lt'
        account_id:
          $ref: '#/components/schemas/account_id'
      required: [ account_id ]

    events_filters_no_create_end_time:
      type: object
      properties:
        event_ids:
          $ref: '#/components/schemas/event_ids'
        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/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_filter'
        age__lt:
          $ref: '#/components/schemas/age_lt_filter'
        gender:
          $ref: '#/components/schemas/gender_candidate_filter'
        emotions:
          $ref: '#/components/schemas/emotion_filter'
        masks:
          $ref: '#/components/schemas/masks_filter'
        ethnic_groups:
          $ref: '#/components/schemas/ethnicities_candidate_filter'
        face_ids:
          $ref: '#/components/schemas/face_ids'
        user_data:
          $ref: '#/components/schemas/filter_user_data'
        sources:
          $ref: '#/components/schemas/sources'
        stream_ids:
          $ref: '#/components/schemas/stream_ids'
        tags:
          allOf:
            - $ref: '#/components/schemas/tags'
            - description: List of tags. Each event from result will contain all of given 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:
          allOf:
            - $ref: '#/components/schemas/geo_position_bbox'
          nullable: true
        track_ids:
          $ref: '#/components/schemas/track_ids'
        liveness:
          $ref: '#/components/schemas/liveness_candidate_filter'
        deepfake:
          $ref: '#/components/schemas/deepfake_candidate_filter'
        apparent_gender:
          $ref: '#/components/schemas/apparent_gender'
        apparent_age__gte:
          $ref: '#/components/schemas/apparent_age__gte'
        apparent_age__lt:
          $ref: '#/components/schemas/apparent_age__lt'
        headwear_states:
          $ref: '#/components/schemas/headwear_states'
        headwear_apparent_colors:
          $ref: '#/components/schemas/headwear_colors'
        sleeve_lengths:
          $ref: '#/components/schemas/sleeve_lengths'
        upper_clothing_colors:
          $ref: '#/components/schemas/upper_clothing_colors'
        lower_garment_colors:
          $ref: '#/components/schemas/lower_garment_colors'
        lower_garment_types:
          $ref: '#/components/schemas/lower_garment_types'
        shoes_apparent_colors:
          $ref: '#/components/schemas/shoes_colors'
        backpack_states:
          $ref: '#/components/schemas/backpack_states'
        meta:
          allOf:
            - $ref: '#/components/schemas/meta'
            - nullable: true

    task_event_filters_no_account:
      allOf:
        - $ref: '#/components/schemas/events_filters_no_create_end_time'
      description: Event 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'

    events_filters_no_account_reply:
      allOf:
        - $ref: '#/components/schemas/events_filters_no_create_end_time'
      type: object
      properties:
        create_time__gte:
          description: Create time lower included boundary.
          $ref: '#/components/schemas/create_time__gte'
        create_time__lt:
          description: Create time upper excluded boundary.
          $ref: '#/components/schemas/create_time__lt'
        end_time__gte:
          description: End time lower included boundary.
          $ref: '#/components/schemas/end_time__gte'
        end_time__lt:
          description: End time upper excluded boundary.
          $ref: '#/components/schemas/end_time__lt'

    events_filters_regular_create_time:
      allOf:
        - $ref: '#/components/schemas/events_filters_no_create_end_time'
      type: object
      properties:
        create_time__gte:
          description: Create time lower included boundary.
          $ref: '#/components/schemas/create_time__gte'
        create_time__lt:
          description: Create time upper excluded boundary.
          $ref: '#/components/schemas/create_time__lt'
        end_time__gte:
          description: End time lower included boundary.
          $ref: '#/components/schemas/end_time__gte'
        end_time__lt:
          description: End time upper excluded boundary.
          $ref: '#/components/schemas/end_time__lt'
        account_id:
          $ref: '#/components/schemas/account_id'
      required: [ account_id ]

    clustering_task_face_filters:
      allOf:
        - $ref: '#/components/schemas/faces_filters_no_create_time'
        - properties:
            create_time__gte:
              oneOf:
                - $ref: '#/components/schemas/create_time__gte'
                - $ref: '#/components/schemas/create_time_now__gte'
            create_time__lt:
              oneOf:
                - $ref: '#/components/schemas/create_time__lt'
                - $ref: '#/components/schemas/create_time_now__lt'
            account_id:
              $ref: '#/components/schemas/account_id'

    task_face_filters:
      allOf:
        - $ref: '#/components/schemas/task_face_filters_no_account'
        - properties:
            account_id:
              $ref: '#/components/schemas/account_id'
        - required: [ account_id ]

    clustering_task_event_filters:
      allOf:
        - $ref: '#/components/schemas/events_filters_no_create_end_time'
      type: object
      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'
        account_id:
          $ref: '#/components/schemas/account_id'

    task_event_filters:
      allOf:
        - $ref: '#/components/schemas/task_event_filters_no_account'
        - properties:
            account_id:
              $ref: '#/components/schemas/account_id'
        - required: [ account_id ]

    task_attribute_filters:
      type: object
      properties:
        attribute_ids:
          $ref: '#/components/schemas/attribute_ids'
      required: [ attribute_ids ]

    linker_task_content:
      type: object
      description: Linker task content.
      properties:
        create_list:
          description: |
            Create list for linking faces. If set to 1, new list is created.

            If set to 0, you must specify the existing list ID in the `list_id` field.
          type: integer
          enum: [0, 1]
          example: 1
        list_id:
          description: |
            ID of the list to link faces to. If there is no list with the specified ID, then the system will report an error.

            If `create_list` is set to 1, the `list_id` field must be deleted from the request body.
          allOf:
            - $ref: '#/components/schemas/uuid'
        user_data:
          description: User data to create the list. It is only used if `create_list` is set to 1.
          allOf:
            - $ref: '#/components/schemas/list_user_data'
        objects_type:
          $ref: '#/components/schemas/tasks_objects_type'
        filters:
          anyOf:
            - $ref: '#/components/schemas/task_face_filters_no_account'
            - $ref: '#/components/schemas/task_event_filters_no_account'
      required: [objects_type]

    linker_task_content_no_filters:
      type: object
      description: linker task content
      properties:
        create_list:
          description: Create list to link faces to or not | require `list_id` or `create_list` set to 1.
          type: integer
          enum: [ 0, 1 ]
          example: 1
        list_id:
          description: ID of list to link faces to | require `list_id` or `create_list` set to 1.
          allOf:
            - $ref: '#/components/schemas/uuid'
        user_data:
          allOf:
            - $ref: '#/components/schemas/user_data'
          description: User data to create the list with | works if `create_list` set to 1.
        objects_type:
          $ref: '#/components/schemas/tasks_objects_type'

    task_description:
      type: string
      maxLength: 128
      description: task description
      example: "task description"

    notification_policy:
      type: object
      description: tasks processing notification policy
      properties:
        enable:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: Whether callbacks enabled or not.
        task_callbacks:
          $ref: '#/components/schemas/task_callbacks'
        subtask_callbacks:
          $ref: '#/components/schemas/subtask_callbacks'

    task_notification_policy_response:
      allOf:
        - $ref: "#/components/schemas/notification_policy"
      required: [enable, task_callbacks, subtask_callbacks]

    task_base:
      type: object
      properties:
        notification_policy:
          $ref: '#/components/schemas/notification_policy'
        description:
          $ref: '#/components/schemas/task_description'
      required: [content]

    linker_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/linker_task_content'

    gc_face_descriptors_task_content_reply:
      description: Garbage collection task content to delete face descriptors by version.
      type: object
      properties:
        target:
          type: string
          enum: ['face_descriptors']
        filters:
          type: object
          properties:
            descriptor_version:
              description: Version of descriptors to delete.
              type: integer
          required: [descriptor_version]
        store_results:
          type: boolean
          description: Whether to store task results. Whatever, task errors are stored.
          default: true
      required: [target, filters]

    gc_event_descriptors_task_content_reply:
      description: Garbage collection task content to delete event descriptors by version and type.
      type: object
      properties:
        target:
          type: string
          enum: ["event_descriptors"]
        filters:
          type: object
          properties:
            descriptor_version:
              description: Descriptors version.
              type: integer
            descriptor_type:
              description: Descriptors type.
              type: string
              enum: ['face', 'body']
          required: [descriptor_version, descriptor_type]
        store_results:
          type: boolean
          description: Whether to store task results. The task errors are stored in any case.
          default: true
      required: [target, filters]

    gc_events_task_content:
      description: Garbage collection task content to remove events.
      type: object
      properties:
        target:
          type: string
          enum: ['events']
        filters:
          type: object
          properties:
            create_time__lt:
              oneOf:
                - $ref: '#/components/schemas/create_time__lt'
                - $ref: '#/components/schemas/create_time_now__lt'
              description: Create time upper excluded bound in RFC 3339 format.
            insert_time__lt:
              oneOf:
                - $ref: '#/components/schemas/insert_time__lt'
                - $ref: '#/components/schemas/insert_time_now__lt'
              description: Insert time upper excluded bound in RFC 3339 format.
            handler_id:
              allOf:
                - $ref: '#/components/schemas/uuid'
                - description: Handler ID to execute task within the handler.
        store_results:
          type: boolean
          description: Whether to store task results. The task errors are stored in any case.
          default: true
        remove_samples:
          type: boolean
          description: |
            Whether to remove face and body samples along with the event.

            > **WARNING**: After removing samples, it will become impossible to re-extract the attribute or descriptor for the created face.
          default: false
        remove_image_origins:
          type: boolean
          description: |
            Whether to remove image origins along with the event.
          default: false
      required: [target]

    GcEventsTaskContentReply:
      description: Garbage collection task content to remove events.
      type: object
      properties:
        target:
          type: string
          enum: [ 'events' ]
        filters:
          type: object
          properties:
            create_time__lt:
              $ref: '#/components/schemas/create_time__lt'
              description: Create time upper excluded bound in RFC 3339 format.
            insert_time__lt:
              $ref: '#/components/schemas/insert_time__lt'
              description: Insert time upper excluded bound in RFC 3339 format.
            handler_id:
              allOf:
                - $ref: '#/components/schemas/uuid'
                - description: Handler ID to execute task within the handler.
        store_results:
          type: boolean
          description: Whether to store task results. The task errors are stored in any case.
          default: true
        remove_samples:
          type: boolean
          description: |
            Whether to remove face and body samples along with the event.

            > **WARNING**: After removing samples, it will become impossible to re-extract the attribute or descriptor for the created face.
          default: false
        remove_image_origins:
          type: boolean
          description: |
            Whether to remove image origins along with the event.
          default: false
      required: [ target ]

    gc_events_task_content_reply:
      allOf:
        - $ref: '#/components/schemas/GcEventsTaskContentReply'
        - properties:
            filters:
              type: object
              properties:
                account_id:
                  $ref: '#/components/schemas/account_id'

    user_data:
      description: User data.
      type: string
      maxLength: 128
      example: "100-00-12"

    gc_faces_task_content:
      description: Garbage collection task content to delete faces by extended filters.
      type: object
      properties:
        target:
          type: string
          enum: ['faces']
        filters:
          type: object
          properties:
            create_time__lt:
              oneOf:
                - $ref: '#/components/schemas/create_time__lt'
                - $ref: '#/components/schemas/create_time_now__lt'
              description: Create time upper excluding boundary in format RFC 3339.
              example: "2018-08-11T09:11:41.674Z"
            create_time__gte:
              oneOf:
                - $ref: '#/components/schemas/create_time__gte'
                - $ref: '#/components/schemas/create_time_now__gte'
              description: Create time lower including boundary in format RFC 3339.
              example: "2018-08-11T09:11:41.674Z"
            user_data:
              $ref: '#/components/schemas/user_data'
            list_id:
              allOf:
                - $ref: '#/components/schemas/uuid'
              description: List ID.
              example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'
        store_results:
          type: boolean
          description: Whether to store task results. Whatever, task errors are stored.
          default: true
        remove_samples:
          type: boolean
          description: |
            Whether to remove face descriptor and basic attributes samples along with the face.
          default: false
      required: [target]

    GcFacesTaskContentReply:
      description: Garbage collection task content to delete faces by extended filters.
      type: object
      properties:
        target:
          type: string
          enum: [ 'faces' ]
        filters:
          type: object
          properties:
            create_time__lt:
              $ref: '#/components/schemas/create_time__lt'
              description: Create time upper excluding boundary in format RFC 3339.
              example: "2018-08-11T09:11:41.674Z"
            create_time__gte:
              $ref: '#/components/schemas/create_time__gte'
              description: Create time lower including boundary in format RFC 3339.
              example: "2018-08-11T09:11:41.674Z"
            user_data:
              $ref: '#/components/schemas/user_data'
            list_id:
              allOf:
                - $ref: '#/components/schemas/uuid'
              description: List ID.
              example: '8950722f-3fd4-4223-b48f-03f95f0e8dfb'
        store_results:
          type: boolean
          description: Whether to store task results. Whatever, task errors are stored.
          default: true
        remove_samples:
          type: boolean
          description: |
            Whether to remove face descriptor and basic attributes samples along with the face.
          default: false
      required: [ target, filters ]

    gc_faces_task_content_reply:
      allOf:
        - $ref: '#/components/schemas/GcFacesTaskContentReply'
        - properties:
            filters:
              type: object
              properties:
                account_id:
                  $ref: '#/components/schemas/account_id'

    gc_task_content:
      oneOf:
        - $ref: '#/components/schemas/gc_faces_task_content'
        - $ref: '#/components/schemas/gc_events_task_content'
      discriminator:
        propertyName: "target"
        mapping:
          faces: '#/components/schemas/gc_faces_task_content'
          events: '#/components/schemas/gc_events_task_content'

    gc_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/gc_task_content'

    EventClusteringTaskParams:
      type: object
      description: Additional task parameters.
      properties:
        use_track_info:
          type: integer
          enum: [0, 1]
          default: 0
          description: Whether to place events with equal `track_id` in the same clusters (for events only).

    clustering_limit:
      description: Maximum number of matching candidates returned for every match.
      type: integer
      minimum: 1
      maximum: 20000
      example: 3
      default: 20000

    clustering_task_content_faces_regular_create_time:
      allOf:
        - $ref: '#/components/schemas/faces_filters_no_create_time'
      type: object
      properties:
        create_time__gte:
          description: Create time lower included boundary.
          $ref: '#/components/schemas/create_time__gte'
        create_time__lt:
          description: Create time upper excluded boundary.
          $ref: '#/components/schemas/create_time__lt'
        account_id:
          $ref: '#/components/schemas/account_id'

    clustering_task_content_events_regular_create_time:
      allOf:
        - $ref: '#/components/schemas/events_filters_no_create_end_time'
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        create_time__gte:
          description: Create time lower included boundary.
          $ref: '#/components/schemas/create_time__gte'
        create_time__lt:
          description: Create time upper excluded boundary.
          $ref: '#/components/schemas/create_time__lt'
        end_time__gte:
          description: End time lower included boundary.
          $ref: '#/components/schemas/end_time__gte'
        end_time__lt:
          description: End time upper excluded boundary.
          $ref: '#/components/schemas/end_time__lt'

    clustering_task_content_no_filters:
      type: object
      description: Clustering task content.
      properties:
        objects_type:
          $ref: '#/components/schemas/tasks_objects_type'
        params:
          $ref: '#/components/schemas/EventClusteringTaskParams'
        threshold:
          description: The minimum acceptable degree of similarity. If the similarity of two descriptors exceeds the specified value, it is considered that they belong to the same person. In this case, both descriptors are added to the same cluster.
          type: number
          format: double
          maximum: 1
          minimum: 0
          example: 0.5
          default: 0.81
        descriptor:
          $ref: '#/components/schemas/descriptor_info'
        limit:
          $ref: "#/components/schemas/clustering_limit"
      required: [objects_type]

    clustering_task_content:
      allOf:
        - $ref: '#/components/schemas/clustering_task_content_no_filters'
      properties:
        filters:
          anyOf:
            - $ref: '#/components/schemas/clustering_task_face_filters'
            - $ref: '#/components/schemas/clustering_task_event_filters'

    clustering_task_content_reply:
      allOf:
        - $ref: '#/components/schemas/clustering_task_content_no_filters'
      properties:
        filters:
          anyOf:
            - $ref: '#/components/schemas/clustering_task_content_faces_regular_create_time'
            - $ref: '#/components/schemas/clustering_task_content_events_regular_create_time'
      required: [ filters, objects_type ]

    clustering_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/clustering_task_content'

    GCEventsTaskResult:
      type: array
      description: Removed events.
      items:
        type: object
        properties:
          event_id:
            $ref: '#/components/schemas/event_id'
          samples:
            type: array
            description: Sample IDs.
            items:
              $ref: '#/components/schemas/sample_id'
        required: [event_id, samples]

    GCFacesTaskResult:
      type: array
      description: Removed faces.
      items:
        type: object
        properties:
          face_id:
            $ref: '#/components/schemas/uuid'
          basic_attributes_samples:
            type: array
            description: Basic attributes sample IDs
            items:
              $ref: '#/components/schemas/uuid'
          face_descriptor_samples:
            type: array
            description: Face descriptors sample IDs
            items:
              $ref: '#/components/schemas/uuid'
        required: [ face_id ]

    GCTaskResult:
      description: Garbage collection task result.
      type: object
      properties:
        result:
          oneOf:
            - $ref: '#/components/schemas/GCEventsTaskResult'
            - $ref: '#/components/schemas/GCFacesTaskResult'
        errors:
          $ref: '#/components/schemas/TaskErrorsArray'
      required: [errors]

    LinkerTaskResult:
      description: Linking task result.
      type: object
      properties:
        errors:
          description: Errors occurred during the task processing.
          allOf:
          - $ref: '#/components/schemas/TaskErrorsArray'
        result:
          type: object
          properties:
            list_id:
              $ref: '#/components/schemas/list_id'
            face_ids:
              description: Linked faces' IDs.
              type: array
              items:
                description: Linked face ID.
                allOf:
                - $ref: '#/components/schemas/face_id'
          required: [list_id, face_ids]
      required: [errors]

    ClusteringTaskResult:
      description: Clustering task result.
      type: object
      properties:
        result:
          description: Clustering result.
          type: object
          properties:
            clusters:
              description: Generated clusters - lists of objects IDs.
              type: array
              items:
                description: Single cluster - list of objects' IDs.
                type: array
                example: ["bf749384-0e30-4b8a-a884-dfdfcafd0a55", "0a2ce15b-a6f7-4713-97ce-64410f55031a", "60bacd78-64a3-4206-9434-bc94c73ff2c1", "cd7bae5a-8144-47e8-8d75-928ed8dc576b", "b20ebff6-1973-40b2-a190-b72ff1ef8927"]
                items:
                  description: Object ID.
                  allOf:
                  - $ref: '#/components/schemas/uuid'
            total_objects:
              type: integer
              description: Total objects count.
              example: 5
            total_clusters:
              type: integer
              description: Total clusters count.
              example: 1
        errors:
          description: Errors occurred during the task processing.
          allOf:
          - $ref: '#/components/schemas/TaskErrorsArray'
      required: [errors]

    new_handler_task_estimator:
      type: object
      description: New handler with policies.
      properties:
        description:
          type: string
          maxLength: 128
          description: User defined created handler description.
          default: estimator_task_{task_id}
        policies:
          description: Handler policies.
          allOf:
          - $ref: '#/components/schemas/Policies'
      required: [policies]

    existing_handler_task_estimator:
      type: object
      description: Existing handler.
      properties:
        handler_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: |
           The `handler_id` of static or dynamic handler.

           An error will occur if policies are specified for static handlers.
        policies:
          description: Handler policies (required for dynamic handler).
          allOf:
          - $ref: '#/components/schemas/Policies'
      required: [ handler_id ]

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

    base_estimator_task_content_source:
      type: object
      properties:
        image_type:
          $ref: '#/components/schemas/image_type'
      required: [source_type]

    base_estimator_task_content_source_required:
      allOf:
        - $ref: '#/components/schemas/base_estimator_task_content_source'
        - required: [image_type, source_type]

    zip_password_authorization:
      type: object
      description: Password authorization.
      properties:
        password:
          type: string
          minLength: 1
          maxLength: 128
          pattern: '^.{1,128}$'
          description: User password for the archive.

    estimator_authorization_by_password:
      type: object
      description: User authorization meta.
      properties:
        source_type:
          type: string
          enum: ["zip"]
          description: Data type where images are located.
        reference:
          oneOf:
          - $ref: '#/components/schemas/zip_reference'
          - type: string
            description: archive location url
            format: uri
        authorization:
          $ref: '#/components/schemas/zip_password_authorization'
        recursive:
          type: boolean
          default: true
          description: Whether to estimate images from ZIP archive subdirectories recursively.
      required: [reference]

    follow_links:
      type: boolean
      default: false
      description: Whether follow file system links.

    zip_reference:
      type: object
      description: ZIP archive reference.
      properties:
        url:
          type: string
          description: Archive location url.
          format: uri
        prefix:
          $ref: '#/components/schemas/prefix_schema'
        postfix:
          $ref: '#/components/schemas/postfix_schema'
      required: [ url ]

    samba_reference:
      type: object
      description: Samba reference.
      properties:
        host:
          type: string
          description: Samba server host (IP).
        port:
          type: integer
          description: Samba port.
          minimum: 1
          maximum: 65535
          default: 445
        path:
          type: string
          description: Path to directory with images
        prefix:
          $ref: '#/components/schemas/prefix_schema'
        postfix:
          $ref: '#/components/schemas/postfix_schema'
      required: [ host ]

    samba_reference_required:
      allOf:
        - $ref: '#/components/schemas/samba_reference'
        - required: [ host, port, user, password, path ]

    samba_authorization:
      type: object
      description: |
        Samba authorization.

        If no authorization data, connect to samba will be like guest.
      properties:
        user:
          type: string
          description: Samba user.
        password:
          type: string
          description: Samba server password.
      required: [user, password]

    estimator_samba_data:
      type: object
      description: Samba.
      properties:
        source_type:
          type: string
          enum: ["samba"]
          description: Data type where images are located.
        reference:
          $ref: '#/components/schemas/samba_reference'
        authorization:
          $ref: '#/components/schemas/samba_authorization'
        recursive:
          type: boolean
          default: true
          description: Whether to estimate images from samba subdirectories recursively.
      required: [reference]

    estimator_samba_data_required:
      allOf:
        - $ref: '#/components/schemas/estimator_samba_data'
        - properties:
            reference:
              $ref: '#/components/schemas/samba_reference_required'
        - required: [ source, type, reference, recursive ]

    ftp_reference:
      type: object
      description: FTP server reference.
      properties:
        host:
          type: string
          description: FTP server host (IP or hostname).
        port:
          type: integer
          description: FTP server port.
          minimum: 1
          maximum: 65535
          default: 21
        max_sessions:
          type: integer
          description: Maximum number of allowed FTP sessions on server.
          minimum: 1
          maximum: 50
          default: 8
        path:
          type: string
          description: Path to directory with images.
        prefix:
          $ref: '#/components/schemas/prefix_schema'
        postfix:
          $ref: '#/components/schemas/postfix_schema'
      required: [host]

    ftp_reference_required:
      allOf:
        - $ref: '#/components/schemas/ftp_reference'
        - required: [host, port, user, password, max_sessions, path]

    ftp_authorization:
      type: object
      description: FTP authorization.
      properties:
        user:
          type: string
          description: FTP server user.
          default: anonymous
        password:
          type: string
          description: FTP server password.
          default: anonymous
      required: [user, password]

    estimator_ftp_server_data:
      type: object
      description: FTP server.
      properties:
        source_type:
          type: string
          enum: ["ftp"]
          description: Data type where images are located.
        reference:
          $ref: '#/components/schemas/ftp_reference'
        authorization:
          $ref: '#/components/schemas/ftp_authorization'
        recursive:
          type: boolean
          default: true
          description: Whether to estimate images from ftp subdirectories recursively.
      required: [reference]

    estimator_ftp_server_data_required:
      allOf:
        - $ref: '#/components/schemas/estimator_ftp_server_data'
        - properties:
            reference:
              $ref: '#/components/schemas/ftp_reference_required'
        - required: [source, type, reference, recursive]

    network_disk_reference:
      type: object
      description: Network disk reference.
      properties:
        path:
          type: string
          description: Absolute mounted directory path.
        prefix:
          $ref: '#/components/schemas/prefix_schema'
        postfix:
          $ref: '#/components/schemas/postfix_schema'
        follow_links:
          $ref: '#/components/schemas/follow_links'
      required: [path]

    estimator_mounted_network_path:
      type: object
      description: Mounted network disk.
      properties:
        source_type:
          type: string
          enum: ["network_disk"]
          description: Network disk source must be configured properly. See luna-tasks development manual for more information.
        reference:
          $ref: '#/components/schemas/network_disk_reference'
        recursive:
          type: boolean
          default: true
          description: Whether to estimate images from bucket subdirectories recursively.
      required: [reference]

    estimator_mounted_network_path_required:
      allOf:
        - $ref: '#/components/schemas/estimator_mounted_network_path'
        - required: [source_type, reference, recursive]

    estimator_source_with_option_zip:
      allOf:
        - $ref: '#/components/schemas/estimator_authorization_by_password'
        - $ref: '#/components/schemas/base_estimator_task_content_source'

    estimator_source_with_option_network_disk:
      allOf:
        - $ref: '#/components/schemas/estimator_mounted_network_path'
        - $ref: '#/components/schemas/base_estimator_task_content_source'

    estimator_source_with_option_ftp:
      allOf:
        - $ref: '#/components/schemas/estimator_ftp_server_data'
        - $ref: '#/components/schemas/base_estimator_task_content_source'

    estimator_source_with_option_samba:
      allOf:
        - $ref: '#/components/schemas/estimator_samba_data'
        - $ref: '#/components/schemas/base_estimator_task_content_source'

    estimator_source_with_option_zip_required:
      allOf:
        - $ref: '#/components/schemas/estimator_authorization_by_password'
        - $ref: '#/components/schemas/base_estimator_task_content_source_required'

    estimator_source_with_option_network_disk_required:
      allOf:
        - $ref: '#/components/schemas/estimator_mounted_network_path_required'
        - $ref: '#/components/schemas/base_estimator_task_content_source_required'

    estimator_source_with_option_ftp_required:
      allOf:
        - $ref: '#/components/schemas/estimator_ftp_server_data_required'
        - $ref: '#/components/schemas/base_estimator_task_content_source_required'

    estimator_source_with_option_samba_required:
      allOf:
        - $ref: '#/components/schemas/estimator_samba_data_required'
        - $ref: '#/components/schemas/base_estimator_task_content_source_required'

    s3_reference:
      type: object
      description: S3-like storage reference.
      properties:
        endpoint:
          type: string
          description: Storage endpoint.
          format: uri
        bucket_name:
          type: string
          description: |
            one of the following options:<ul>
            <li>raw bucket name (in this case, `endpoint` must be specified)</li>
            <li>access point ARN (in this case, `endpoint` and `region` must not be specified)
            (see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">aws userguide</a> for details)</li>
            <li>outpost ARN (in this case, `endpoint` and `region` must not be specified)
            (see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">aws userguide</a> for details)</li>
            </ul>
        prefix:
          type: string
          description: |
            File key prefix, also can be used to download from specific folder
            (see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html"> aws userguide</a> for details).
        region:
          type: string
          description: Bucket region.
      required: [bucket_name]

    s3_authorization:
      type: object
      description: S3-like authorization.
      properties:
        public_access_key:
          type: string
          description: Public access key.
        secret_access_key:
          type: string
          description: Secret access key.
        signature_version:
          type: string
          enum: [ s3v2, s3v4 ]
          default: s3v4
          description: Authorization signature version.
        verify_ssl:
          type: boolean
          default: true
          description: Enable SSL certificate verification.
      required: [public_access_key, secret_access_key]

    s3_authorization_required:
      allOf:
        - $ref: '#/components/schemas/s3_authorization'
        - required: [public_access_key, secret_access_key, signature_version]

    estimator_authorization_s3_like_storage:
      type: object
      description: S3-like storages auth data.
      properties:
        source_type:
          type: string
          enum: ["s3"]
          description: Data type where images are located.
        reference:
          $ref: '#/components/schemas/s3_reference'
        authorization:
          $ref: '#/components/schemas/s3_authorization'
        recursive:
          type: boolean
          default: true
          description: Whether to estimate images from bucket subdirectories recursively.
        save_origin:
          type: boolean
          default: true
          description: Whether to save image origin.
      required: [reference]

    estimator_authorization_s3_like_storage_required:
      allOf:
        - $ref: "#/components/schemas/estimator_authorization_s3_like_storage"
        - properties:
            reference:
              $ref: '#/components/schemas/s3_reference'
            authorization:
              $ref: '#/components/schemas/s3_authorization_required'
        - required: [source_type, reference, recursive, save_origin]

    estimator_source_with_option_s3bucket:
      allOf:
        - $ref: '#/components/schemas/estimator_authorization_s3_like_storage'
        - $ref: '#/components/schemas/base_estimator_task_content_source'

    estimator_source_with_option_s3bucket_required:
      allOf:
        - $ref: '#/components/schemas/estimator_authorization_s3_like_storage_required'
        - $ref: '#/components/schemas/base_estimator_task_content_source_required'

    prefix_schema:
      type: string
      description: |
        File key prefix, also can be used to download from specific folder.

        Example file tree and prefixes:
        ```
        .
        ├── prefix
        │   ├── 123_file.jpg
        │   └── file2.jpg
        ├── temp_file.jpg
        └── prefix_file.jpg
        ```

        | prefix        | result files                                           |
        |---------------|--------------------------------------------------------|
        | prefix        | prefix/file2.jpg, prefix/123_file.jpg, prefix_file.jpg |
        | prefix/       | prefix/file2.jpg, prefix/123_file.jpg                  |
        | prefix/123    | prefix/123_file.jpg                                    |
        | temp          | temp_file.jpg                                          |

    postfix_schema:
      type: string
      description: |
        File key postfix, also can be used to download files with specific extension.

        Example file tree and postfixes:
        ```
        .
        ├── dir
        │   ├── face1.jpg
        │   └── face2.png
        ├── temp_file.png
        └── file.jpg
        ```

        | postfix       | result files                          |
        |---------------|---------------------------------------|
        | .jpg          | dir/face1.jpg, file.jpg               |
        | .png          | dir/face2.png, temp_file.png          |


    estimator_task_content_handler:
      description: |
        Handler for estimator task.

        You can create a new static handler and specify policies for it or specify an existing static or dynamic handler. For the existing dynamic handler, you can specify policies.

        The same dynamic handler can be used in different estimator tasks, and it is not required to create a new handler for each task.
      oneOf:
        - $ref: '#/components/schemas/new_handler_task_estimator'
        - $ref: '#/components/schemas/existing_handler_task_estimator'

    estimator_task_content_filters:
      type: object
      description: Estimator filters.
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'

    estimator_task_content_source:
      description: Images source.
      oneOf:
        - $ref: '#/components/schemas/estimator_source_with_option_zip'
        - $ref: '#/components/schemas/estimator_source_with_option_s3bucket'
        - $ref: '#/components/schemas/estimator_source_with_option_network_disk'
        - $ref: '#/components/schemas/estimator_source_with_option_ftp'
        - $ref: '#/components/schemas/estimator_source_with_option_samba'
      discriminator:
        propertyName: "source_type"
        mapping:
          zip: '#/components/schemas/estimator_source_with_option_zip'
          s3: '#/components/schemas/estimator_source_with_option_s3bucket'
          network_disk: '#/components/schemas/estimator_source_with_option_network_disk'
          ftp: '#/components/schemas/estimator_source_with_option_ftp'
          samba: '#/components/schemas/estimator_source_with_option_samba'

    estimator_task_content_source_schedulable:
      description: Images source.
      oneOf:
        - $ref: '#/components/schemas/estimator_source_with_option_s3bucket'
        - $ref: '#/components/schemas/estimator_source_with_option_network_disk'
        - $ref: '#/components/schemas/estimator_source_with_option_ftp'
        - $ref: '#/components/schemas/estimator_source_with_option_samba'
      discriminator:
        propertyName: "source_type"
        mapping:
          s3: '#/components/schemas/estimator_source_with_option_s3bucket'
          network_disk: '#/components/schemas/estimator_source_with_option_network_disk'
          ftp: '#/components/schemas/estimator_source_with_option_ftp'
          samba: '#/components/schemas/estimator_source_with_option_samba'

    estimator_task_content_source_required:
      description: Images source.
      oneOf:
        - $ref: '#/components/schemas/estimator_source_with_option_zip_required'
        - $ref: '#/components/schemas/estimator_source_with_option_s3bucket_required'
        - $ref: '#/components/schemas/estimator_source_with_option_network_disk_required'
        - $ref: '#/components/schemas/estimator_source_with_option_ftp_required'
        - $ref: '#/components/schemas/estimator_source_with_option_samba_required'
      discriminator:
        propertyName: "source_type"
        mapping:
          zip: '#/components/schemas/estimator_source_with_option_zip_required'
          s3: '#/components/schemas/estimator_source_with_option_s3bucket_required'
          network_disk: '#/components/schemas/estimator_source_with_option_network_disk_required'
          ftp: '#/components/schemas/estimator_source_with_option_ftp_required'
          samba: '#/components/schemas/estimator_source_with_option_samba_required'

    estimator_task_content:
      type: object
      description: Estimator task content.
      properties:
        handler:
          $ref: '#/components/schemas/estimator_task_content_handler'
        source:
          $ref: '#/components/schemas/estimator_task_content_source'
      required: [handler, source]

    estimator_task_content_for_schedule:
      type: object
      description: Estimator task content.
      properties:
        handler:
          $ref: '#/components/schemas/estimator_task_content_handler'
        source:
          $ref: '#/components/schemas/estimator_task_content_source_schedulable'
      required: [handler, source]

    estimator_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [9]
        content:
          $ref: '#/components/schemas/estimator_task_content_for_schedule'

    estimator_task_content_required:
      type: object
      description: Estimator task content.
      properties:
        handler:
          $ref: '#/components/schemas/estimator_task_content_handler'
        source:
          $ref: '#/components/schemas/estimator_task_content_source_required'
        filters:
          $ref: '#/components/schemas/estimator_task_content_filters'
      required: [handler, source, filters]

    estimator_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/estimator_task_content'

    schedule_estimator_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/estimator_content_props"

    schedule_estimator_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [9]
        content:
          type: object
          description: estimator task content
          properties:
            handler:
              $ref: '#/components/schemas/estimator_task_content_handler'
            source:
              $ref: '#/components/schemas/estimator_task_content_source_schedulable'
            filters:
              $ref: '#/components/schemas/estimator_task_content_filters'
          required: [handler, source, filters]

    success_estimator_result:
      description: Estimator task result.
      type: array
      items:
        type: object
        properties:
          filename:
            type: string
            description: Source image file name.
          result:
            type: object
            description: Image estimation result.
            nullable: true
            properties:
              events:
                description: Events created from image.
                type: array
                items:
                  $ref: '#/components/schemas/event_from_handler'
              filtered_detections:
                $ref: '#/components/schemas/event_filtered_detections'
            required: [events, filtered_detections]
          errors:
            type: array
            items:
              $ref: '#/components/schemas/Error'
            minItems: 0
            description: Image processing errors in handlers.
        required: [filename, errors]

    EstimatorTaskResult:
      type: object
      description: Estimator task result.
      properties:
        result:
          $ref: '#/components/schemas/success_estimator_result'
        errors:
          $ref: '#/components/schemas/TaskErrorsArray'
      required: [ errors, result ]

    ReporterTaskContentWithoutFilters:
      type: object
      description: Reporter task content.
      properties:
        columns:
          description: The names of columns in the CSV report. Order of fields determines the order of the columns in the report.
          anyOf:
            - $ref: '#/components/schemas/ReportEventColumns'
            - $ref: '#/components/schemas/ReportFaceColumns'
          example: [ "face_id", "user_data", "create_time" ]
        csv_delimiter:
          default: ','
          type: string
          description: CSV delimiter.
          maxLength: 1
          minLength: 1
          example: '$'
        save_images:
          default: 0
          type: integer
          enum: [ 0, 1 ]
          description: "Whether to save object images. If set, images for each object will be loaded: first sample for an event, avatar for face. Image will be ignored if not available."
          example: 1

    reporter_task_content:
      allOf:
        - $ref: '#/components/schemas/ReporterTaskContentWithoutFilters'
        - properties:
            filters:
              type: object
              description: Reporter task objects' filters.
              properties:
                task_id:
                  description: ID of task.
                  type: integer
                  example: 146
                account_id:
                  $ref: '#/components/schemas/account_id'
              required: [ task_id ]
      required: [ filters ]

    reporter_task_content_reply:
      allOf:
      - properties:
          filters:
            properties:
              account_id:
                $ref: '#/components/schemas/account_id'
            required: [ task_id, account_id ]
      - $ref: '#/components/schemas/reporter_task_content'

    ReportEventColumns:
      type: array
      items:
        description: |
          Event columns. Default is ["event_id", "create_time", "end_time", "external_id", "handler_id", "source", "top_match", "face_id", "gender", "age",
          "emotion", "ethnic_group", "user_data", "city", "area", "district", "street", "house_number",
          "geo_position", "mask", "track_id", "body_basic_attributes", "upper_body", "lower_body", "accessories", "meta"].
        type: string
        enum: ["event_id", "create_time", "end_time", "external_id", "handler_id", "stream_id", "source", "top_match", "match_result", "face_detections", "body_detections",
               "face_id", "attach_result", "gender", "age", "emotion", "ethnic_group", "tags", "user_data", "city",
               "area", "district", "street", "house_number", "geo_position", "mask", "track_id", "liveness", "deepfake",
               "body_basic_attributes", "upper_body", "lower_body", "accessories", "meta"]
      default: ["event_id","create_time", "end_time", "external_id", "handler_id", "stream_id", "source", "top_match",
                "face_id", "gender", "age", "emotion", "ethnic_group", "user_data", "city", "area", "district",
                "street", "house_number", "geo_position", "mask", "track_id", "liveness", "deepfake", "body_basic_attributes",
                "upper_body", "lower_body", "accessories", "meta"]

    ReportFaceColumns:
      type: array
      items:
        description: Face columns. Default is ["user_data", "create_time", "external_id", "avatar", "event_id"].
        type: string
        enum: ["user_data", "create_time", "lists", "external_id", "avatar", "event_id"]

    reporter_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/reporter_task_content'

    detect_json_with_base_64:
      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 MIME type.
        face_bounding_boxes:
          allOf:
            - description: Array with face bounding boxes for image (now only one bounding box is supported).
            - $ref: '#/components/schemas/base_bounding_boxes'
      required: [image, mimetype, face_bounding_boxes]

    detect_json_request_body_urls:
      type: object
      properties:
        urls:
          type: array
          items:
            type: object
            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 only one bounding box is supported).
                  - $ref: '#/components/schemas/base_bounding_boxes'
            required: [url]
          minItems: 1
          maxItems: 8
      required: [urls]

    list_samples:
      type: object
      properties:
        samples:
          type: array
          items:
            $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:
          allOf:
          - $ref: '#/components/schemas/detect_time'
          description: Detection time.
        detect_ts:
          $ref: '#/components/schemas/detect_ts'
        image_origin:
          $ref: '#/components/schemas/image_origin_not_nullable_base64_json'
        image_origin_mimetype:
          $ref: '#/components/schemas/image_origin_mimetype'
        meta:
          $ref: '#/components/schemas/event_meta_common'
      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 and/or image origins.

        meta:
          allOf:
            - $ref: '#/components/schemas/event_meta_common'
          description: |
            Mutual event meta.
            If no particular meta is specified for an individual sample, the mutual meta will be used for it.
            For requests with aggregation, only the mutual meta will be set for the aggregated event, and particular
            ones will be ignored.
      required: [ samples ]
      example:
        samples:
          - sample_id: "c724fea1-d1bb-44c5-af6d-9833d22f3eb7"
            detect_time: "2018-08-11T09:11:41.674Z"
            detect_ts: 123.456
            image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
            meta:
              key: value

    detect_json_request_body:
      oneOf:
      - $ref: '#/components/schemas/detect_json_with_base_64'
      - $ref: '#/components/schemas/detect_json_request_body_urls'
      - $ref: '#/components/schemas/list_samples'

    emit_event_json_with_base_64:
      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", "application/x-sdk-descriptor-base64", "application/x-vl-xpk-base64" ]
          description: Image MIME type.
        detect_time:
          $ref: '#/components/schemas/detect_time'
        detect_ts:
          $ref: '#/components/schemas/detect_ts'
        face_bounding_boxes:
          allOf:
            - description: Array with face bounding boxes for image (now only one bounding box is supported).
            - $ref: '#/components/schemas/base_bounding_boxes'
        body_bounding_boxes:
          allOf:
            - description: Array with body bounding boxes for image (now only one bounding box is supported).
            - $ref: '#/components/schemas/base_bounding_boxes'
        image_origin:
          $ref: '#/components/schemas/image_origin_not_nullable_base64_json'
        image_origin_mimetype:
          $ref: '#/components/schemas/image_origin_mimetype'
        meta:
          $ref: '#/components/schemas/event_meta_common'
      example:
        image: string
        mimetype: image/x-jpeg-base64
        detect_time: 2018-08-11T09:11:41.674Z
        detect_ts: 123.456
        face_bounding_boxes:
          - height: 240
            width: 209
            x: 170
            y: 198
        body_bounding_boxes:
          - height: 240
            width: 209
            x: 170
            y: 198
        image_origin: /6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e
        meta:
          key: value
      required: [ image, mimetype ]

    emit_event_json_request_body_urls:
      type: object
      properties:
        urls:
          type: array
          items:
            type: object
            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"
              detect_time:
                $ref: '#/components/schemas/detect_time'
              detect_ts:
                $ref: '#/components/schemas/detect_ts'
              face_bounding_boxes:
                allOf:
                  - description: Array with face bounding boxes for image (now only one bounding box is supported).
                  - $ref: '#/components/schemas/base_bounding_boxes'
              body_bounding_boxes:
                allOf:
                  - description: Array with body bounding boxes for image (now only one bounding box is supported).
                  - $ref: '#/components/schemas/base_bounding_boxes'
              image_origin:
                $ref: '#/components/schemas/image_origin_not_nullable_base64_json'
              image_origin_mimetype:
                $ref: '#/components/schemas/image_origin_mimetype'
              meta:
                $ref: '#/components/schemas/event_meta_common'
            required: [ url ]
          minItems: 1
          maxItems: 8
        meta:
          allOf:
            - $ref: '#/components/schemas/event_meta_common'
          description: |
            Mutual event meta.
            If no particular meta is specified for an individual URL, the mutual meta will be used for it.
            For requests with aggregation, only the mutual meta will be set for the aggregated event, and particular
            ones will be ignored.
      example:
        urls:
          - url: https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Abbey_Lee_2015.jpg/800px-Abbey_Lee_2015.jpg
            detect_time: 2018-08-11T09:11:41.674Z
            detect_ts: 123.456
            face_bounding_boxes:
              - height: 240
                width: 209
                x: 170
                y: 198
            body_bounding_boxes:
              - height: 240
                width: 209
                x: 170
                y: 198
            image_origin: /6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e
            meta:
              key: value
        meta:
          key: value
      required: [ urls ]

    emit_event_json_request_body:
      oneOf:
        - $ref: '#/components/schemas/emit_event_json_with_base_64'
        - $ref: '#/components/schemas/emit_event_json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'
        - $ref: '#/components/schemas/samples_for_detection'

    CrossMatchTaskReferenceFilters:
      description: Object filters for references.
      anyOf:
        - $ref: '#/components/schemas/task_face_filters_no_account'
        - $ref: '#/components/schemas/task_event_filters_no_account'
        - $ref: '#/components/schemas/task_attribute_filters'

    CrossMatchTaskCandidateFilters:
      description: Object filters for candidates.
      anyOf:
        - $ref: '#/components/schemas/task_face_filters_no_account'
        - $ref: '#/components/schemas/task_event_filters_no_account'
        - $ref: '#/components/schemas/task_attribute_filters'

    CrossMatchTaskReferenceFiltersReply:
      description: Object filters for references.
      anyOf:
        - $ref: '#/components/schemas/faces_filters_no_account_reply'
        - $ref: '#/components/schemas/events_filters_no_account_reply'
        - $ref: '#/components/schemas/task_attribute_filters'

    CrossMatchTaskCandidateFiltersReply:
      description: Object filters for candidates.
      anyOf:
        - $ref: '#/components/schemas/faces_filters_no_account_reply'
        - $ref: '#/components/schemas/events_filters_no_account_reply'
        - $ref: '#/components/schemas/task_attribute_filters'

    CrossMatchTaskContentNoFilters:
      type: object
      description: Cross match task content.
      properties:
        filters:
          description: Task objects' filters.
          type: object
          properties:
            reference_type:
              $ref: '#/components/schemas/common_objects_type'
            candidate_type:
              $ref: '#/components/schemas/common_objects_type'
            descriptor:
              $ref: '#/components/schemas/descriptor_info'
            account_id:
              allOf:
                - $ref: '#/components/schemas/account_id'
              description: |
                Luna Account Id. Data with the specified "account_id" will be used for the task.
                
                The value is empty by default for account types "advanced_user" and "admin".
                Data from all accounts is used if the required "account_id" is not specified.
                In this case, processing the task can take considerable time.
                
                For the "user" account type the value is automatically replaced with the current "account_id" of the account.
          required: [ reference_type, candidate_type, reference_filters, candidate_filters ]
          example:
            reference_type: "events"
            candidate_type: "faces"
            reference_filters:
              gender: 1
              sources: "Main_hall_camera"
            candidate_filters:
              create_time__gte: "2018-02-11T09:11:41.674Z"
              create_time__lt: "2020-02-12T09:11:41.674Z"
              list_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
        threshold:
          description: The minimum acceptable degree of similarity. If the similarity of two descriptors is lower then the specified value, the matching result will be ignored. References with all filtered matches also will be ignored.
          type: number
          format: double
          maximum: 1
          minimum: 0
          example: 0.5
          default: 0.0
        limit:
          description: Maximum number of matching candidates returned for every match.
          type: integer
          minimum: 1
          example: 3
          default: 5
      required: [ filters ]

    cross_match_task_content:
      allOf:
        - $ref: '#/components/schemas/CrossMatchTaskContentNoFilters'
      properties:
        filters:
          type: object
          properties:
            reference_filters:
              $ref: '#/components/schemas/CrossMatchTaskReferenceFilters'
            candidate_filters:
              $ref: '#/components/schemas/CrossMatchTaskCandidateFilters'

    CrossMatchTaskContentReply:
      allOf:
        - $ref: '#/components/schemas/CrossMatchTaskContentNoFilters'
      properties:
        filters:
          type: object
          properties:
            reference_filters:
              $ref: '#/components/schemas/CrossMatchTaskReferenceFiltersReply'
            candidate_filters:
              $ref: '#/components/schemas/CrossMatchTaskCandidateFiltersReply'

    cross_match_task_content_reply:
      allOf:
      - properties:
          filters:
            properties:
              account_id:
                $ref: '#/components/schemas/account_id'
            required: [reference_type, candidate_type, reference_filters, candidate_filters]
      - $ref: '#/components/schemas/CrossMatchTaskContentReply'

    cross_match_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/cross_match_task_content'

    CrossMatchTaskResult:
      description: Cross Match task result.
      type: object
      properties:
        result:
          description: Task result.
          type: array
          items:
            type: object
            properties:
              reference_id:
                description: Reference ID. The ID corresponds to the specified reference type. The reference type is specified in the `reference_type` field on the `filters` section of the "cross-matching tasks" request.
                allOf:
                - $ref: '#/components/schemas/uuid'
              candidates:
                description: Match candidates for the reference.
                type: array
                items:
                  type: object
                  description: Match with a candidate.
                  properties:
                    candidate_id:
                      description: Candidate ID (see `candidate_type` field in CrossMatchTask filters).
                      allOf:
                      - $ref: '#/components/schemas/uuid'
                    similarity:
                      description: Similarity for the reference - candidate pair.
                      type: number
                      minimum: 0
                      maximum: 1
                  required: [candidate_id, similarity]
                minItems: 1
            required: [reference_id, candidates]
          example:
            - reference_id: e99d42df-6859-4ab7-98d4-dafd18f47f30
              candidates:
                - candidate_id: 93de0ea1-0d21-4b67-8f3f-d871c159b740
                  similarity: 0.548252
                - candidate_id: 54860fc6-c726-4521-9c7f-3fa354983e02
                  similarity: 0.62344
            - reference_id: 345af6e3-625b-4f09-a54c-3be4c834780d
              candidates:
                - candidate_id: 6ade1494-1138-49ac-bfd3-29e9f5027240
                  similarity: 0.7123213
                - candidate_id: e0e3c474-9099-4fad-ac61-d892cd6688bf
                  similarity: 0.9543
        errors:
          description: Errors occurred during the task processing.
          allOf:
          - $ref: '#/components/schemas/TaskErrorsArray'
      required: [errors]

    markup_face_items:
      type: object
      properties:
        face_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Face ID.
        label:
          type: integer
          description: Face label (group ID).
          example: 12
      required: [ face_id, label ]

    markup_attribute_items:
      type: object
      properties:
        attribute_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Attribute ID.
        label:
          type: integer
          description: Attribute label (group ID).
          example: 12
      required: [ attribute_id, label ]

    roc_task_content:
      description: ROC-curve calculating task content.
      type: object
      properties:
        markup:
          description: Markup of face or attribute IDs to labels (group IDs).
          type: array
          minItems: 2
          items:
            oneOf:
              - $ref: '#/components/schemas/markup_face_items'
              - $ref: '#/components/schemas/markup_attribute_items'
        filters:
          type: object
          properties:
            account_id:
              $ref: '#/components/schemas/account_id'
        threshold_hit_top:
          allOf:
            - $ref: '#/components/schemas/number01'
          description: Similarity threshold to calculate hit into the top-N.
          example: 0.95
          default: 0
        limit:
          description: Maximum candidates count for every match.
          type: integer
          minimum: 1
          example: 100
          default: 5
        key_FPRs:
          description: ROC-curve key FPR values.
          type: array
          items:
            $ref: '#/components/schemas/number01'
          minItems: 0
          example: [ 0.000001, 0.001 ]
      required: [ markup, filters ]

    roc_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/roc_task_content'

    ROCpoints:
      type: object
      properties:
        FPR:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: False positive rate.
        TPR:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: True positive rate.
        similarity:
          allOf:
            - $ref: '#/components/schemas/number01'
            - description: Similarity threshold.
      required: [FPR, TPR, similarity]

    ROCTaskResult:
      description: ROC-curve calculating task result.
      type: object
      properties:
        result:
          description: ROC-curve calculation result.
          type: object
          properties:
            roc:
              type: array
              items:
                $ref: '#/components/schemas/ROCpoints'
              description: ROC-curve points.
              example:
                - FPR: 0.1
                  TPR: 0.95
                  similarity: 0.9
                - FPR: 0.15
                  TPR: 0.96
                  similarity: 0.8
            hit_top_probability:
              type: object
              description: Probability of hit into the top.
              properties:
                top-1:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                    - description: Probability of hit into the top-1.
                    - nullable: true
                top-2:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                    - description: Probability of hit into the top-2.
                    - nullable: true
                top-3:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                    - description: Probability of hit into the top-3.
                    - nullable: true
                top-4:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                    - description: Probability of hit into the top-4.
                    - nullable: true
                top-5:
                  allOf:
                    - $ref: '#/components/schemas/number01'
                    - description: Probability of hit into the top-5.
                    - nullable: true
              required: [top-1, top-2, top-3, top-4, top-5]
              example:
                top-1: 0.995
                top-2: 0.997
                top-3: 0.999
                top-4: 0.999
                top-5: 0.999
            auc:
              allOf:
                - $ref: '#/components/schemas/number01'
                - description: Area under the ROC-curve.
                - example: 0.99
            type_I_and_II_error_rates_equal_point:
              allOf:
                - $ref: '#/components/schemas/ROCpoints'
                - description: ROC-curve point where type I error rate (TPR) and type II error rate (FPR) are equal, i.e. intersection point of the ROC-curve and the secondary main diagonal.
                - example:
                    FPR: 0.15
                    TPR: 0.85
                    similarity: 0.8
                - nullable: true
            key_points:
              type: array
              items:
                $ref: '#/components/schemas/ROCpoints'
              description: ROC-curve points.
              example:
                - FPR: 0.000001
                  TPR: 0.95
                  similarity: 0.9
                - FPR: 0.001
                  TPR: 0.96
                  similarity: 0.8
              nullable: true
          required: [roc, hit_top_probability, auc, type_I_and_II_error_rates_equal_point, key_points]
        errors:
          $ref: '#/components/schemas/TaskErrorsArray'
      required: [errors]

    ListOfUrlsWithImages:
      type: array
      items:
        type: string
        format: uri-reference
      minItems: 1
      maxItems: 8
      description: List of URLs with images.
      example:
        - "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Abbey_Lee_2015.jpg/800px-Abbey_Lee_2015.jpg"
        - "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg"

    LivenessMeta:
      type: object
      required: [ OS ]
      properties:
        OS:
          type: string
          enum: [ "IOS", "ANDROID", "DESKTOP", "UNKNOWN" ]
          description: Device OS.
        MANUFACTURE:
          type: string
          description: Device manufacturer.
        MODEL:
          type: string
          description: Device model.
      description: |
        Device information. This information can significantly decrease the overall error rate.

        The "meta" object is not mandatory. If you are not sure about any of the parameters, set "UNKNOWN" value or don't pass meta.

        > The specified meta is applied to all the images within the request.
      deprecated: true

    liveness_probability:
      type: number
      format: double
      description: |
        The parameter shows the probability of a live person being present in the
        image, i.e. it is not a presentation attack.

        In general, the estimated probability must exceed the theoretical
        threshold of 50%. The value may be increased according to your business rules.
      example: 0.99

    liveness_quality:
      type: number
      format: double
      description: |
        Liveness quality value is a probability of "appropriate image".
        The parameter describes the integral value of image, facial and environmental characteristics.
      example: 1.0

    liveness_prediction:
      type: string
      enum: [real, spoof, unknown]
      description: Liveness prediction.

    liveness_result:
      type: object
      description: Liveness prediction result.
      properties:
        prediction:
          $ref: '#/components/schemas/liveness_prediction'
        estimations:
          type: object
          description: Liveness estimations result.
          properties:
            score:
              $ref: '#/components/schemas/liveness_probability'
            quality:
              $ref: '#/components/schemas/liveness_quality'
          required: [score, quality]
      required: [prediction, estimations]

    liveness_handler_result:
      type: object
      description: Liveness prediction result.
      properties:
        prediction:
          $ref: '#/components/schemas/liveness_state'
        estimations:
          type: object
          description: Liveness estimations result.
          properties:
            probability:
              $ref: '#/components/schemas/liveness_probability'
            quality:
              $ref: '#/components/schemas/liveness_quality'
          required: [ probability, quality ]
      required: [ prediction, estimations ]

    liveness_aggregate_result:
      type: object
      description: Aggregated liveness prediction result.
      properties:
        prediction:
          $ref: '#/components/schemas/liveness_state'
        estimations:
          type: object
          description: Aggregated liveness estimations result.
          properties:
            probability:
              allOf:
                - description: |
                    Average probability that a live person is present in the image.

                    In general, the estimated probability must exceed the theoretical
                    threshold of 50%. The value may be increased according to your business rules.
                - $ref: '#/components/schemas/liveness_probability'
            quality:
              allOf:
                - description: |
                    Average value of estimate quality.

                    The parameter describes the integral value of image, facial, and environmental characteristics.
                    Estimated quality must exceed the theoretical threshold of 20%.
                    The threshold may be increased according to the photo shooting conditions.
                - $ref: '#/components/schemas/liveness_quality'
          required: [probability, quality]
      required: [prediction, estimations]

    liveness_response:
      type: object
      properties:
        images:
          description: List of processed images.
          type: array
          items:
            type: object
            properties:
              filename:
                type: string
                example: "claudia.jpg"
                description: |
                  Source image file name (preserved only for multipart-form-data and application/json requests,
                  otherwise "raw_image").
              status:
                type: integer
                enum: [0, 1]
                description: Image status. 0 - liveness prediction failed, 1 - liveness prediction succeeded.
              liveness:
                allOf:
                  - nullable: true
                  - $ref: '#/components/schemas/liveness_handler_result'
              error:
                allOf:
                  - $ref: '#/components/schemas/Error'
                description: Errors occurred during the liveness processing.
            required: [filename, status, liveness, error]
        aggregate_estimations:
          type: object
          description: Liveness result with aggregate estimates.
          properties:
            liveness:
              $ref: '#/components/schemas/liveness_aggregate_result'
          required: [liveness]
      required: [images]
      example:
        images:
          - filename: succeeded_image.jpg
            status: 1
            liveness:
              prediction: 1
              estimations:
                probability: 0.93
                quality: 0.95
            error:
              desc: Success
              detail: Success
              error_code: 0
              link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
          - filename: succeeded_image_2.jpg
            status: 1
            liveness:
              prediction: 1
              estimations:
                probability: 0.85
                quality: 0.88
            error:
              desc: Success
              detail: Success
              error_code: 0
              link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
          - filename: failed_image.jpg
            status: 0
            liveness: null
            error:
              desc: Failed to decode image data
              detail: File decoding error
              error_code: 32010
              link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-32010

        aggregate_estimations:
          liveness:
            prediction: 1
            estimations:
              probability: 0.89
              quality: 0.915

    deepfake_prediction:
      type: string
      enum: [real, fake]
      description: Deepfake prediction.

    deepfake_probability:
      type: number
      format: double
      description: |
        The parameter shows the probability of a person in the image being created via deepfake.

        In general, the estimated probability must exceed the theoretical
        threshold of 50%. The value may be increased according to your business rules.
      example: 0.99

    deepfake_result:
      type: object
      description: Liveness prediction result.
      properties:
        prediction:
          $ref: '#/components/schemas/deepfake_prediction'
        score:
          $ref: '#/components/schemas/deepfake_probability'
      required: [prediction, score]

    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

    image:
       type: string
       format: binary
       description: |
                    Content-Disposition header must contain actual filename.

                    It is only possible to send several 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 only one bounding box is supported).
                - $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 only one bounding box is supported).
              - $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/image'
          face_bounding_boxes:
            $ref: '#/components/schemas/face_bounding_boxes'
          body_bounding_boxes:
            $ref: '#/components/schemas/body_bounding_boxes'
        required: [image]

    raw_data_binary_for_multipart:
      type: string
      format: binary
      description: |
        Binary image or raw descriptor data (SDK descriptor 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")
        
        User-defined headers to be passed to the Luna Image Store when saving an image should be specified in the format
        `X-Luna-Meta-<user_defined_key>: <user_defined_value>` (will be skipped if the image origin is specified for the image).

    raw_data_base64_for_multipart:
      type: string
      description: |
        Image or descriptor data (SDK descriptor or XPK file) encoded in base64.

        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/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")

        User-defined headers to be passed to the Luna Image Store when saving an image should be specified in the format
        `X-Luna-Meta-<user_defined_key>: <user_defined_value>` (will be skipped if the image origin is specified for the image).

        See `bash` request sample.

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

        Content-Disposition header must contain actual filename.

        Filename is used to associate image origin with image, it must be the same as the image filename.

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

        User-defined headers to be passed to the Luna Image Store when saving an image origin should be specified in the format `X-Luna-Meta-<user_defined_key>: <user_defined_value>`.

    multipart_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

    multipart_image_detect_ts:
      type: array
      description: Map with image filename and detection timestamp relative to the start of the video.
      items:
        type: object
        properties:
          filename:
            type: string
            description: Image filename. It must be the same as one of 'image' request part filename.
          detect_ts:
            allOf:
            - $ref: '#/components/schemas/detect_ts'
            nullable: false
        required: [filename, detect_ts]
      minItems: 1

    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

    multipart_raw_data_schema:
      type: object
      properties:
        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'
      required: [image]

    image_origin_list:
      type: array
      description: Map with image filename and image origin.
      items:
        oneOf:
          - $ref: '#/components/schemas/image_origin_list_item_json'
          - $ref: '#/components/schemas/raw_data_image_origin_for_multipart'
      minItems: 1

    multipart_raw_data_schema_with_policies:
      type: object
      properties:
        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'
        policies:
          allOf:
            - description: The set of rules for the dynamic handler, which determine input images processing.
            - $ref: '#/components/schemas/Policies'
        image_detect_time:
          $ref: '#/components/schemas/multipart_image_detect_time'
        image_detect_ts:
          $ref: '#/components/schemas/multipart_image_detect_ts'
        image_origin:
          $ref: '#/components/schemas/image_origin_list'
        meta:
          allOf:
            - $ref: '#/components/schemas/event_meta'
          description: |
            Either a mutual event meta or a list of particular metas for individual images.
            For requests with aggregation, only the mutual meta will be set for the aggregated event, and particular
            ones will be ignored.
      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]

    estimate_people_count:
      type: object
      description: |
        People count estimation policy.

        ⚠ **People counter licensing feature is required to be enabled to perform estimation.**
      properties:
        estimate:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: Whether to estimate people count on the image.
        people_coordinates:
          allOf:
            - $ref: '#/components/schemas/int01'
            - description: Whether to return people coordinates.
            - default: 1

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

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

    json_request_body_urls:
      type: object
      properties:
        urls:
          type: array
          items:
            type: object
            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).
                  - $ref: '#/components/schemas/base_bounding_boxes'
            required: [url]
          minItems: 1
          maxItems: 8
      required: [urls]

    sdk_json_request_body_urls:
      type: object
      properties:
        urls:
          type: array
          items:
            type: object
            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 only one bounding box is supported).
                  - $ref: '#/components/schemas/base_bounding_boxes'
              body_bounding_boxes:
                allOf:
                  - description: Array with body bounding boxes for image (now only one bounding box is supported).
                  - $ref: '#/components/schemas/base_bounding_boxes'
            required: [url]
          minItems: 1
          maxItems: 8
      required: [urls]

    sdk_json_with_base_64:
      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 MIME type.
        face_bounding_boxes:
          allOf:
            - description: Array with face bounding boxes for image (now only one bounding box is supported).
            - $ref: '#/components/schemas/base_bounding_boxes'
        body_bounding_boxes:
          allOf:
            - description: Array with body bounding boxes for image (now only one bounding box is supported).
            - $ref: '#/components/schemas/base_bounding_boxes'
      required: [image, mimetype]

    iso_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 MIME type.
        face_bounding_boxes:
          allOf:
            - description: Array with face bounding boxes for image (now only one bounding box is supported).
            - $ref: '#/components/schemas/base_bounding_boxes'
      required: [ image, mimetype ]

    sdk_json_request_body:
      oneOf:
      - $ref: '#/components/schemas/sdk_json_with_base_64'
      - $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/iso_json_with_base_64_image'
        - $ref: '#/components/schemas/json_request_body_urls'
        - $ref: '#/components/schemas/list_samples'

    verify_json_with_base_64:
      type: object
      properties:
        image:
          type: string
          description: Image or 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 or descriptor MIME type.
        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]

    byte_string:
      type: string
      format: byte

    sdk_descriptor:
      type: string
      format: byte
      description: SDK descriptor (descriptor version, signature, descriptor bytes). It can be provided in Base64 format.

    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).

    sdk_face_attributes:
      allOf:
        - $ref: '#/components/schemas/attributes'
        - properties:
            descriptor:
              $ref: '#/components/schemas/extracted_sdk_descriptor'
            basic_attributes:
              $ref: '#/components/schemas/basic_attribute_with_estimations'
            mask:
              $ref: '#/components/schemas/masks_estimation'
            glasses:
              $ref: '#/components/schemas/glasses'
            liveness:
              $ref: '#/components/schemas/liveness'
            deepfake:
              $ref: '#/components/schemas/deepfake'

    liveness:
      type: object
      description: Liveness prediction.
      properties:
        prediction:
          type: string
          enum: [spoof, real, unknown]
          description: Liveness prediction.
        estimations:
          type: object
          description: Liveness estimation.
          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]

    deepfake:
      type: object
      description: Deepfake prediction.
      properties:
        prediction:
          type: string
          enum: [ fake, real ]
          description: Deepfake prediction name
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
          description: Deepfake prediction score.
      required: [ prediction, score ]

    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:
          allOf:
            - $ref: '#/components/schemas/byte_string'
            - description: Face warped image in JPG format.

    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'
        basic_attributes:
          $ref: "#/components/schemas/body_basic_attributes"
        upper_body:
          $ref: "#/components/schemas/upper_body_attributes"
        lower_body:
          $ref: "#/components/schemas/lower_body_attributes"
        accessories:
          $ref: "#/components/schemas/body_accessories"

    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:
          allOf:
            - $ref: '#/components/schemas/byte_string'
            - description: Human body warped image in JPG format

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

    image_error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
        filename:
          type: string
          description: |
            Source image file name (preserved only for "multipart-form-data" requests, otherwise "Raw Image").
          example: "penelope.jpeg"
      required:
        - error
        - filename
      example:
        error:
          desc: Failed validation
          detail: Invalid rectangle
          error_code: 100016
          link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-100016
        filename: image.jpg

    image_estimations:
      type: object
      description: Image estimations.
      properties:
        people:
          type: object
          properties:
            count:
              type: integer
              description: |
                People count estimation. As an approximate value, it may differ from a face and body detection count per image for images with a lot of people.
                See the [Crowd Estimation](https://docs.visionlabs.ai/sdk/latest/) section in the LUNA SDK documentation.
            coordinates:
              allOf:
                - $ref: '#/components/schemas/people_coordinates'
              nullable: true

    one_image_estimation:
      type: object
      properties:
        filename:
          type: string
          description: |
            Source image file name (preserved only for "multipart-form-data" requests, otherwise "Raw Image").
          example: "penelope.jpeg"
        exif:
          $ref: '#/components/schemas/exif'
        estimations:
          type: array
          description: |
            List of related detections, i.e. samples related to the body and face that refer to the same 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.
          items:
            type: object
            properties:
              face:
                $ref: '#/components/schemas/sdk_face_estimations'
              body:
                $ref: '#/components/schemas/sdk_body_estimations'
            required: [face, body]
        image_estimations:
          $ref: '#/components/schemas/image_estimations'
      required: [ filename, estimations, image_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'
                basic_attributes:
                  $ref: "#/components/schemas/body_basic_attributes"
                upper_body:
                  $ref: "#/components/schemas/upper_body_attributes"
                lower_body:
                  $ref: "#/components/schemas/lower_body_attributes"
                accessories:
                  $ref: "#/components/schemas/body_accessories"
          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_attribute_with_estimations'
                mask:
                  $ref: '#/components/schemas/masks_estimation'
                emotions:
                  $ref: '#/components/schemas/emotions'
                liveness:
                  $ref: '#/components/schemas/liveness'
                deepfake:
                  $ref: '#/components/schemas/deepfake'
          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 ]


    face_candidates_in_target_match_result:
      type: object
      properties:
        face:
          type: object
          properties:
            face_id:
              $ref: '#/components/schemas/face_id'
            user_data:
              $ref: '#/components/schemas/face_user_data'
            create_time:
              $ref: '#/components/schemas/create_time'
            external_id:
              $ref: '#/components/schemas/face_external_id'
            account_id:
              $ref: '#/components/schemas/account_id'
            lists:
              type: array
              items:
                $ref: '#/components/schemas/list_id'
              minItems: 0
              description: Comma-separated list of list IDs which contain the face.
            event_id:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/event_id'
            avatar:
              $ref: '#/components/schemas/avatar'
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Similarity of candidate's face.
      required: [face, similarity]

    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:
              nullable: true
              allOf:
                - $ref: '#/components/schemas/face_user_data'
            create_time:
              allOf:
                - $ref: '#/components/schemas/create_time'
                - nullable: true
            external_id:
              allOf:
                - $ref: '#/components/schemas/face_external_id'
                - nullable: true
          required: [face_id, user_data, create_time, external_id]
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Similarity of candidate's face.
      required: [face, similarity]

    create_time:
      allOf:
        - $ref: "#/components/schemas/time"
        - description: Time of the object 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
            stream_id:
              allOf:
                - $ref: '#/components/schemas/stream_id'
                - nullable: true
          required: [event_id, user_data, create_time, external_id, handler_id, source, stream_id]
        similarity:
          allOf:
          - $ref: '#/components/schemas/similarity'
          description: Similarity of candidates' event.
      required: [event, similarity]

    event_candidates_in_target_match_result:
      type: object
      description: Event candidate object in the response.
      properties:
        event:
          type: object
          properties:
            event_id:
              $ref: '#/components/schemas/event_id'
            account_id:
              $ref: '#/components/schemas/account_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'
            stream_id:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/stream_id'
            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
              items:
                oneOf:
                  - $ref: '#/components/schemas/match_candidates_face_in_event_candidates_in_target_match_result'
                  - $ref: '#/components/schemas/match_candidates_events_in_event_candidates_in_target_match_result'
              nullable: true
            face_detections:
              type: array
              nullable: true
              items:
                type: object
                properties:
                  sample_id:
                    allOf:
                      - nullable: true
                      - $ref: '#/components/schemas/sample_id'
                  detection:
                    type: object
                    description: Face detection.
                    properties:
                      rect:
                        $ref: '#/components/schemas/rect'
                  detect_time:
                    $ref: '#/components/schemas/detect_time'
                  detect_ts:
                    $ref: '#/components/schemas/detect_ts'
                  image_origin:
                    $ref: '#/components/schemas/image_origin'
                required: [sample_id, detect_time, image_origin, detect_ts]
            body_detections:
              type: array
              nullable: true
              items:
                type: object
                properties:
                  sample_id:
                    allOf:
                      - nullable: true
                      - $ref: '#/components/schemas/sample_id'
                  detection:
                    type: object
                    description: Body detection.
                    properties:
                      rect:
                        $ref: '#/components/schemas/rect'
                  detect_time:
                    $ref: '#/components/schemas/detect_time'
                  detect_ts:
                    $ref: '#/components/schemas/detect_ts'
                  image_origin:
                    $ref: '#/components/schemas/image_origin'
                required: [sample_id, detect_time, image_origin, detect_ts]
            face_id:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/face_id'
            attach_result:
              type: array
              items:
                $ref: '#/components/schemas/list_id'
              nullable: true
            gender:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/gender'
            age:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/age'
            emotion:
              $ref: '#/components/schemas/emotion_enum_nullable'
            ethnic_group:
              $ref: '#/components/schemas/ethnicities_enum_nullable'
            tags:
              allOf:
              - $ref: '#/components/schemas/tags'
              - nullable: true
            user_data:
              $ref: '#/components/schemas/event_user_data'
            location:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/location'
                - required: [city, area, district, street, house_number, geo_position]
            track_id:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/track_id'
            liveness:
              $ref: '#/components/schemas/liveness_state_nullable'
            deepfake:
              $ref: '#/components/schemas/deepfake_state_nullable'
            mask:
              $ref: '#/components/schemas/mask_enum_nullable'
            body_basic_attributes:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/body_basic_attributes'
            upper_body:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/upper_body_attributes'
                - properties:
                    headwear:
                      properties:
                        apparent_color:
                          nullable: True
            lower_body:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/lower_body_attributes'
            accessories:
              allOf:
                - nullable: true
                - $ref: '#/components/schemas/body_accessories'
            meta:
              allOf:
                - $ref: "#/components/schemas/event_meta_common"
              nullable: true
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Event candidate similarity.
      required: [event, similarity]

    binary_image:
      type: string
      format: binary

    matcher_raw_request_json:
      type: object
      properties:
        references:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/xpk_file_entity'
              - $ref: '#/components/schemas/sdk_descriptor_entity'
              - $ref: '#/components/schemas/raw_descriptor_entity'
          description: Reference list for matching.
          minItems: 1
        candidates:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/xpk_file_entity'
              - $ref: '#/components/schemas/sdk_descriptor_entity'
              - $ref: '#/components/schemas/raw_descriptor_entity'
          minItems: 1
          description: Candidates for matching.
      required: [references, candidates]

    matcher_raw_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 matching.
          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 matching.
      required: [references, candidates]

    matcher_raw_result:
      type: object
      properties:
        matches:
          type: array
          items:
            type: object
            properties:
              reference_id:
                allOf:
                  - $ref: '#/components/schemas/match_reference_id'
                  - description: 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:
                      allOf:
                        - $ref: '#/components/schemas/match_reference_id'
                        - description: Candidate id.
                    similarity:
                      $ref: '#/components/schemas/similarity'
                minItems: 1
                description: Reference vs candidates matches.
            required: [reference_id, matches]
          description: List of matches.

    match_bodies_request_json:
      type: object
      properties:
        references:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/event_reference'
              - $ref: '#/components/schemas/external_event_reference'
              - $ref: '#/components/schemas/track_event_reference'
              - $ref: '#/components/schemas/sdk_descriptor_entity'
              - $ref: '#/components/schemas/raw_body_descriptor_entity'
            discriminator:
              propertyName: type
              mapping:
                event: '#/components/schemas/event_reference'
                event_external_id: '#/components/schemas/external_event_reference'
                event_track_id: '#/components/schemas/track_event_reference'
                sdk_descriptor: '#/components/schemas/sdk_descriptor_entity'
                raw_descriptor: '#/components/schemas/raw_body_descriptor_entity'
          description: |
            References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types.
          minItems: 1
          maxItems: 30
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/candidate_event'
          minItems: 1
          maxItems: 30
          description: Candidates for matching.
      required: [references, candidates]

    match_bodies_request_msgpack:
      type: object
      properties:
        references:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/event_reference'
              - $ref: '#/components/schemas/external_event_reference'
              - $ref: '#/components/schemas/track_event_reference'
              - $ref: '#/components/schemas/sdk_descriptor_entity_binary'
              - $ref: '#/components/schemas/raw_body_descriptor_entity_binary'
            discriminator:
              propertyName: type
              mapping:
                event: '#/components/schemas/event_reference'
                event_external_id: '#/components/schemas/external_event_reference'
                event_track_id: '#/components/schemas/track_event_reference'
                sdk_descriptor: '#/components/schemas/sdk_descriptor_entity_binary'
                raw_descriptor: '#/components/schemas/raw_body_descriptor_entity_binary'
          description: |
            References for matching. Each reference is matched with all given candidates. You can specify one or several references of one or several types.
          minItems: 1
          maxItems: 30
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/candidate_event'
          minItems: 1
          maxItems: 30
          description: Candidates for matching.
      required: [ references, candidates ]

    events_only_matches_success:
      type: array
      description: List with success match result for the *reference_id*.
      items:
        allOf:
          - description: Sorted list with success match result for the *reference_id* vs candidate batch.
          - $ref: '#/components/schemas/event_match_result'
      minItems: 1

    match_bodies_result:
      type: array
      items:
        type: object
        properties:
          reference:
            type: object
            description: Reference object.
            properties:
              id:
                allOf:
                  - $ref: '#/components/schemas/match_reference_id'
                  - description: Reference ID.
              type:
                type: string
                enum: ["descriptor", "event", "event_external_id", "event_track_id"]
                description: Match reference type.
              event_id:
                allOf:
                  - $ref: '#/components/schemas/uuid'
                description: Reference event ID if reference type is one of (event_external_id, event_track_id).
            required: [id, type]
          matches:
            oneOf:
              - $ref: '#/components/schemas/events_only_matches_success'
              - $ref: '#/components/schemas/matches_error'
            description: Reference vs candidates matches.
        required: [reference, matches]
      description: List of matches.

    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_base64:
      allOf:
      - type: object
        properties:
          data:
            type: string
            format: byte
      - $ref: '#/components/schemas/sdk_descriptor_entity_binary'

    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]

    verification_status:
      type: boolean
      description: |
        status of verification. `true` - the reference and the candidate are considered
        the same person

    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:
                      allOf:
                        - $ref: '#/components/schemas/similarity'
                      description: Candidate 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_event_verification:
      type: object
      properties:
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Similarity score.
        status:
          allOf:
            - $ref: '#/components/schemas/verification_status'
          description: Verification result.
        event:
          type: object
          properties:
            event_id:
              $ref: '#/components/schemas/event_id'
          description: Verification against an event ID.
          required: [event_id]
      required: [similarity, status, event]

    verifier_face_verification:
      type: object
      properties:
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Similarity score.
        status:
          allOf:
            - $ref: '#/components/schemas/verification_status'
          description: Verification result.
        face:
          oneOf:
          - type: object
            properties:
              face_id:
                $ref: '#/components/schemas/face_id'
            description: Verification against the face.
            required: [ face_id ]
      required: [ similarity, status, face ]

    verifier_face_external_id_verification:
      type: object
      properties:
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Similarity score.
        status:
          allOf:
            - $ref: '#/components/schemas/verification_status'
          description: Verification result.
        face:
            type: object
            properties:
              external_id:
                $ref: '#/components/schemas/face_external_id'
            description: Verification against the face.
            required: [ external_id ]
      required: [ similarity, status, face ]

    verifier_attribute_verification:
      type: object
      properties:
        similarity:
          allOf:
            - $ref: '#/components/schemas/similarity'
          description: Similarity score.
        status:
          allOf:
            - $ref: '#/components/schemas/verification_status'
          description: Verification result.
        attribute:
          type: object
          properties:
            attribute_id:
              $ref: '#/components/schemas/attribute_id'
          description: Verification against an attribute.
          required: [ attribute_id ]
      required: [ similarity, status, attribute ]

    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 threshold.
        basic_attributes:
          $ref: '#/components/schemas/basic_attribute_with_estimations'
        score:
          type: number
          minimum: 0
          maximum: 1
          description: Face descriptor quality score.
        url:
          nullable: true
          type: string
          format: uri-reference
          example: "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
          description: Location of attributes; `null` if descriptor score is lower than score threshold.
        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:
              - properties:
                  rect:
                    allOf:
                    - $ref: '#/components/schemas/rect'
                    description: Face detection bounding box. Absent in case of verifying against warp.
                  sample_id:
                    allOf:
                    - nullable: true
                    - $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'

          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
                      link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
              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/verification_filtered_detections'
                required: [face_detections, filtered_detections]
            required: [error, status, filename, detections]
      required: [images]

    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 only 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_glasses:
          $ref: '#/components/schemas/estimate_glasses'
        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
        estimate_deepfake:
          $ref: '#/components/schemas/estimate_deepfake'
        deepfake_states:
          allOf:
            - $ref: '#/components/schemas/deepfake_states'
            - nullable: true
        face_quality:
          $ref: '#/components/schemas/face_quality'

      description:  |
        Policy determines 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, estimate_deepfake, deepfake_states]

    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 determines 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'
          required:
            - store_attribute
          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'
          required:
            - store_sample
          example:
            store_sample: 0

    verifier_storage_policy_required:
      allOf:
        - $ref: '#/components/schemas/verifier_storage_policy'
        - required: [attribute_policy, face_sample_policy]

    verification_threshold:
      type: number
      minimum: 0
      maximum: 1
      example: 0.99
      description: Verification similarity threshold.

    new_verifier:
      type: object
      properties:
        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'

    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]

    ws_face_detection:
      type: object
      properties:
        sample_id:
          allOf:
          - $ref: '#/components/schemas/sample_id'
          nullable: true
        detection:
          $ref: '#/components/schemas/face_detection'
        url:
          type: string
          format: uri-reference
          example: /0/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
          nullable: true
      required: [detection, sample_id, url]

    ws_body_detection:
      type: object
      properties:
        sample_id:
          allOf:
          - $ref: '#/components/schemas/uuid'
          nullable: true
        detection:
          $ref: '#/components/schemas/body_detection'
        url:
          type: string
          format: uri-reference
          example: /0/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c
          nullable: true
      required: [detection, sample_id, url]

    event_from_ws:
      type: object
      description: Event format from handler.
      properties:
        body_attributes:
          type: object
          description: Body attributes extracted from samples.
          nullable: true
          properties:
            score:
              type: number
              minimum: 0
              maximum: 1
              description: Quality of body descriptor.
            samples:
              type: array
              items:
                $ref: '#/components/schemas/uuid'
              minItems: 0
              example: ['a3e8716f-70dc-42ad-8428-7a552e800a37']
              description: Resource for attributes.
          required: [score, samples]
        face_attributes:
          allOf:
            - description: Extracted attributes from samples.
            - $ref: '#/components/schemas/Attribute'
            - nullable: true
        source:
          type: string
          description: Additional information that user provides with event.
          nullable: true
          example: "3rd Avenue"
        stream_id:
          allOf:
            - $ref: '#/components/schemas/stream_id'
            - nullable: true
        user_data:
          $ref: '#/components/schemas/event_user_data'
        external_id:
          $ref: '#/components/schemas/event_external_id'
        tags:
          description: Tag array.
          type: array
          items:
            $ref: '#/components/schemas/tag'
          example: ['tag1', 'tag2']
          nullable: true
        location:
          $ref: '#/components/schemas/location'
        face:
          type: object
          nullable: true
          properties:
            face_id:
              $ref: '#/components/schemas/face_id'
            external_id:
              $ref: '#/components/schemas/face_external_id'
            user_data:
              $ref: '#/components/schemas/face_user_data'
            avatar:
              $ref: '#/components/schemas/avatar'
            lists:
              $ref: '#/components/schemas/lists'
            event_id:
              $ref: '#/components/schemas/event_id'
            url:
              $ref: '#/components/schemas/url'
          required: [face_id, external_id, user_data, avatar, lists, event_id, url]
          example:
            external_id: "2xQ2gprbMUePw1s9gw9fvA=="
            face_id: "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
            user_data: "fox1991"
            url: "/6/faces/426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
            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"
        event_id:
          $ref: '#/components/schemas/event_id'
        url:
          type: string
          format: uri-reference
          example: "/6/events/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
          description: Location of event.
          nullable: true
        matches:
          $ref: '#/components/schemas/matches'
        detections:
          type: array
          description: |
           All detections which were generated for the event.

           *Multiple detections are only possible when aggregation is used.*

          items:
            type: object
            properties:
              filename:
                type: string
                example: "penelope.jpeg"
              samples:
                type: object
                properties:
                  face:
                    allOf:
                      - $ref: '#/components/schemas/ws_face_detection'
                      - nullable: True
                  body:
                    allOf:
                      - $ref: '#/components/schemas/ws_body_detection'
                      - nullable: True
                required: [face, body]
              detect_time:
                $ref: '#/components/schemas/detect_time'
              detect_ts:
                $ref: '#/components/schemas/detect_ts'
              image_origin:
                $ref: '#/components/schemas/image_origin'
            required: [filename, samples, detect_time, image_origin, detect_ts]
        track_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/track_id'
        meta:
          allOf:
            - $ref: "#/components/schemas/event_meta_common"
          nullable: true
        aggregate_estimations:
          $ref: '#/components/schemas/event_aggregate_estimations'
      required: [matches, url, event_id, face, tags, source, stream_id, face_attributes, body_attributes, detections, user_data,
                 location, track_id, external_id, aggregate_estimations, meta]

    message_from_ws:
      type: object
      properties:
        event:
          $ref: '#/components/schemas/event_from_ws'
        handler_id:
          allOf:
          - $ref: '#/components/schemas/uuid'
          - description: ID of the handler, which has produced the event.
        event-create-time:
          description: Event creation time.
          type: string
          format: date-time
        event-end-time:
          description: Event end time.
          type: string
          format: date-time
        Luna-Request-id:
          type: string
          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: ID of the request that raised the event. Format is "{timestamp},{uuid}".
      required: [event, handler_id, event-create-time, event-end-time, Luna-Request-id]
      description: Example message that will be send by WebSocket.

    input_event_face_attribute:
      type: object
      description: User extracted event face attributes.
      nullable: true
      properties:
        attribute_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/attribute_id'
        basic_attributes:
          $ref: '#/components/schemas/basic_attribute_with_estimations'
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
            - default: 1
          description: Face descriptor quality score (1 means the descriptor was extracted).
        samples:
          allOf:
            - $ref: '#/components/schemas/samples_list'
            - minItems: 0
            - maxItems: 8
        descriptor:
          $ref: '#/components/schemas/sdk_descriptor'
        url:
          type: string
          format: uri-reference
          description: |
            Attributes location URL. If user does not set it and `attribute_id` is not `null` it will be generated
            automatically.

    input_event_body_attribute:
      type: object
      description: User extracted event body attributes.
      nullable: true
      properties:
        score:
          allOf:
            - $ref: '#/components/schemas/number01'
            - default: 1
          description: Body descriptor quality score (1 means the descriptor was extracted).
        samples:
          allOf:
            - $ref: '#/components/schemas/samples_list'
            - minItems: 0
            - maxItems: 8
        descriptor:
          $ref: '#/components/schemas/sdk_descriptor'

    input_event_face_detection_sample:
      type: object
      description: Face detection sample.
      properties:
        sample_id:
          allOf:
            - nullable: true
            - $ref: '#/components/schemas/sample_id'
        detection:
          $ref: '#/components/schemas/input_face_detection'
        url:
          type: string
          format: uri-reference
          description: |
            User saved face sample location. If user does not set it and `sample_id` is not `null` it will
            be generated automatically.
          example: /6/samples/faces/45838c8b-04a1-4230-bda0-b5f77609b695
      required: [detection, sample_id]

    body_detection:
      type: object
      description: Body detection.
      properties:
        rect:
          allOf:
            - $ref: '#/components/schemas/rect'
            - description: Body detection bounding box.
        attributes:
          type: object
          description: Body attributes.
          properties:
            basic_attributes:
              $ref: '#/components/schemas/body_basic_attributes'
            upper_body:
              $ref: '#/components/schemas/upper_body_attributes'
            lower_body:
              $ref: '#/components/schemas/lower_body_attributes'
            accessories:
              $ref: '#/components/schemas/body_accessories'

    input_event_body_detection_sample:
      type: object
      description: Body detection sample.
      properties:
        sample_id:
          nullable: true
          allOf:
          - $ref: '#/components/schemas/sample_id'
        detection:
          $ref: '#/components/schemas/body_detection'
        url:
          type: string
          format: uri-reference
          description: |
            User saved body sample location. If user does not set it and `sample_id` is not `null` it will
            be generated automatically.
          example: /6/samples/bodies/45838c8b-04a1-4230-bda0-b5f77609b695
      required: [detection, sample_id]

    raw_event:
      type: object
      description: User generated events.
      properties:
        detections:
          type: array
          description: List of body & face related detections.
          items:
            type: object
            properties:
              filename:
                allOf:
                  - $ref: '#/components/schemas/filename'
                  - default: ""
              samples:
                type: object
                description: Body & face related samples that refer to the one person.
                properties:
                  body:
                    allOf:
                      - nullable: true
                      - $ref: '#/components/schemas/input_event_body_detection_sample'
                  face:
                    allOf:
                      - nullable: true
                      - $ref: '#/components/schemas/input_event_face_detection_sample'
              detect_time:
                $ref: "#/components/schemas/detect_time"
              detect_ts:
                $ref: '#/components/schemas/detect_ts'
              image_origin:
                allOf:
                  - nullable: true
                  - $ref: "#/components/schemas/image_origin"
            required: [samples]
          maxItems: 100
        source:
          $ref: '#/components/schemas/source'
        stream_id:
          $ref: '#/components/schemas/stream_id'
        location:
          $ref: '#/components/schemas/input_event_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:
            - $ref: '#/components/schemas/matches'
          maxItems: 30
        face_attributes:
          $ref: '#/components/schemas/input_event_face_attribute'
        body_attributes:
          $ref: '#/components/schemas/input_event_body_attribute'
        aggregate_estimations:
          $ref: '#/components/schemas/input_event_aggregate_estimations'
        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.
        meta:
          $ref: "#/components/schemas/event_meta_common"
    saved_event:
      type: object
      properties:
        event_id:
          $ref: '#/components/schemas/event_id'
        url:
          type: string
          format: uri-reference
          description: Related URL of the created event.
        external_url:
          $ref: '#/components/schemas/external_url'
      required: [event_id, url, external_url]
      example:
        event_id: b5d6fd45-fcca-453d-ac05-3e594054b813
        url: /6/events/b5d6fd45-fcca-453d-ac05-3e594054b813
        external_url: http://127.0.0.1:5000/6/events/b5d6fd45-fcca-453d-ac05-3e594054b813

    ExporterEventColumns:
      type: array
      items:
        description: |
          Event columns. Default is ["event_id", "create_time", "end_time", "external_id", "handler_id", "source", "top_match",
          "face_id", "gender", "age", "emotion", "ethnic_group", "user_data", "city", "area", "district",
          "street", "house_number", "geo_position", "mask", "track_id", "liveness", "body_basic_attributes", "deepfake", 
          "upper_body", "lower_body", "accessories", "meta"].
        type: string
        enum: ["event_id", "create_time", "end_time", "external_id", "handler_id", "source", "top_match", "match_result",
               "face_detections", "face_id", "attach_result", "gender",
               "age", "emotion", "ethnic_group", "tags", "user_data", "city", "area", "district", "street",
               "house_number", "geo_position", "body_detections", "mask", "track_id", "liveness", "deepfake",
               "body_basic_attributes", "upper_body", "lower_body", "accessories", "meta"]

    ExporterFaceColumns:
      type: array
      items:
        description: Face columns. Default is ["face_id", "user_data", "create_time", "external_id", "avatar", "event_id"].
        type: string
        enum: ["face_id", "user_data", "create_time", "lists", "external_id", "avatar", "event_id"]

    ExporterTaskContentFacesNoFilters:
      allOf:
        - $ref: '#/components/schemas/ExporterTaskContentBase'
      properties:
        objects_type:
          type: string
          enum: ["faces"]
        columns:
          allOf:
            - $ref: '#/components/schemas/ExporterFaceColumns'
            - description: Column names in CSV report. Order of fields determines the order columns in report.
              example: ["face_id", "user_data", "create_time"]
        descriptor:
          allOf:
            - properties:
                type:
                  enum: ["face"]
            - $ref: '#/components/schemas/descriptor_info'

    ExporterTaskContentFaces:
      allOf:
        - $ref: '#/components/schemas/ExporterTaskContentFacesNoFilters'
      properties:
        filters:
          allOf:
            - description: Exporter task filters.
            - $ref: '#/components/schemas/task_face_filters_no_account'
      required: [ filters, objects_type ]

    ExporterTaskContentFacesReply:
      allOf:
        - $ref: '#/components/schemas/ExporterTaskContentFacesNoFilters'
      properties:
        filters:
          description: Exporter task filters.
          allOf:
            - $ref: '#/components/schemas/faces_filters_no_create_time'
          properties:
            create_time__gte:
              description: Create time lower included boundary.
              $ref: '#/components/schemas/create_time__gte'
            create_time__lt:
              description: Create time upper excluded boundary.
              $ref: '#/components/schemas/create_time__lt'
      required: [ filters, objects_type ]

    ExporterTaskContentEventsNoFilters:
      allOf:
        - type: object
          properties:
            objects_type:
              type: string
              enum: ["events"]
            columns:
              allOf:
                - $ref: '#/components/schemas/ExporterEventColumns'
                - description: Column names in CSV report. Order of fields determines the order columns in report.
                  example: ["face_id", "user_data", "create_time"]
            descriptor:
              $ref: '#/components/schemas/descriptor_info'
        - $ref: '#/components/schemas/ExporterTaskContentBase'

    ExporterTaskContentEvents:
      allOf:
        - $ref: '#/components/schemas/ExporterTaskContentEventsNoFilters'
      properties:
        filters:
          allOf:
            - description: Exporter task filters.
            - $ref: '#/components/schemas/task_event_filters_no_account'
      required: [filters, objects_type]

    ExporterTaskContentEventsReply:
      allOf:
        - $ref: '#/components/schemas/ExporterTaskContentEventsNoFilters'
      properties:
        filters:
          allOf:
            - $ref: '#/components/schemas/events_filters_no_create_end_time'
          properties:
            create_time__gte:
              description: Create time lower included boundary.
              $ref: '#/components/schemas/create_time__gte'
            create_time__lt:
              description: Create time upper excluded boundary.
              $ref: '#/components/schemas/create_time__lt'
            end_time__gte:
              description: End time lower included boundary.
              $ref: '#/components/schemas/end_time__gte'
            end_time__lt:
              description: End time upper excluded boundary.
              $ref: '#/components/schemas/end_time__lt'
      required: [ filters, objects_type ]

    ExporterTaskContentBase:
      type: object
      description: Exporter task content.
      properties:
        csv_delimiter:
          default: ','
          type: string
          description: CSV delimiter.
          maxLength: 1
          minLength: 1
          example: '$'

        save_images:
          type: integer
          default: 0
          enum: [0, 1]
          description: Whether to add images to the resulting archive.

        objects_type:
          type: string
          description: Target object type for the exporter.

    OutputExporterTaskContentFaces:
      allOf:
      - properties:
          filters:
            properties:
              account_id:
                $ref: '#/components/schemas/account_id'
            required: [ account_id ]
      - $ref: '#/components/schemas/ExporterTaskContentFacesReply'

    OutputExporterTaskContentEvents:
      allOf:
      - properties:
          filters:
            properties:
              account_id:
                $ref: '#/components/schemas/account_id'
            required: [ account_id ]
      - $ref: '#/components/schemas/ExporterTaskContentEventsReply'

    exporter_task_content:
      oneOf:
        - $ref: '#/components/schemas/OutputExporterTaskContentFaces'
        - $ref: '#/components/schemas/OutputExporterTaskContentEvents'
      discriminator:
        propertyName: objects_type
        mapping:
          faces: '#/components/schemas/OutputExporterTaskContentFaces'
          events: '#/components/schemas/OutputExporterTaskContentEvents'

    exporter_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              description: Exporter task content.
              oneOf:
                - $ref: '#/components/schemas/ExporterTaskContentFaces'
                - $ref: '#/components/schemas/ExporterTaskContentEvents'
              discriminator:
                propertyName: objects_type
                mapping:
                  faces: '#/components/schemas/ExporterTaskContentFaces'
                  events: '#/components/schemas/ExporterTaskContentEvents'

    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]
      examples:
        ok:
          value:
            {
              "execution_time":0.007664584001759067
            }
        all errors:
          value:
            {
              "errors":[
                {
                  "component":"faces",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/faces:5030\/version:Cannot connect to host faces:5030 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"face_samples",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/image-store:5020\/version:Cannot connect to host image-store:5020 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"body_samples",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/image-store:5020\/version:Cannot connect to host image-store:5020 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"image_origin_store",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/image-store:5020\/version:Cannot connect to host image-store:5020 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"objects_store",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/image-store:5020\/version:Cannot connect to host image-store:5020 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"matcher",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/python-matcher-proxy:5110\/version:Cannot connect to host python-matcher-proxy:5110 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"handlers",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/handlers:5090\/version:Cannot connect to host handlers:5090 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"licenses",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/tasks:5050\/version:Cannot connect to host tasks:5050 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"sender",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/sender:5080\/version:Cannot connect to host sender:5080 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"events",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/events:5040\/version:Cannot connect to host events:5040 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"tasks",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/tasks:5050\/version:Cannot connect to host tasks:5050 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }, {
                  "component":"liveness",
                  "error":{
                    "error_code":38001,
                    "desc":"Health check error",
                    "detail":"GET:http:\/\/build05.vlabs:8080\/api_version:Cannot connect to host build05.vlabs:8080 ssl:default [Name or service not known]",
                    "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-38001"},
                    "status":0
                }
              ]
            }

    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: Estimated 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
          description: Lower bound of the allowed range.
          example: 0
        max:
          type: integer
          minimum: 0
          description: Upper bound of the allowed range.
          example: 1
      required: [ min, max ]
      description: Allowed range of the estimation value.

    face_threshold_value_int_positive_max_optional:
      type: object
      properties:
        min:
          type: integer
          minimum: 0
          description: Lower bound of the allowed range.
          example: 0
        max:
          type: integer
          minimum: 0
          description: Upper bound of the allowed range.
          example: 1
      required: [min]
      description: Allowed range of the estimation value.

    face_threshold_value_int_positive_max_nullable:
      type: object
      properties:
        min:
          type: integer
          minimum: 0
          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
          description: Lower bound of the allowed range.
          example: 0
        max:
          type: number
          description: Upper bound of the allowed range.
          example: 1
      required: [ min, max ]
      description: Allowed range of the estimation value.

    check_eye_distance_threshold_value_number:
      type: object
      properties:
        min:
          type: number
          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 ]

    check_eye_distance_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/check_eye_distance_threshold_value_number'
        result:
          $ref: '#/components/schemas/face_check_result'
      required: [ name, object_value, threshold_value, result ]

    image_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 ]


    input_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_max_optional'
        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_max_nullable'
        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_image_format:
      type: object
      properties:
        name:
          type: string
          enum: [ image_format ]
          description: Unique estimation name.
        object_value:
          type: string
          nullable: true
          enum: [ JPEG, JPEG2000, PNG, BMP, TIFF, Portable pixmap ]
          description: Original image format.
          example: JPEG
        threshold_value:
          type: array
          items:
            type: string
            enum: [ JPEG, JPEG2000, PNG ]
          description: List of image formats allowed by standard.
        result:
          type: integer
          enum: [ 0, 1 ]
          description: Check result (1 - succeeded, 0 - failed).
      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/check_eye_distance_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'
        - $ref: '#/components/schemas/background_uniformity'
        - $ref: '#/components/schemas/background_lightness'
        - $ref: '#/components/schemas/shoulders_position_status_iso'

    check_image_properties:
      allOf:
        - $ref: '#/components/schemas/image_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_request:
      allOf:
        - $ref: '#/components/schemas/input_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_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
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
          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 ]

    token_id:
      allOf:
        - $ref: '#/components/schemas/uuid'
      description: Token ID.

    external_url:
      type: string
      format: uri-reference
      description: Absolute URL of the created object.

    account_description:
      type: string
      maxLength: 128
      description: Account description.
      default: ""
      example: "main admin account"

    token_description:
      type: string
      maxLength: 128
      description: Token description.
      default: ""
      example: "main account token"

    login:
      type: string
      minLength: 3
      maxLength: 128
      pattern: '^[a-z0-9_\-\.]+@[a-z]+\.[a-z]{2,}$'
      description: Account email.
      example: "mylogin@gmail.com"

    password:
      type: string
      minLength: 3
      maxLength: 128
      pattern: '^.{3,128}$'
      description: Account password.

    account_type_for_creation:
      type: string
      enum: ['advanced_user', 'user']
      description: |
        Specified user account type:

        - `user` - allows to interact with its own data

        - `advanced_user` - allows to interact with its own data and view other accounts data

    account_type:
      type: string
      enum: ['advanced_user', 'user', 'admin']
      description: |
        Specified user account type:

        - `user` - allows to interact with its own data

        - `advanced_user` - additionally provides possibility to view data of other accounts

        - `admin` - additionally provides administrator privileges

    account_base:
      type: object
      properties:
        login:
          $ref: '#/components/schemas/login'
        password:
          $ref: '#/components/schemas/password'
        account_type:
          $ref: '#/components/schemas/account_type_for_creation'
        description:
          $ref: '#/components/schemas/account_description'

    account_for_patch:
      allOf:
        - $ref: '#/components/schemas/account_base'
        - minProperties: 1

    account_to_create:
      allOf:
        - $ref: '#/components/schemas/account_base'
        - required: [login, password, account_type]

    account_to_receive:
      type: object
      properties:
        account_id:
          allOf:
          - $ref: '#/components/schemas/account_id'
          - example: 557d54ec-29ad-4f3c-93b4-c9092ef12515
        login:
          $ref: '#/components/schemas/login'
        account_type:
          $ref: '#/components/schemas/account_type'
        description:
          $ref: '#/components/schemas/account_description'
        create_time:
          allOf:
            - $ref: '#/components/schemas/time'
          description: account create time
        last_update_time:
          allOf:
            - $ref: '#/components/schemas/time'
          description: account last update time

    accounts_to_receive:
      type: object
      properties:
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/account_to_receive'
        total_count:
          type: integer
          description: total accounts count in the system
          minimum: 0
          example: 50
      required: [accounts, total_count]

    account_creation_response:
      type: object
      properties:
        account_id:
          allOf:
            - $ref: '#/components/schemas/account_id'
          description: ID of the created account.
        url:
          type: string
          format: uri-reference
          description: Relative URL of the created account.
        external_url:
          $ref: '#/components/schemas/external_url'
      required: [account_id, url, external_url]
      example:
        account_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
        url: /6/account
        external_url: http://127.0.0.1:5000/6/account

    permissions_template:
      type: array
      items:
        type: string
      minItems: 0

    account_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for account objects.
        - type: array
          items:
            enum: [view]
          default: []

    face_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for face objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion, matching]
          default: []

    list_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for list objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion]
          default: []

    event_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for event objects.
        - type: array
          items:
            enum: [creation, view, matching]
          default: []

    attribute_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for attribute objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion, matching]
          default: []

    handler_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for handler objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion]
          default: []

    verifier_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for verifier objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion]
          default: []

    task_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for task objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion]
          default: []

    sample_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - type: array
          items:
            enum: [creation, view, deletion]
          default: []

    face_sample_permissions:
      allOf:
        - $ref: "#/components/schemas/sample_permissions"
        - description: Permissions for face sample objects.

    body_sample_permissions:
      allOf:
        - $ref: "#/components/schemas/sample_permissions"
        - description: Permissions for body sample objects.

    images_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for images objects.
        - type: array
          items:
            enum: [creation, view, deletion]
          default: []

    objects_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for objects.
        - type: array
          items:
            enum: [creation, view, deletion]
          default: []

    lambda_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for lambda objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion]
          default: []

    token_permissions:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permissions for token objects.
        - type: array
          items:
            enum: [creation, view, modification, deletion]
          default: [view]

    resources:
      allOf:
        - $ref: "#/components/schemas/permissions_template"
        - description: Permission for using one or several listed resources.
        - type: array
          items:
            enum: [iso, sdk, liveness]
          default: []

    emit_events_handler_ids:
      type: array
      items:
        $ref: "#/components/schemas/uuid"
      nullable: true
      minItems: 1
      maxItems: 100

    emit_events:
      type: object
      description: |
        Handler IDs list for events generation request:

        - if `allowed` is `0`, all handlers will be denied for use

        - if *handler_id* is present in `black_list`, only its use will be prohibited

        - if *handler_id* is present in `white_list`, only its use will be allowed
      properties:
        allowed:
          type: integer
          enum: [0, 1]
          description: Whether events generation requests are allowed.
          default: 1
        white_list:
          allOf:
          - $ref: "#/components/schemas/emit_events_handler_ids"
          - description: IDs of handlers allowed for usage.
        black_list:
          allOf:
          - $ref: "#/components/schemas/emit_events_handler_ids"
          - description: IDs of handlers denied for usage.
      default:
        allowed: 1
        white_list: null
        black_list: null

    permissions_custom_only:
      type: object
      description:
        $ref: "#/components/schemas/permissions_description"
      additionalProperties: true

    standard_permissions_and_custom:
      allOf:
        - $ref: "#/components/schemas/permissions"
        - properties:
            emit_events:
              required: [ allowed, black_list, white_list ]
          required: [ account, face, list, event, attribute, handler, verifier, task, face_sample, body_sample, image, object, token, resources, emit_events, lambdas ]

    permissions:
      type: object
      description:
        $ref: "#/components/schemas/permissions_description"
      additionalProperties: true
      properties:
        account:
          $ref: "#/components/schemas/account_permissions"
        face:
          $ref: "#/components/schemas/face_permissions"
        list:
          $ref: "#/components/schemas/list_permissions"
        event:
          $ref: "#/components/schemas/event_permissions"
        attribute:
          $ref: "#/components/schemas/attribute_permissions"
        handler:
          $ref: "#/components/schemas/handler_permissions"
        verifier:
          $ref: "#/components/schemas/verifier_permissions"
        task:
          $ref: "#/components/schemas/task_permissions"
        face_sample:
          $ref: "#/components/schemas/face_sample_permissions"
        body_sample:
          $ref: "#/components/schemas/body_sample_permissions"
        image:
          $ref: "#/components/schemas/images_permissions"
        object:
          $ref: "#/components/schemas/objects_permissions"
        token:
          $ref: "#/components/schemas/token_permissions"
        resources:
          $ref: "#/components/schemas/resources"
        emit_events:
          $ref: "#/components/schemas/emit_events"
        lambdas:
          $ref: "#/components/schemas/lambda_permissions"

    visibility_area:
      type: string
      enum: [account, all]
      default: all
      description: |
        Specifies data visible for the token.

        `account` - only data related to this account can be received using GET requests.

        `all` - data of all existing accounts can be received using GET requests. This value can be set for `advanced_user` account. This option does not work for user account.

    token_with_all_permissions:
      type: object
      description: Token.
      properties:
        description:
          $ref: "#/components/schemas/token_description"
        expiration_time:
          allOf:
          - $ref: "#/components/schemas/time"
          - nullable: true
          - example: "2050-11-11T11:11:11.111+03:00"
          description: Token expiration time in RFC 3339 format. `null` means token will never expired.
        visibility_area:
          $ref: "#/components/schemas/visibility_area"
        permissions:
          $ref: "#/components/schemas/permissions_custom_only"
      required: [ expiration_time ]

    token_to_create:
      allOf:
        - $ref: '#/components/schemas/token_with_all_permissions'
      properties:
        permissions:
          $ref: "#/components/schemas/permissions"
      required: [ permissions ]

    jwt_token:
      type: string
      example: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k
      description: JWT token.

    token_to_receive:
      allOf:
        - $ref: "#/components/schemas/token_to_create"
        - properties:
            token:
              $ref: '#/components/schemas/jwt_token'
            token_id:
              $ref: "#/components/schemas/token_id"
            permissions:
              anyOf:
                - $ref: "#/components/schemas/standard_permissions_and_custom"
                - $ref: "#/components/schemas/permissions_custom_only"
            account_id:
              allOf:
              - $ref: "#/components/schemas/account_id"
              - example: 557d54ec-29ad-4f3c-93b4-c9092ef12515
            create_time:
              allOf:
                - $ref: '#/components/schemas/time'
              description: token create time
            last_update_time:
              allOf:
                - $ref: '#/components/schemas/time'
              description: token last update time
      required: [description, expiration_time, permissions, token, token_id, account_id, visibility_area, create_time, last_update_time]

    tokens_to_receive:
      type: object
      description: Tokens.
      properties:
        tokens:
          type: array
          items:
            $ref: "#/components/schemas/token_to_receive"
      required: [tokens]

    token_creation_response:
      type: object
      properties:
        token:
          allOf:
            - $ref: '#/components/schemas/jwt_token'
          description: Created JWT token.
        token_id:
          allOf:
            - $ref: '#/components/schemas/token_id'
          description: ID of the created token.
        url:
          type: string
          format: uri-reference
          description: Relative URL of the created token.
        external_url:
          $ref: '#/components/schemas/external_url'
      required: [ token, token_id, url, external_url ]
      example:
        token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbklkIjoiN2Q0MjYwNmEtZmM3NS00NDU4LWE3OGUtOWYzNGM2MjIyZWQyIiwiZXhwaXJhdGlvblRpbWUiOm51bGwsImFjY291bnRJZCI6IjdkYjUzNThiLWZjMzMtNDIwZC1hYTgzLTk5YTRkOWY0MGM0MSJ9.kDL5oLTJaxKyYbwmKV1lejxrzsFoFzx5VOzvTR-i90k
        token_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
        url: /6/tokens/557d54ec-29ad-4f3c-93b4-c9092ef12515
        external_url: http://127.0.0.1:5000/6/tokens/557d54ec-29ad-4f3c-93b4-c9092ef12515

    verifier_login_password:
      type: object
      properties:
        login:
          $ref: '#/components/schemas/login'
        password:
          $ref: '#/components/schemas/password'
      required: [login, password]

    verifier_jwt_token:
      type: object
      properties:
        token:
          $ref: '#/components/schemas/jwt_token'
      required: [token]

    verifier_account_id:
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
      required: [account_id]

    verifier_post_data:
      oneOf:
        - $ref: '#/components/schemas/verifier_login_password'
        - $ref: '#/components/schemas/verifier_jwt_token'
        - $ref: '#/components/schemas/verifier_account_id'

    verification_response:
      type: object
      description: Verification response.
      properties:
        account_type:
          $ref: '#/components/schemas/account_type'
        permissions:
          anyOf:
            - $ref: "#/components/schemas/standard_permissions_and_custom"
            - $ref: "#/components/schemas/permissions_custom_only"
        account_id:
          $ref: '#/components/schemas/account_id'
      required: [account_type]

    face_additional_extract_result:
      type: object
      properties:
        face_id:
          description: Extracted attribute face ID.
          allOf:
            - $ref: '#/components/schemas/uuid'
        samples:
          description: Sample IDs used for extraction.
          type: array
          items:
            $ref: '#/components/schemas/uuid'
      required: [face_id, samples]

    event_additional_extract_result:
      type: object
      properties:
        event_id:
          description: Extracted attribute event ID.
          allOf:
            - $ref: '#/components/schemas/uuid'
        samples:
          description: Sample IDs used for extraction.
          type: array
          items:
            $ref: '#/components/schemas/uuid'
      required: [event_id, samples]

    AdditionalExtractTaskResult:
      description: Additional extract task result.
      type: object
      properties:
        result:
          description: Additional extract result.
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/event_additional_extract_result'
              - $ref: '#/components/schemas/face_additional_extract_result'
        errors:
          $ref: '#/components/schemas/TaskErrorsArray'
      required: [errors]

    ae_face_filters:
      description: Face filters.
      type: object
      properties:
        objects_type:
          description: Object type.
          type: string
          enum: [ "faces" ]
        account_id:
          $ref: '#/components/schemas/account_id'
        face_id__lt:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Upper face ID excluding boundary.
        face_id__gte:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Lower face ID including boundary.
      required: [ objects_type ]

    ae_event_filters:
      description: Event filters.
      type: object
      properties:
        objects_type:
          description: Object type.
          type: string
          enum: [ "events" ]
        account_id:
          $ref: '#/components/schemas/account_id'
        handler_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Handler ID.
        event_id__gte:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Lower event ID including boundary.
        event_id__lt:
          allOf:
            - $ref: '#/components/schemas/uuid'
          description: Upper event ID excluding boundary.
        insert_time__gte:
          $ref: '#/components/schemas/insert_time__gte'
        insert_time__lt:
          allOf:
            - $ref: '#/components/schemas/time'
          description: Event insert time upper excluding boundary.
          example: "2018-08-11T09:11:41.674Z"
      required: [ objects_type ]

    additional_extract_task_content_body_descriptor:
      description: Additional extract human descriptors task.
      type: object
      properties:
        extraction_target:
          description: Extraction target.
          type: string
          enum: [ "body_descriptor" ]
        options:
          description: Extract task options.
          type: object
          properties:
            descriptor_version:
              description: Version of descriptors to extract.
              type: integer
            missing:
              type: boolean
              description: Whether to extract only missing descriptors (`false` is not implemented).
              default: true
          required: [ descriptor_version ]
        filters:
          allOf:
            - $ref: '#/components/schemas/ae_event_filters'
          description: |
            Object filters.
            Body descriptor re-extraction can be performed on events only (see `objects_type` in filters).
      required: [ extraction_target, options, filters ]

    additional_extract_task_content_face_descriptor:
      description: Additional extract face descriptors task.
      type: object
      properties:
        extraction_target:
          description: Extraction target.
          type: string
          enum: ["face_descriptor"]
        options:
          description: Extract task options.
          type: object
          properties:
            descriptor_version:
              description: Version of descriptors to extract.
              type: integer
            missing:
              type: boolean
              description: Whether to extract only missing descriptors (`false` is not implemented).
              default: true
          required: [descriptor_version]
        filters:
          description: |
            Object filters.
            Face descriptor re-extraction can be performed on either faces or events (see `objects_type` in filters).
          oneOf:
            - $ref: '#/components/schemas/ae_face_filters'
            - $ref: '#/components/schemas/ae_event_filters'
          discriminator:
            propertyName: objects_type
            mapping:
              faces: '#/components/schemas/ae_face_filters'
              events: '#/components/schemas/ae_event_filters'
      required: [ extraction_target, options, filters ]

    additional_extract_task_content_basic_attributes:
      description: Additional extract basic attributes task.
      type: object
      properties:
        extraction_target:
          description: Extraction target.
          type: string
          enum: ["basic_attributes"]
        options:
          type: object
          description: Extract task options.
          properties:
            missing:
              type: boolean
              description: Whether to extract only missing basic attributes (`false` is not implemented).
              default: true
        filters:
          description: |
            Object filters.
            Basic attributes re-extraction can be performed on either faces or events (see `objects_type` in filters).
          oneOf:
            - $ref: '#/components/schemas/ae_face_filters'
            - $ref: '#/components/schemas/ae_event_filters'
          discriminator:
            propertyName: objects_type
            mapping:
              faces: '#/components/schemas/ae_face_filters'
              events: '#/components/schemas/ae_event_filters'
      required: [ extraction_target, filters ]

    task_additional_extract_content:
      description: Additional extractor task content.
      oneOf:
        - $ref: '#/components/schemas/additional_extract_task_content_basic_attributes'
        - $ref: '#/components/schemas/additional_extract_task_content_face_descriptor'
        - $ref: '#/components/schemas/additional_extract_task_content_body_descriptor'
      discriminator:
        propertyName: extraction_target
        mapping:
          basic_attributes: '#/components/schemas/additional_extract_task_content_basic_attributes'
          face_descriptor: '#/components/schemas/additional_extract_task_content_face_descriptor'
          body_descriptor: '#/components/schemas/additional_extract_task_content_body_descriptor'

    task_additional_extract_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 5 ]
        content:
          $ref: '#/components/schemas/task_additional_extract_content'
        notification_policy:
          $ref: '#/components/schemas/notification_policy'

    insert_time__gte:
      allOf:
        - $ref: '#/components/schemas/time'
      description: Event insert time lower excluding boundary.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}|[+-]\d{2}:\d{2}))$'
      example: "2018-08-11T09:11:41.674Z"

    insert_time__lt:
      allOf:
        - $ref: '#/components/schemas/time'
      description: Event insert time upper excluding boundary.
      pattern: '^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|\.\d+Z|\.\d+[+-]\d{2}:\d{2}|[+-]\d{2}:\d{2}))$'
      example: "2018-08-11T09:11:41.674Z"

    insert_time_now__lt:
      allOf:
        - $ref: '#/components/schemas/now_delta_time_filter'
      description: |
        End time upper excluded boundary in format `now-time`, where time must be present as follows:
        
        | Parameter value | Description  |
        |---------------------|--------------|
        | `1m`                | one minute   |
        | `2h`                | two hours    |
        | `7d`                | seven days   |
        | `5w`                | five weeks   |
        | `3M`                | three months |
        | `10y`               | ten years    |

    schedule_id:
      type: integer
      nullable: false
      minimum: 1
      description: Schedule according to which the task was created.

    schedule_trigger:
      type: object
      description: Task schedule trigger.
      properties:
        cron:
          type: string
          maxLength: 128
          example: 5 4 * * *
          description: |
            The cron syntax consists of five fields:

            | Field           | Allowed Values        |
            |-----------------|-----------------------|
            | Minute          | 0-59                  |
            | Hour            | 0-23                  |
            | Day of month    | 1-31                  |
            | Month           | 1-12                  |
            | Day of week     | 0-6 (Sunday-Saturday) |

            There are special characters such as `*` (any value), `-` (range), `,` (list), and `/` (step) that can be used before each field.
            
            Expression examples:            
            
            `0 0 * * *` - runs a scheduled task at midnight (00:00) every day.
            
            `*/15 * * * *` - runs a scheduled task every 15 minutes.
            
            `30 8 * * 1-5` - runs a scheduled task at 8:30 AM every weekday (Monday to Friday).
            
            `0 0 1 * *` - runs a scheduled task at midnight (00:00) on the first day of every month.
            
            `0 3 * * 1,3,5` - runs a scheduled task at 3:00 AM every Monday, Wednesday, and Friday.
            
            For more detail about cron syntax see https://en.wikipedia.org/wiki/Cron.

        cron_timezone:
          type: string
          enum: [ utc, local ]
          description: Cron timezone - `utc` or `local`.
          default: local
      required: [ cron ]

    task_type_schedulable:
      type: integer
      enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      example: 1
      description: |
        Task type.

        | Task type         | Value |
        |----------------------|----|
        | Linker               | 1  |
        | Clusterization       | 2  |
        | Report               | 3  |
        | Garbage collection   | 4  |
        | Additional extract   | 5  |
        | Cross match          | 6  |
        | Roc-curve calculation| 7  |
        | Export objects       | 8  |
        | estimator            | 9  |
        | lambda               | 10 |

    task_type_schedulable_reply:
      type: integer
      enum: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      example: 1
      description: |
        Task type.

        | Task type         | Value |
        |----------------------|----|
        | Linker               | 1  |
        | Clusterization       | 2  |
        | Report               | 3  |
        | Garbage collection   | 4  |
        | Additional extract   | 5  |
        | Cross match          | 6  |
        | Roc-curve calculation| 7  |
        | Export objects       | 8  |
        | estimator            | 9  |
        | lambda               | 10 |

    schedule_behaviour:
      type: object
      description: Schedule behaviour parameters.
      properties:
        start_immediately:
          type: boolean
          default: false
          description: Whether to create first task immediately regardless to schedule.
        create_stopped:
          type: boolean
          default: false
          description: |
            Whether to create schedule and not execute any tasks.

            Expected that schedule will execute by user manually in future.

    task_schedule_template_request:
      type: object
      description: tasks schedule
      properties:
        notification_policy:
          $ref: '#/components/schemas/notification_policy'
      required: [task_type, content]

    task_schedule_template_response:
      type: object
      description: tasks schedule
      properties:
        notification_policy:
          $ref: '#/components/schemas/task_notification_policy_response'
      required: [task_type, content, notification_policy]

    linker_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 1 ]
        content:
          $ref: "#/components/schemas/linker_task_content"

    schedule_linker_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/linker_content_props"

    faces_filters_account_schedule_reply:
      allOf:
        - $ref: '#/components/schemas/faces_filters_no_create_time'
      type: object
      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'
        account_id:
          $ref: '#/components/schemas/account_id'
      required: [ account_id ]

    events_filters_account_schedule_reply:
      allOf:
        - $ref: '#/components/schemas/events_filters_no_create_end_time'
      type: object
      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'
        account_id:
          $ref: '#/components/schemas/account_id'
      required: [ account_id ]

    schedule_linker_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 1 ]
        content:
          allOf:
          - $ref: "#/components/schemas/linker_task_content_no_filters"
          type: object
          properties:
            filters:
              anyOf:
                - $ref: '#/components/schemas/faces_filters_account_schedule_reply'
                - $ref: '#/components/schemas/events_filters_account_schedule_reply'
          required: [ objects_type, filters ]

    gc_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 4 ]
        content:
          oneOf:
            - $ref: "#/components/schemas/gc_events_task_content"
            - $ref: "#/components/schemas/gc_faces_task_content"

    schedule_gc_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/gc_content_props"

    gc_events_task_content_schedule_reply:
      allOf:
        - $ref: '#/components/schemas/gc_events_task_content'
        - properties:
            filters:
              type: object
              properties:
                account_id:
                  $ref: '#/components/schemas/account_id'

    gc_faces_task_content_schedule_reply:
      allOf:
        - $ref: '#/components/schemas/gc_faces_task_content'
        - properties:
            filters:
              type: object
              properties:
                account_id:
                  $ref: '#/components/schemas/account_id'

    schedule_gc_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 4 ]
        content:
          oneOf:
            - $ref: "#/components/schemas/gc_events_task_content_schedule_reply"
            - $ref: "#/components/schemas/gc_faces_task_content_schedule_reply"
            - $ref: "#/components/schemas/gc_face_descriptors_task_content_reply"
            - $ref: "#/components/schemas/gc_event_descriptors_task_content_reply"

    cross_match_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 6 ]
        content:
          $ref: "#/components/schemas/cross_match_task_content"

    schedule_cross_match_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/cross_match_content_props"

    schedule_cross_match_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
        - $ref: "#/components/schemas/cross_match_content_props"

    roc_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 7 ]
        content:
          $ref: '#/components/schemas/roc_task_content'

    schedule_roc_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/roc_content_props"

    schedule_roc_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
        - $ref: "#/components/schemas/roc_content_props"

    clustering_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 2 ]
        content:
          $ref: "#/components/schemas/clustering_task_content"

    schedule_clustering_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/clustering_content_props"

    schedule_clustering_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
        - $ref: "#/components/schemas/clustering_content_props"

    reporter_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 3 ]
        content:
          type: object
          properties:
            clusterization:
              $ref: "#/components/schemas/clustering_task_content"
            reporter:
              $ref: "#/components/schemas/ReporterTaskContentWithoutFilters"
          required: [clusterization, reporter]

    schedule_reporter_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/reporter_content_props"

    schedule_reporter_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
        - $ref: "#/components/schemas/reporter_content_props"

    exporter_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 8 ]
        content:
          $ref: "#/components/schemas/exporter_task_content"

    schedule_exporter_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/exporter_content_props"

    schedule_exporter_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
        - $ref: "#/components/schemas/exporter_content_props"

    task_schedulable:
      description: Task schedule.
      oneOf:
        - $ref: '#/components/schemas/schedule_linker_task_content_request'
        - $ref: '#/components/schemas/schedule_clustering_task_content_request'
        - $ref: '#/components/schemas/schedule_reporter_task_content_request'
        - $ref: '#/components/schemas/schedule_gc_task_content_request'
        - $ref: '#/components/schemas/schedule_cross_match_task_content_request'
        - $ref: '#/components/schemas/schedule_roc_task_content_request'
        - $ref: '#/components/schemas/schedule_exporter_task_content_request'
        - $ref: '#/components/schemas/schedule_estimator_task_content_request'
        - $ref: '#/components/schemas/schedule_lambda_task_content_request'
      discriminator:
        propertyName: task_type
        mapping:
          1: '#/components/schemas/schedule_linker_task_content_request'
          2: '#/components/schemas/schedule_clustering_task_content_request'
          3: '#/components/schemas/schedule_reporter_task_content_request'
          4: '#/components/schemas/schedule_gc_task_content_request'
          6: '#/components/schemas/schedule_cross_match_task_content_request'
          7: '#/components/schemas/schedule_roc_task_content_request'
          8: '#/components/schemas/schedule_exporter_task_content_request'
          9: '#/components/schemas/schedule_estimator_task_content_request'
          10: '#/components/schemas/schedule_lambda_task_content_request'

    linker_task_content_reply:
      allOf:
        - $ref: "#/components/schemas/linker_task_content_no_filters"
      type: object
      properties:
        filters:
          anyOf:
            - $ref: '#/components/schemas/faces_filters_regular_create_time'
            - $ref: '#/components/schemas/events_filters_regular_create_time'
      required: [ objects_type, filters ]

    schedule_ae_task_content_reply:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable_reply"
          enum: [ 5 ]
        content:
          $ref: '#/components/schemas/task_additional_extract_content'
        notification_policy:
          $ref: '#/components/schemas/notification_policy'
      required: [task_type, content, notification_policy]

    task_schedulable_reply:
      description: Task schedule.
      oneOf:
        - $ref: '#/components/schemas/schedule_linker_task_content_response'
        - $ref: '#/components/schemas/schedule_clustering_task_content_response'
        - $ref: '#/components/schemas/schedule_reporter_task_content_response'
        - $ref: '#/components/schemas/schedule_gc_task_content_response'
        - $ref: '#/components/schemas/schedule_ae_task_content_reply'
        - $ref: '#/components/schemas/schedule_cross_match_task_content_response'
        - $ref: '#/components/schemas/schedule_roc_task_content_response'
        - $ref: '#/components/schemas/schedule_exporter_task_content_response'
        - $ref: '#/components/schemas/schedule_estimator_task_content_response'
        - $ref: '#/components/schemas/schedule_lambda_task_content_response'
      discriminator:
        propertyName: task_type
        mapping:
          1: '#/components/schemas/schedule_linker_task_content_response'
          2: '#/components/schemas/schedule_clustering_task_content_response'
          3: '#/components/schemas/schedule_reporter_task_content_response'
          4: '#/components/schemas/schedule_gc_task_content_response'
          5: '#/components/schemas/schedule_ae_task_content_reply'
          6: '#/components/schemas/schedule_cross_match_task_content_response'
          7: '#/components/schemas/schedule_roc_task_content_response'
          8: '#/components/schemas/schedule_exporter_task_content_response'
          9: '#/components/schemas/schedule_estimator_task_content_response'
          10: '#/components/schemas/schedule_lambda_task_content_response'

    schedule:
      type: object
      description: tasks schedule
      properties:
        task:
          $ref: '#/components/schemas/task_schedulable'
        trigger:
          $ref: '#/components/schemas/schedule_trigger'
        behaviour:
          $ref: '#/components/schemas/schedule_behaviour'
      required: [ trigger, task ]

    schedule_status:
      type: string
      enum: [ running, stopped ]
      description: |
        Schedule status.

        | Status  | Description                                  |
        |---------|----------------------------------------------|
        | running | Schedule is running                          |
        | stopped | Schedule is stopped by user                   |

    schedule_reply:
      type: object
      properties:
        schedule_id:
          $ref: '#/components/schemas/schedule_id'
        task_ids:
          type: array
          items:
            $ref: '#/components/schemas/task_id'
          example: [ 1,2,3 ]
          description: List of executed task IDs in descending order.
        account_id:
          $ref: '#/components/schemas/account_id'
        task:
          $ref: '#/components/schemas/task_schedulable_reply'
        trigger:
          $ref: '#/components/schemas/schedule_trigger'
        status:
          $ref: '#/components/schemas/schedule_status'
        next_run_time:
          allOf:
            - $ref: '#/components/schemas/time'
          nullable: True
          description: Estimated time for next task.
        create_time:
          allOf:
            - $ref: '#/components/schemas/time'
          description: Schedule create time.
        last_update_time:
          allOf:
            - $ref: '#/components/schemas/time'
          description: Schedule last update time.
      required:
        - schedule_id
        - task_ids
        - account_id
        - task
        - trigger
        - status
        - next_run_time
        - create_time
        - last_update_time

    schedules_reply:
      type: array
      items:
        $ref: '#/components/schemas/schedule_reply'

    use_exif_info:
      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

    source_data:
      type: object
      description: Event source data.
      properties:
        event_end_time:
          allOf:
          - $ref: "#/components/schemas/time"
          description: Event end time.
        event_time:
          allOf:
          - $ref: '#/components/schemas/time'
          description: Event create time.
        external_id:
          $ref: '#/components/schemas/event_external_id'
        meta:
          $ref: '#/components/schemas/event_meta_common'
        source:
          $ref: '#/components/schemas/source'
        stream_id:
          $ref: '#/components/schemas/stream_id'
        tags:
          $ref: '#/components/schemas/tags'
        track_id:
          $ref: '#/components/schemas/track_id'
        user_data:
          $ref: '#/components/schemas/event_user_data'
        location:
          $ref: '#/components/schemas/location'

    event_source_body_meta:
      allOf:
        - $ref: '#/components/schemas/image_meta'
      description: |
        Image meta.
        
        Will be used as User-defined headers (`X-Luna-Meta-*`) to be passed to the Luna Image Store when saving an 
        image origin; should be specified in the format `X-Luna-Meta-<user_defined_key>: <user_defined_value>`
        (will be skipped if the image origin is not specified).
        
        All keys which don't match the `X-Luna-Meta-*` pattern will be ignored.

    image_origin_msgpack:
      properties:
        body:
          description: Raw image in bytes.
          type: bytes
        meta:
          $ref: '#/components/schemas/event_source_body_meta'
      required:
      - body
      type: object

    image_meta:
      type: object
      properties:
        X-Luna-Meta-*:
          type: string
          description: meta information
      required: X-Luna-Meta-*

    source_type:
      type: string
      description: |
        Source type:
        
        - `raw_image`. When set, you can specify the raw image body and the
        corresponding additional parameters in the `source` field. For each raw
        image, detection will be executed, taking into account the indicated
        face/body bounding boxes.
        
        - `detections`. When set, you can specify the detections and the
        corresponding additional parameters in the `source` field. 

      enum: [ raw_image, detections ]

    event_source_base:
      type: object
      properties:
        detect_time:
          $ref: '#/components/schemas/detect_time'
        detect_ts:
          $ref: '#/components/schemas/detect_ts'
        filename:
          description: Image filename.
          type: string
        image_origin:
          oneOf:
          - $ref: '#/components/schemas/image_origin_msgpack'
          - $ref: '#/components/schemas/image_origin'
          description: image origin
        source_type:
          $ref: '#/components/schemas/source_type'

    event_sources_base:
      type: object
      properties:
        aggregate_attributes:
          $ref: '#/components/schemas/aggregate_attributes'
        use_exif_info:
          $ref: '#/components/schemas/use_exif_info'
      required:
      - sources
      - aggregate_attributes

    event_source_raw_image_base:
      type: object
      description: Raw image.
      properties:
        body:
          description: Image in bytes.
          type: bytes
        meta:
          $ref: '#/components/schemas/event_source_body_meta'
        face_detection_data:
          $ref: '#/components/schemas/face_detection_data'
        body_detection_data:
          $ref: '#/components/schemas/body_detection_data'
      required: [ body ]

    event_source_detection_part:
      type: object
      properties:
        warp:
          type: bytes
          description: raw warp
        meta:
          $ref: '#/components/schemas/event_source_body_meta'
        bounding_box:
          $ref: '#/components/schemas/rect'

    event_source_detection:
      type: object
      description: Event source detection.
      properties:
        face:
          allOf:
            - $ref: '#/components/schemas/event_source_detection_part'
          properties:
            angles:
              $ref: '#/components/schemas/angles'
            score:
              $ref: '#/components/schemas/score'
          description: face detection
          additionalProperties:
            x-additionalPropertiesName: face additional fields
            description: any `key=value` pairs
        body:
          allOf:
            - $ref: '#/components/schemas/event_source_detection_part'
          description: body detection

    event_source_detections:
      type: array
      items:
        $ref: '#/components/schemas/event_source_detection'

    event_source_raw_image_aggregated:
      allOf:
        - $ref: '#/components/schemas/event_source_base'
      properties:
        source:
          $ref: '#/components/schemas/event_source_raw_image_base'
      additionalProperties:
        x-additionalPropertiesName: source additional fields
        description: any `key=value` pairs
      required: [ source, source_type ]

    event_source_raw_image_non_aggregated:
      allOf:
        - $ref: '#/components/schemas/event_source_raw_image_aggregated'
      properties:
        source:
          allOf:
            - $ref: '#/components/schemas/event_source_raw_image_base'
          properties:
            source_data:
              $ref: '#/components/schemas/source_data'

    event_source_detections_aggregated:
      allOf:
        - $ref: '#/components/schemas/event_source_base'
      properties:
        source:
          allOf:
            - $ref: '#/components/schemas/event_source_detections'
          description: Detections.
      additionalProperties:
        x-additionalPropertiesName: source additional fields
        description: any `key=value` pairs
      required: [ source, source_type ]

    event_source_detections_non_aggregated:
      allOf:
        - $ref: '#/components/schemas/event_source_detections_aggregated'
      properties:
        source:
          description: Detections.
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/event_source_detection'
            properties:
              source_data:
                $ref: '#/components/schemas/source_data'

    event_sources_non_aggregated:
      oneOf:
        - $ref: '#/components/schemas/event_source_raw_image_non_aggregated'
        - $ref: '#/components/schemas/event_source_detections_non_aggregated'
      discriminator:
        propertyName: source_type
        mapping:
          raw_image: '#/components/schemas/event_source_raw_image_non_aggregated'
          detections: '#/components/schemas/event_source_detections_non_aggregated'

    event_sources_aggregated:
      oneOf:
        - $ref: '#/components/schemas/event_source_raw_image_aggregated'
        - $ref: '#/components/schemas/event_source_detections_aggregated'
      discriminator:
        propertyName: source_type
        mapping:
          raw_image: '#/components/schemas/event_source_raw_image_aggregated'
          detections: '#/components/schemas/event_source_detections_aggregated'

    non_aggregated_event_sources:
      allOf:
        - $ref: '#/components/schemas/event_sources_base'
      properties:
        aggregate_attributes:
          allOf:
            - $ref: '#/components/schemas/aggregate_attributes'
          enum: [0]
        sources:
          items:
            $ref: '#/components/schemas/event_sources_non_aggregated'
          minItems: 1
          type: array

    aggregated_event_sources:
      allOf:
        - $ref: '#/components/schemas/event_sources_base'
      properties:
        aggregate_attributes:
          allOf:
            - $ref: '#/components/schemas/aggregate_attributes'
          enum: [1]
        source_data:
          $ref: '#/components/schemas/source_data'
        sources:
          items:
            $ref: '#/components/schemas/event_sources_aggregated'
          minItems: 1
          type: array

    stream_event_request_body:
      oneOf:
      - $ref: '#/components/schemas/non_aggregated_event_sources'
      - $ref: '#/components/schemas/aggregated_event_sources'
      discriminator:
        propertyName: aggregate_attributes
        mapping:
          0: '#/components/schemas/non_aggregated_event_sources'
          1: '#/components/schemas/aggregated_event_sources'

    lambda_id_response:
      type: object
      properties:
        lambda_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - example: 0468ca85-f6ca-4841-b30c-5ccc26b6f397
            - description: Lambda ID.
      description: Response with lambda ID.
      required: [ lambda_id ]

    lambda_version_response:
      type: object
      properties:
        version:
          type: integer
          description: Lambda version.
      description: Response with lambda version.
      required: [ version ]

    lambda_name:
      type: string
      description: Lambda name. Each user can create only lambdas with unique names.
      example: first-lambda

    lambda_type:
      type: string
      enum: [ standalone, handlers, tasks]
      description: Lambda type.
      example: standalone
      default: "standalone"

    lambda_status:
      type: string
      enum: [ running, waiting, terminated, not_found, pending ]
      description: |
        Lambda status.

        | Status     | Description                                      |
        |------------|--------------------------------------------------|
        | running    | Lambda running                                   |
        | waiting    | Waiting for lambda start                         |
        | terminated | Lambda stopped                                   |
        | not_found  | Lambda not found in kubernetes cluster           |
        | pending    | lambda waiting for suitable conditions           |

        The `running` status is returned when at least one pod in lambda's replicas pods is running or when there is only one lambda pod and it's running.

        The `waiting` status is also returned when all pods in the lambda's replicas have been created but are still starting up.

        * If lambda status is pending it means that there is no suitable conditions for such lambda, for example lambda requires
        GPU and kubernetes cluster cannot provides GPU for lambda.

      example: running

    enable_gpu:
      type: integer
      enum: [0, 1]
      default: 0
      description: |
        Whether to enable GPU usage for lambda.
        
        See `Luna-Lambda` development manual for lambda GPU usage details.

    gpu_enabled:
      type: integer
      enum: [0, 1]
      description: |
        Whether GPU is enabled for lambda.
        
        See `Luna-Lambda` development manual for lambda GPU usage details.

    lambda_resources:
      type: object
      properties:
        cpu_limit:
          $ref: '#/components/schemas/cpu_limit'
        ram_limit:
          $ref: '#/components/schemas/ram_limit'
        cpu_request:
          $ref: '#/components/schemas/cpu_request'
        ram_request:
          $ref: '#/components/schemas/ram_request'
      description: Lambda's resources requests and limits

    lambda_resources_required:
      allOf:
        - $ref: '#/components/schemas/lambda_resources'
      required: [cpu_limit, ram_limit, cpu_request, ram_request]

    cpu_limit:
      type: integer
      default: 1000
      description: CPU resource units limit for each of lambda's pods.  1 unit means 1/1000 of CPU core.

    ram_limit:
      type: integer
      default: 1
      description: Maximum RAM usage limit in GB for each of lambda's pods.

    cpu_request:
      type: integer
      default: 1000
      description: CPU resource units request for each of lambda's pods. Same as limit if not specified.  1 unit means 1/1000 of CPU core.

    ram_request:
      type: integer
      default: 1
      description: RAM usage request in GB for each of lambda's pods. Same as limit if not specified.


    pod_count:
      type: integer
      minimum: 1
      maximum: 32
      default: 1
      example: 2
      description: Count of lambda pods

    lambda_status_response:
      type: object
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/lambda_status'
        pod_statuses:
          type: object
          additionalProperties: true
          example:
            0: running
            1: waiting
          description: |
            Map of pod numbers and their statuses.

            This object is present if at least one of lambda's pod is in `running` status.
      description: response with lambda status.
      required: [ status ]

    description:
      type: string
      description: Lambda description.
      example: very useful lambda
      maxLength: 256
      default: ""

    lambda_patch:
      type: object
      description: lambda patch data
      properties:
        lambda_name:
          $ref: '#/components/schemas/lambda_name'
        description:
          type: string
          description: Lambda description.
          example: very useful lambda
          maxLength: 256
      minProperties: 1

    user_docker_commands:
      type: array
      default: []
      items:
        type: string
      description: List of additional user docker commands for lambda container building (see development manual for details).

    workers:
      type: integer
      minimum: 1
      maximum: 32
      default: 1
      description: Count of lambda workers

    lambda_multipart_content-archive_file:
      type: object
      properties:
        archive:
          type: string
          format: binary
          description: |
            Archive file with zip extension.
            Content-Type must be "application/zip".
        credentials:
          type: object
          description: |
            Lambda credentials.
            Content-Type must be "application/json".
          properties:
            lambda_name:
              type: string
              minLength: 3
              maxLength: 36
              description: Lambda name.
            description:
              $ref: '#/components/schemas/description'
          required: [ lambda_name ]
        parameters:
          type: object
          description: |
            Parameters for lambda.
            Content-Type must be "application/json".
          properties:
            lambda_type:
              $ref: '#/components/schemas/lambda_type'
            additional_user_docker_commands:
              $ref: '#/components/schemas/user_docker_commands'
            base_image:
              $ref: '#/components/schemas/base_image'
            workers:
              $ref: '#/components/schemas/workers'
          required: [ lambda_type ]
        deploy_parameters:
          $ref: '#/components/schemas/deploy_parameters'
      description: lambda multipart content with archive file.
      required: [ archive, credentials ]

    base_image_name:
      type: string
      maxLength: 128
      description: |
        Base image name for lambda docker container building (see development manual for details).
        
        By default `lpa-lambda-base` image is using. This image provides basic functionality for lambda.
        
        The `lpa-lambda-base-fsdk` provides basic functionality and functionality for FSDK usage by lambda.
        
        Other images must be inherited from one of above and require image tag specified.

    base_image_tag:
      type: string
      description: Base lambda image tag. See development manual for details.
      maxLength: 36

    base_image_default:
      type: object
      properties:
        name:
          allOf:
            - $ref: '#/components/schemas/base_image_name'
          enum: [lpa-lambda-base]
          default: lpa-lambda-base
        tag:
          allOf:
            - $ref: '#/components/schemas/base_image_tag'
          description: | 
            Base lambda image tag. See development manual for details.

            The default value is latest available tag of base lambda image.
      required: [name]

    base_image_fsdk:
      type: object
      properties:
        name:
          allOf:
            - $ref: '#/components/schemas/base_image_name'
          enum: [lpa-lambda-base-fsdk]
          default: lpa-lambda-base-fsdk
        tag:
          allOf:
            - $ref: '#/components/schemas/base_image_name'
          description: | 
            Base lambda image tag. See development manual for details.

            The default value is latest available tag of base lambda image.
      required: [name]

    base_image_custom:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/base_image_name'
        tag:
          $ref: '#/components/schemas/base_image_tag'
      required: [name, tag]

    base_image:
      description: |
        Base image for lambda.
        
        Example:
        
        ```json
        "base_image": {"name": "my-custom-image", "tag": "my-custom-tag_latest"}
        ```

        In this case the base image full name will be: `my-custom-image:my-custom-tag_latest`.
      oneOf:
      - $ref: '#/components/schemas/base_image_default'
      - $ref: '#/components/schemas/base_image_fsdk'
      - $ref: '#/components/schemas/base_image_custom'
      discriminator:
        propertyName: name
        mapping:
          lpa-lambda-base: '#/components/schemas/base_image_default'
          lpa-lambda-base-fsdk: '#/components/schemas/base_image_fsdk'
          custom: '#/components/schemas/base_image_custom'

    base_image_reply:
      allOf:
        - $ref: '#/components/schemas/base_image_custom'
      description: Base image for lambda.

    deploy_parameters:
      type: object
      description: Deploy parameters for lambda. Content-Type must be "application/json".
      properties:
        enable_gpu:
          $ref: '#/components/schemas/enable_gpu'
        resources:
          $ref: '#/components/schemas/lambda_resources'
        pod_count:
          $ref: '#/components/schemas/pod_count'
        namespace:
          $ref: '#/components/schemas/namespace'
        selector:
          $ref: '#/components/schemas/selector'

    deploy_parameters_reply:
      type: object
      description: Deploy parameters for lambda.
      properties:
        gpu_enabled:
          $ref: '#/components/schemas/gpu_enabled'
        pod_count:
          $ref: '#/components/schemas/pod_count'
        resources:
          $ref: '#/components/schemas/lambda_resources_required'
        namespace:
          $ref: '#/components/schemas/namespace'
        selector:
          $ref: '#/components/schemas/selector'
      required: [gpu_enabled, pod_count, resources, namespace, selector]

    lambda:
      type: object
      properties:
        account_id:
          $ref: '#/components/schemas/account_id'
        lambda_id:
          allOf:
            - $ref: '#/components/schemas/uuid'
            - description: Lambda ID.
        lambda_name:
          allOf:
            - $ref: '#/components/schemas/lambda_name'
        description:
          $ref: '#/components/schemas/description'
        version:
          type: integer
          description: Lambda version.
          example: 1
        info:
          allOf:
            - $ref: '#/components/schemas/lambda_status_response'
          type: object
          description: lambda info
          required: [status]
        lambda_type:
          $ref: '#/components/schemas/lambda_type'
        create_time:
          allOf:
            - $ref: "#/components/schemas/time"
            - format: date-time
          description: Time of the lambda creation.
        last_update_time:
          allOf:
            - $ref: '#/components/schemas/time'
          description: Date and time with timezone of last action with lambda.
        additional_user_docker_commands:
          $ref: '#/components/schemas/user_docker_commands'
        base_image:
          $ref: '#/components/schemas/base_image_reply'
        workers:
          $ref: '#/components/schemas/workers'
        deploy_parameters:
          $ref: '#/components/schemas/deploy_parameters_reply'
      required: [lambda_id, lambda_name, version, info, create_time, last_update_time, account_id, description, lambda_type, additional_user_docker_commands, base_image, workers, deploy_parameters]

    image_creation_status:
      type: object
      properties:
        status:
          type: string
          enum: [ not_found, in_progress, error, completed ]
          description: |
            Lambda image creation status.

            | Status      | Description                                     |
            |-------------|-------------------------------------------------|
            | in_progress | Image creation in progress                      |
            | error       | Error occured during image creation             |
            | completed   | Image creation completed but not cleaned up yet |
            | not_found   | Image creation complete and cleaned up          |

      required: [ status ]

    lambda_logs:
      type: object
      properties:
        logs:
          type: object
          additionalProperties: true
          description: map of pod numbers and their logs in array of strings
      description: Lambda logs.
      required: [ logs ]

    lambda_image_logs:
      type: object
      properties:
        logs:
          type: array
          items:
            type: string
          description: lambda log strings.
      description: lambda logs.
      required: [logs]

    lambda_validation_error_response:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
          description: Lambda validate errors.
          example: [ validation_error_one, validation_error_two ]
      description: Response of lambda validation.
      required: [ errors ]

    permissions_description: |
      token permissions
      
      \* it is possible to use custom fields for permissions besides those given here
      
      custom fields must have 3-16 characters (lowercase letters, _) with possible permissions: `"creation"`, `"view"`, `"modification"`, `"deletion"`
      
      `"creation"` — allows POST requests
      
      `"view"` — allows GET requests
      
      `"modification"` — allows PUT and PATCH requests
      
      `"deletion"` — allows DELETE requests

    lambda_task_content:
      type: object
      description: Lambda task content.
      properties:
        lambda_id:
          type: string
          description: Lambda task ID.
      required: [lambda_id]
      additionalProperties:
        x-additionalPropertiesName: lambda task content fields
        description: Fields define by lambda task creator.

    lambda_task:
      allOf:
        - $ref: '#/components/schemas/task_base'
        - properties:
            content:
              $ref: '#/components/schemas/lambda_task_content'

    schedule_lambda_task_content_request:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_request"
        - $ref: "#/components/schemas/lambda_content_props"

    schedule_lambda_task_content_response:
      allOf:
        - $ref: "#/components/schemas/task_schedule_template_response"
        - $ref: "#/components/schemas/lambda_content_props"

    task_lambda_reply:
      allOf:
        - $ref: "#/components/schemas/task_template_reply"
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type"
          enum: [ 10 ]
        content:
          $ref: "#/components/schemas/lambda_task_content"

    lambda_content_props:
      type: object
      properties:
        task_type:
          allOf:
            - $ref: "#/components/schemas/task_type_schedulable"
          enum: [ 10 ]
        content:
          $ref: '#/components/schemas/lambda_task_content'

    namespace:
      type: string
      default: default
      pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$
      description: |
        Lambda provides a kubernetes mechanism for isolating groups of resources within a single cluster.

        There are several rules for `namespace` usage:

          - Avoid creating namespaces with the prefix `kube-`, since it is reserved for Kubernetes system namespaces.
          - Contain between 2 and 63 characters.
          - Contain only lowercase alphanumeric characters or '-'.
          - Start and end with an alphanumeric character.

    selector:
      type: object
      description: Kuberenetes pod node selector
      additionalProperties:
        x-additionalPropertiesName: selector fields
        description: |
              Kubernetes `key=value` node labels.
          
              Label key may have two segments an optional prefix and required name, separated by a slash `/`:

              - the name segment is required and must be 63 characters or less
              - the name segment must beginning and ending with an alphanumeric character `[a-z0-9A-Z]`
              - the name segment may contains dashes `-`, underscores `_`, dots `.`
              - the prefix is optional must be a DNS subdomain: a series of DNS labels separated by dots `.`
              - the prefix can't be longer than 253 characters and ends with a slash `/`
              - the prefix can't be `kubernetes.io/` or `k8s.io/`, because these prefixes are reserved for Kubernetes core components

              Label value constraints:

              - the value must be 63 characters or less
              - the value can be empty
              - if the value isn't empty then must begin and end with an alphanumeric character `[a-z0-9A-Z]`
              - the value could contain dashes `-`, underscores `_`, dots `.`, and alphanumerics between.
      example:
        app: lambda-name

    body_detection_data:
      type: array
      description: Body detection data
      items:
        type: object
        additionalProperties:
          x-additionalPropertiesName: body detection additional fields
          description: any `key=value` pairs
        properties:
          bounding_box:
            $ref: '#/components/schemas/rect'
        required: [bounding_box]

    face_detection_data:
      type: array
      description: Face detection data
      items:
        type: object
        additionalProperties:
          x-additionalPropertiesName: face detection additional fields
          description: any `key=value` pairs
        properties:
          bounding_box:
            $ref: '#/components/schemas/rect'
          angles:
            $ref: '#/components/schemas/angles'
          score:
            $ref: '#/components/schemas/score'
        required: [bounding_box]

    score:
      type: float
      description: score
      minimum: 0
      maximum: 1

    angles:
      type: object
      description: angles
      properties:
        pitch:
          allOf:
            - $ref: "#/components/schemas/angle"
          description: pitch
        roll:
          allOf:
            - $ref: "#/components/schemas/angle"
          description: roll
        yaw:
          allOf:
            - $ref: "#/components/schemas/angle"
          description: yaw
      required: [ pitch, roll, yaw ]
  responses:
    internal_server_error_without_body:
      description: Internal server error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'

    internal_server_error:
      description: Internal server error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

    server_timeout_error_without_body:
      description: Server timeout error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'

    server_timeout_error:
      description: Server timeout error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      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:5000/{...}, method {...}
              link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-9"

    payload_to_large:
      description: Request payload too large.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 37003
            desc: Payload too large
            detail: Request payload is too large
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-37003"

    response_timeout_without_body:
      description: Service did not process the request within the specified period.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'

    response_timeout:
      description: Service did not process the request within the specified period.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 37001
            desc: Internal server error
            detail: Service did not process a request within 600 seconds
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-37001"

    request_timeout_without_body:
      description: Service did not receive the complete request message within the specified period.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'

    request_timeout:
      description: Service did not receive the complete request message within the specified period.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 37002
            desc: Request timeout
            detail: Service did not receive a complete request message within 60 seconds
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-37002"

    authorization_error:
      description: Authorization error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
        WWW-Authenticate:
          $ref: '#/components/headers/authenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            bad_format:
              value:
                error_code: 11065
                desc: Authorization failed
                detail: Bad format basic authorization header
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-36002
            invalid_login_password:
              value:
                error_code: 11065
                desc: Authorization failed
                detail: Account login or password are incorrect
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11065
            corrupted_token:
              value:
                error_code: 11065
                desc: Authorization failed
                detail: Specified token corrupted
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11065
            invalid_header:
              value:
                error_code: 11065
                desc: Authorization failed
                detail: Only token is allowed for this action
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11065

    authorization_error_without_body:
      description: Authorization error.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
        WWW-Authenticate:
          $ref: '#/components/headers/authenticate'

    forbidden_error:
      description: Forbidden.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_required:
              value:
                error_code: 11062
                desc: Forbidden
                detail: Specified token corrupted
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11062
            license_problem:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: License expired"
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055
            token_permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059

    forbidden_error_with_handlers:
      description: Forbidden.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_required:
              value:
                error_code: 11062
                desc: Forbidden
                detail: Specified token corrupted
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11062
            license_problem:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: License expired"
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055
            token_permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059
            handlers_is_disabled:
              value:
                error_code: 11071
                desc: Forbidden
                detail: Luna Handlers service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"

    forbidden_lambda_error_with_license:
      description: Forbidden, luna-lambda support is disabled on server.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_required:
              value:
                error_code: 11062
                desc: Forbidden
                detail: Specified token corrupted
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11062
            license_problem:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: License expired"
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055
            token_permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059
            lambdas_is_disabled:
              value:
                error_code: 11072
                desc: Forbidden
                detail: Luna Lambda service is disabled
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11071

    forbidden_lambda_error:
      description: Forbidden, luna-lambda support is disabled on server.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_required:
              value:
                error_code: 11062
                desc: Forbidden
                detail: Specified token corrupted
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11062
            token_permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059
            lambdas_is_disabled:
              value:
                error_code: 11072
                desc: Forbidden
                detail: Luna Lambda service is disabled
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11071

    forbidden_error_with_lis:
      description: Forbidden.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_required:
              value:
                error_code: 11062
                desc: Forbidden
                detail: Specified token corrupted
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11062
            license_problem:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: License expired"
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055
            token_permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059
            lis_is_disabled:
              value:
                error_code: 11070
                desc: Forbidden
                detail: Luna Image Store service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"

    forbidden_error_without_body:
      description: Forbidden.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'

    forbidden_events_error:
      description: Forbidden, luna-events support is disabled on server.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 11040
            desc: Forbidden
            detail: Luna Events service is disabled
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11040"

    forbidden_tasks_error:
      description: Forbidden, luna-tasks support is disabled on server.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            tasks_disabled:
              value:
                error_code: 11039
                desc: Forbidden
                detail: Luna Tasks service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11039"
            permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059
            lis_is_disabled:
              value:
                error_code: 11070
                desc: Forbidden
                detail: Luna Image Store service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"

    forbidden_tasks_error_with_handlers:
      description: Forbidden, luna-tasks support is disabled on server.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            tasks_disabled:
              value:
                error_code: 11039
                desc: Forbidden
                detail: Luna Tasks service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11039"
            permission_denied:
              value:
                error_code: 11059
                desc: Forbidden
                detail: Request denied due to token restrictions, required 'creation' permission for 'face'
                link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11059
            lis_is_disabled:
              value:
                error_code: 11070
                desc: Forbidden
                detail: Luna Image Store service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"
            handlers_is_disabled:
              value:
                error_code: 11071
                desc: Forbidden
                detail: Luna Handlers service is disabled
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"

    face_not_found_error:
      description: Face not found.
      headers:
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Content-Type:
          $ref: '#/components/headers/application_json'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 22002
            desc: Object not found
            detail: Face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"

    verifier_not_found:
      description: Verifier not found.
      headers:
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Content-Type:
          $ref: '#/components/headers/application_json'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      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
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-34004"

    image_not_found:
      description: Image not found.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      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
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"

    object_not_found:
      description: Object not found.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            object_not_found:
              value:
                error_code: 13007
                desc: Object not found
                detail: Object with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13007"

    handler_not_found:
      description: Handler not found.
      headers:
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Content-Type:
          $ref: '#/components/headers/application_json'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      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
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11033"

    list_not_found:
      description: List not found.
      headers:
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Content-Type:
          $ref: '#/components/headers/application_json'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error_code: 22003
            desc: Object not found
            detail: List with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"

    generate_events_bad_input_data:
      description: Bad request.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      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'
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
            bad_content_type:
              value:
                error_code: 12017
                desc: Bad/incomplete input data
                detail: Bad content type
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
            bad_content_type_download_image:
              value:
                error_code: 11028
                desc: Bad/incomplete input data
                detail: 'Bad content type of image ''https://www.google.ru'''
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11028"
            bad_content_type_multipart:
              value:
                error_code: 11029
                desc: Bad/incomplete input data
                detail: Bad content type of image in multipart body
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11029"
            failed_load_image:
              value:
                error_code: 11027
                desc: External request failed
                detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
            bad_multipart_input:
              value:
                error_code: 11027
                desc: Bad/incomplete input data
                detail: 'Not available to send new policies to non-dynamic handler'
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
            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'"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
            unsupported_descriptor_version:
              value:
                error_code: 34001
                desc: Forbidden
                detail: Descriptor version 42 is not supported
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-34001"
            bad_sdk_descriptor:
              value:
                error_code: 12038
                desc: Bad/incomplete input data
                detail: SDK descriptor is not valid
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12038"
            bad_xpk:
              value:
                error_code: 12035
                desc: Bad/incomplete input data
                detail: Failed to parse xpk file
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12035"
            aggregation_not_supported:
              value:
                error_code: 34003
                desc: Bad/incomplete input data
                detail: Aggregation is not supported for raw descriptors
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-34003"

    generate_event_success_response:
      description: Created.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/emit_event_reply'
          examples:
            all_policies_specified:
              summary: all policies specified
              value:
                {
                  "images": [
                    {
                      "error": {
                        "error_code": 0,
                        "desc": "Success",
                        "detail": "Success",
                        "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                      },
                      "status": 1,
                      "filename": "person.jpg",
                      "exif": {
                        "flash": "16",
                        "software": "Adobe Photoshop CC 2017 (Windows)",
                        "artist": "VisionLabs",
                        "make": "NIKON CORPORATION",
                        "model": "NIKON D810"
                      },
                      "image_estimations": {
                        "people": {
                          "count": 1,
                          "coordinates": [[125, 125]]
                        }
                      }
                    }
                  ],
                  "events": [
                    {
                      "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"
                          }
                        },
                        "score": 0.7525901794,
                        "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
                        "samples": [
                          "a3e8716f-70dc-42ad-8428-7a552e800a37"
                        ],
                        "filter": {
                          "is_filtered": true,
                          "filter_reasons": [ {
                            "filter_name": "score_threshold",
                            "object_value": 0,
                            "threshold_value": 0
                          } ]
                        }
                      },
                      "body_attributes": {
                        "score": 0.3546702648,
                        "samples": [
                          "a3e8716f-70dc-42ad-8428-7a552e800a37"
                        ]
                      },
                      "source": "3rd Avenue",
                      "stream_id": "a778c4a5-2191-476e-a261-3b4f9ce2e25e",
                      "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/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c",
                        "lists": [
                          "429b0e78-4616-426a-b57f-02baa72d638d",
                          "6d037c33-31ec-4d73-b3b3-ec80b09446c2"
                        ],
                        "url": "/6/faces/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
                      },
                      "event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
                      "url": "/6/events/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/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",
                                "stream_id": "426542d6-5509-4e5b-8a01-e2abd5c0a8c7"
                              },
                              "similarity": 0.3
                            }
                          ]
                        }
                      ],
                      "location": {
                        "city": "string",
                        "area": "string",
                        "district": "string",
                        "street": "string",
                        "house_number": "string",
                        "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
                                },
                                "attributes": {
                                  "basic_attributes": {
                                    "apparent_age": 0,
                                    "apparent_gender": 0
                                  },
                                  "upper_body": {
                                    "headwear": {
                                      "state": 0,
                                      "apparent_color": "undefined"
                                    },
                                    "sleeve": {
                                      "length": "short"
                                    },
                                    "upper_clothing": {
                                      "colors": [ "white", "black" ]
                                    }
                                  },
                                  "lower_body": {
                                    "lower_garment": {
                                      "type": "trousers",
                                      "colors": [ "white", "black" ]
                                    },
                                    "shoes": {
                                      "apparent_color": "black"
                                    },
                                  },
                                  "accessories": {
                                    "backpack": {
                                      "state": 0
                                    }
                                  }
                                }
                              },
                              "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": 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",
                                    "face_occlusion":
                                      {
                                        "predominant_occlusion": "correct",
                                        "estimations":
                                          {
                                            "full": 0.019,
                                            "clear": 0.02,
                                            "correct": 0.6108324766,
                                            "partially": 0.310,
                                            "mouth": 0.0209,
                                            "chin": 0.019097,
                                          }
                                      }
                                  },
                                  "head_pose": {
                                    "pitch": 18.6827487945557,
                                    "roll": -10.3542232513428,
                                    "yaw": 15.4102487564087
                                  },
                                  "gaze": {
                                    "pitch": 9.26744079589844,
                                    "yaw": -19.4657287597656
                                  },
                                  "eyes_attributes": {
                                    "right_eye": {
                                      "state": "open",
                                      "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 ], [ 167, 167 ], [ 167, 167 ],
                                        [ 166, 166 ], [ 166, 166 ], [ 165, 165 ], [ 164, 164 ], [ 162, 162 ], [ 161, 161 ], [ 160, 160 ], [ 158, 158 ], [ 157, 157 ],
                                        [ 156, 156 ], [ 155, 155 ], [ 154, 154 ], [ 154, 154 ], [ 153, 153 ]
                                      ]
                                    },
                                    "left_eye": {
                                      "state": "open",
                                      "iris_landmarks": [
                                        [ 92, 92 ], [ 92, 92 ], [ 92, 92 ], [ 93, 93 ], [ 94, 94 ], [ 95, 95 ], [ 96, 96 ], [ 97, 97 ], [ 98, 98 ], [ 100, 100 ],
                                        [ 101, 101 ], [ 102, 102 ], [ 103, 103 ], [ 104, 104 ], [ 104, 104 ], [ 105, 105 ], [ 105, 105 ], [ 105, 105 ], [ 104, 104 ],
                                        [ 104, 104 ], [ 103, 103 ], [ 103, 103 ], [ 102, 102 ], [ 100, 100 ], [ 99, 99 ], [ 98, 98 ], [ 97, 97 ], [ 95, 95 ], [ 94, 94 ],
                                        [ 93, 93 ], [ 93, 93 ], [ 92, 92 ]
                                      ]
                                    }
                                  }
                                },
                                "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
                                },
                                "landmarks68": [
                                  [ 8, 8 ], [ 14, 14 ], [ 28, 28 ], [ 48, 48 ], [ 72, 72 ], [ 102, 102 ], [ 134, 134 ], [ 168, 168 ], [ 213, 213 ], [ 262, 262 ],
                                  [ 306, 306 ], [ 345, 345 ], [ 376, 376 ], [ 392, 392 ], [ 397, 397 ], [ 399, 399 ], [ 394, 394 ], [ 2, 2 ], [ 22, 22 ], [ 50, 50 ],
                                  [ 79, 79 ], [ 106, 106 ], [ 165, 165 ], [ 199, 199 ], [ 236, 236 ], [ 278, 278 ], [ 317, 317 ], [ 137, 137 ], [ 136, 136 ],
                                  [ 136, 136 ], [ 136, 136 ], [ 119, 119 ], [ 135, 135 ], [ 154, 154 ], [ 174, 174 ], [ 193, 193 ], [ 40, 40 ], [ 57, 57 ],
                                  [ 83, 83 ], [ 108, 108 ], [ 84, 84 ], [ 58, 58 ], [ 203, 203 ], [ 222, 222 ], [ 249, 249 ], [ 277, 277 ], [ 258, 258 ], [ 229, 229 ],
                                  [ 119, 119 ], [ 130, 130 ], [ 149, 149 ], [ 167, 167 ], [ 185, 185 ], [ 222, 222 ], [ 259, 259 ], [ 232, 232 ], [ 200, 200 ],
                                  [ 177, 177 ], [ 155, 155 ], [ 134, 134 ], [ 127, 127 ], [ 152, 152 ], [ 170, 170 ], [ 190, 190 ], [ 250, 250 ], [ 193, 193 ],
                                  [ 172, 172 ], [ 152, 152 ]
                                ],
                                "landmarks5": [
                                  [ 72, 72 ], [ 240, 240 ], [ 154, 154 ], [ 119, 119 ], [ 259, 259 ]
                                ],
                                "face_quality": {
                                  "status": 0,
                                  "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,
                                        "max": 5
                                      },
                                      "result": 1
                                    },
                                    {
                                      "name": "head_pitch",
                                      "object_value": 3.816443920135498,
                                      "threshold_value": {
                                        "min": -5,
                                        "max": 5
                                      },
                                      "result": 1
                                    },
                                    {
                                      "name": "head_roll",
                                      "object_value": 5.434040069580078,
                                      "threshold_value": {
                                        "min": -8,
                                        "max": 8
                                      },
                                      "result": 1
                                    },
                                    {
                                      "name": "gaze_yaw",
                                      "object_value": -3.773012399673462,
                                      "threshold_value": {
                                        "min": -5,
                                        "max": 5
                                      },
                                      "result": 1
                                    },
                                    {
                                      "name": "gaze_pitch",
                                      "object_value": 0.7140519022941589,
                                      "threshold_value": {
                                        "min": -5,
                                        "max": 5
                                      },
                                      "result": 1
                                    },
                                    {
                                      "name": "mouth_smiling",
                                      "object_value": 0.000290759839117527,
                                      "threshold_value": {
                                        "min": 0,
                                        "max": 0.5
                                      },
                                      "result": 1
                                    },
                                    {
                                      "name": "mouth_occluded",
                                      "object_value": 0.00009619363845558837,
                                      "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
                                      },
                                      "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.7305162000656128,
                                      "threshold_value": { "min": 0.5, "max": 1.0 },
                                      "result": 1
                                    },
                                    {
                                      "name": dynamic_range,
                                      "object_value": 0.6605162000656128,
                                      "threshold_value": { "min": 0.5, "max": 1.0 },
                                      "result": 1
                                    },
                                    {
                                      "name": background_lightness,
                                      "object_value": 0.5780888795852661,
                                      "threshold_value": { "min": 0.2, "max": 1.0 },
                                      "result": 1
                                    },
                                    {
                                      "name": background_uniformity,
                                      "object_value": 0.8874394297599792,
                                      "threshold_value": { "min": 0.5, "max": 1.0 },
                                      "result": 1
                                    },
                                    {
                                      "name": shoulders_position,
                                      "object_value": 'parallel',
                                      "threshold_value": [ 'parallel' ],
                                      "result": 1
                                    }
                                  ]
                                }
                              },
                              "url": "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
                            }
                          },
                          "detect_time": "2018-08-11T09:11:41.674Z",
                          "detect_ts": 123.456,
                          "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                        }
                      ],
                      "track_id": "useful_track_id_number_1",
                      "meta": { "foo": "bar" },
                      "aggregate_estimations": {
                        "face": {
                          "attributes": {
                            "liveness": {
                              "prediction": "real",
                              "estimations": {
                                "quality": 0.9,
                                "score": 0.8
                              }
                            },
                              "deepfake": {
                                "prediction": "real",
                                "score": 0.8
                              }
                          }
                        },
                        "body": {
                          "attributes": {
                            "upper_body": {
                              "headwear": {
                                "state": 0,
                                "apparent_color": "undefined"
                              },
                              "sleeve": {
                                "length": "short"
                              },
                              "upper_clothing": {
                                "colors": [ "white", "black" ]
                              }
                            },
                            "lower_body": {
                              "lower_garment": {
                                "type": "trousers",
                                "colors": [ "white", "black" ]
                              },
                              "shoes": {
                                "apparent_color": "black"
                              },
                            },
                            "accessories": {
                              "backpack": {
                                "state": 0
                              }
                            }
                          }
                        }
                      }
                    }
                  ],
                  "filtered_detections": {
                    "face_detections": [ ]
                  },
                }
            basic_attributes_and_descriptor:
              summary: basic attributes and descriptor
              value:
                {
                  "images": [
                    {
                      "error": {
                        "error_code": 0,
                        "desc": "Success",
                        "detail": "Success",
                        "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                      },
                      "status": 1,
                      "filename": "person.jpg",
                      "image_estimations": {
                        "people": {
                          "count": 1,
                          "coordinates": [[125, 125]]
                        }
                      }
                    }
                  ],
                  "events": [
                    {
                      "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"
                          }
                        },
                        "score": 0,
                        "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
                        "samples": [
                          "a3e8716f-70dc-42ad-8428-7a552e800a37"
                        ],
                      },
                      "body_attributes": null,
                      "source": "Main_hall_camera",
                      "stream_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
                      "tags": [
                        "tag_2",
                        "tag_1"
                      ],
                      "event_id": "a09f8cdc-b002-4252-9244-d613ad78ae9e",
                      "url": "http://events:5040/2/events/a09f8cdc-b002-4252-9244-d613ad78ae9e",
                      "matches": [ ],
                      "external_id": "14159261415926",
                      "user_data": "test_image",
                      "location": {
                        "geo_position": {
                          "latitude": -73.9906401596,
                          "longitude": 40.7627248564
                        },
                        "district": "Midtown",
                        "city": "New York",
                        "area": "Manhattan",
                        "street": "West 48th street",
                        "house_number": "220"
                      },
                      "track_id": "There_and_Back_Again",
                      "detections": [
                        {
                          "filename": "penelope.jpeg",
                          "samples": {
                            "face": {
                              "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
                              "detection": {
                                "attributes": { },
                                "rect": {
                                  "height": 240,
                                  "width": 209,
                                  "x": 170,
                                  "y": 198
                                },
                                "landmarks5": [
                                  [ 72, 72 ], [ 240, 240 ], [ 154, 154 ], [ 119, 119 ], [ 259, 259 ]
                                ],
                              },
                              "url": "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
                            },
                            "body": null,
                          },
                          "detect_time": "2018-08-11T09:11:41.674Z",
                          "detect_ts": 123.456,
                          "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                        }
                      ],
                      "face": null,
                      "meta": { "foo": "bar" },
                      "aggregate_estimations": {
                        "face": {
                          "attributes": {
                          }
                        },
                        "body": {
                          "attributes": {
                          }
                        },
                      },
                    },
                  ],
                  "filtered_detections": {
                    "face_detections": [ ]
                  },
                }
            simple_all_policies_request_no_filters:
              summary: request with all policies without filters
              value:
                {
                  "images": [
                    {
                      "error": {
                        "error_code": 0,
                        "desc": "Success",
                        "detail": "Success",
                        "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                      },
                      "status": 1,
                      "filename": "person.jpg",
                      "image_estimations": {
                        "people": {
                          "count": 1,
                          "coordinates": [[125, 125]]
                        }
                      }
                    }
                  ],
                  "events": [
                    {
                      "face_attributes": {
                        "attribute_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
                        "score": 0.45,
                        "url": "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34",
                        "samples": [
                          "a3e8716f-70dc-42ad-8428-7a552e800a37"
                        ],
                      },
                      "body_attributes": null,
                      "source": null,
                      "stream_id": null,
                      "tags": [
                        "new_tag"
                      ],
                      "event_id": "9396b593-a97d-4606-8644-80fc79cca35e",
                      "url": "/6/events/9396b593-a97d-4606-8644-80fc79cca35e",
                      "matches": [ ],
                      "external_id": "",
                      "user_data": "",
                      "location": { },
                      "track_id": "There_and_Back_Again",
                      "detections": [
                        {
                          "filename": "penelope.jpeg",
                          "samples": {
                            "face": {
                              "sample_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e",
                              "detection": {
                                "attributes": { },
                                "rect": {
                                  "height": 240,
                                  "width": 209,
                                  "x": 170,
                                  "y": 198
                                },
                                "landmarks5": [
                                  [ 72, 72 ], [ 240, 240 ], [ 154, 154 ], [ 119, 119 ], [ 259, 259 ]
                                ],
                              },
                              "url": "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
                            },
                            "body": null,
                          },
                          "detect_time": "2018-08-11T09:11:41.674Z",
                          "detect_ts": 123.456,
                          "image_origin": "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                        }
                      ],
                      "face": {
                        "external_id": "",
                        "face_id": "f792009d-b59a-4a3d-b5e5-3a9bb12d34ba",
                        "user_data": "",
                        "url": "/6/faces/f792009d-b59a-4a3d-b5e5-3a9bb12d34ba",
                        "lists": [
                          "b002ee1a-a35b-4aa6-8a16-b85333037bed"
                        ],
                        "avatar": "/6/samples/faces/4a265117-b1be-4760-bd13-c6cc33179926",
                        "event_id": "9396b593-a97d-4606-8644-80fc79cca35e"
                      },
                      "meta": { "foo": "bar" },
                      "aggregate_estimations": {
                        "face": {
                          "attributes": {
                          }
                        },
                        "body": {
                          "attributes": {
                          }
                        },
                      }
                    }
                  ],
                  "filtered_detections": {
                    "face_detections": [ ]
                  },
                }

    generate_events_access_errors:
      description: Forbidden.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            auth_required:
              value:
                error_code: 12010
                desc: Bad/incomplete input data
                detail: "This resource needs 'Authorization' authorization headers"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12010"
            events_is_disabled:
              value:
                error_code: 11040
                desc: Forbidden
                detail: "Luna Events service is disabled"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11040"
            lis_is_disabled:
              value:
                error_code: 11070
                desc: Forbidden
                detail: "Luna Image Store service is disabled"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"
            handlers_is_disabled:
              value:
                error_code: 11071
                desc: Forbidden
                detail: "Luna Handlers service is disabled"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"
            license_problem:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: License expired"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
            liveness:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: Liveness feature disabled"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
            deepfake_disabled:
              value:
                error_code: 11055
                desc: Forbidden
                detail: "License problem: Deepfake feature disabled"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
            blacklisted:
              value:
                error_code: 11067
                desc: Forbidden
                detail: "Request denied due to token restrictions. According to `emit_events` the handler is not whitelisted or handler is blacklisted."
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11067"
            events_generation_denied:
              value:
                error_code: 11068
                desc: Forbidden
                detail: "Request denied due to token restrictions. Events generation is not allowed"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11068"

    method_not_allowed:
      description: Method not allowed.
      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'
          example:
            error_code: 12021
            desc: Method not allowed
            detail: Method not allowed
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12021"

    lambda_not_found:
      description: lambda 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'
          example:
            error_code: 42001
            desc: Object not found
            detail: Lambda with id 'e63e2a1f-f505-441c-8e11-b2dcd0385329' not found
            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12013"

    lambda_or_page_not_found:
      description: lambda not found or page 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:
            lambda_not_found:
              value:
                error_code: 42001
                desc: Object not found
                detail: Lambda with id 'e63e2a1f-f505-441c-8e11-b2dcd0385329' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12013"
            lambda_page_not_found:
              value:
                error_code: 12013
                desc: Resource not found
                detail: Page not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12013"

    forbidden_resource_error:
      description: Forbidden.
      headers:
        Content-Type:
          $ref: '#/components/headers/application_json'
        Luna-Request-Id:
          $ref: '#/components/headers/luna_request_id'
        Access-Control-Allow-Origin:
          $ref: '#/components/headers/access_control_allow_origin'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            resource_is_disabled:
              value:
                error_code: 12049
                desc: Forbidden
                detail: Resource is disabled.
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12049"
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: |
          Basic authorization with login and password. See [accounts](#tag/accounts) for details.
          Represents base64-encoded "username:password" credentials

    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer authorization with token. See [tokens](#tag/tokens) for details.

    LunaAccountIdAuth:
      type: http
      scheme: Luna-Account-Id header
      deprecated: true
      description: |
            Authorization using `Luna-Account-Id` header. Deprecated. 
            If `Authorization` header specified, `Luna-Account-Id` will be ignored.
paths:
  /version:
    get:
      tags:
      - version

      summary: get version
      description: Get versions of services.
      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  LUNA PLATFORM:
                    $ref: '#/components/schemas/platform_version'
                  luna-api:
                    $ref: '#/components/schemas/version'
                  luna-events:
                    $ref: '#/components/schemas/version'
                  luna-faces:
                    $ref: '#/components/schemas/version'
                  luna-handlers:
                    $ref: '#/components/schemas/version'
                  luna-image-store-bodies-samples:
                    $ref: '#/components/schemas/version'
                  luna-image-store-faces-samples:
                    $ref: '#/components/schemas/version'
                  luna-image-store-images:
                    $ref: '#/components/schemas/version'
                  luna-matcher-proxy:
                    $ref: '#/components/schemas/version'
                  luna-python-matcher:
                    $ref: '#/components/schemas/version'
                  luna-tasks:
                    $ref: '#/components/schemas/version'
                  luna-remote-sdk:
                    $ref: '#/components/schemas/version'
                  luna-lambda:
                    $ref: '#/components/schemas/version'
                required: [luna-api, luna-faces, luna-remote-sdk, LUNA PLATFORM]
              example:
                LUNA PLATFORM:
                  major: 0
                  minor: 0
                  patch: 0
                luna-api: 
                  api: 5
                  major: 3
                  minor: 1
                  patch: 2
                luna-events:
                  api: 1
                  major: 1
                  minor: 0
                  patch: 5
                luna-faces:
                  api: 2
                  major: 2
                  minor: 3
                  patch: 9
                luna-image-store-bodies-samples:
                  api: 1
                  major: 2
                  minor: 1
                  patch: 11
                luna-image-store-faces-samples:
                  api: 1
                  major: 2
                  minor: 1
                  patch: 10
                luna-image-store-images:
                  api: 1
                  major: 2
                  minor: 1
                  patch: 13
                luna-handlers:
                  api: 1
                  major: 1
                  minor: 0
                  patch: 0
                luna-tasks:
                  api: 1
                  major: 1
                  minor: 0
                  patch: 13
                luna-matcher-proxy:
                  api: 1
                  major: 1
                  minor: 0
                  patch: 0
                luna-remote-sdk:
                  api: 1
                  major: 1
                  minor: 0
                  patch: 0
                luna-lambda:
                  api: 1
                  major: 1
                  minor: 0
                  patch: 0

        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
      - version

      summary: version options
      description: Get options for the resource.
      operationId: getVersionOptions

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/accounts:
    parameters:
      - $ref: '#/components/parameters/luna_request_id'

    get:
      tags:
        - accounts

      summary: get accounts
      description: Get accounts.
      operationId: getAccounts
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/login'
        - $ref: '#/components/parameters/account_type'
        - $ref: '#/components/parameters/create_time__lt'
        - $ref: '#/components/parameters/create_time__gte'
        - $ref: '#/components/parameters/account_targets'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            url = f"{baseUri}/accounts"
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }

            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            accountId = "8d5f7c8a-6312-457a-9d82-5caf86621b65"
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )

            response = luna3client.createAccount(
                lunaRequestId="1536751345," + accountId,
                raiseError=True,
                login="login_accounts_get_luna3@visionlabs.ru",
                password="password",
                accountType="user",
                description="description",
            )

            accountId = response.json["account_id"]

            response = luna3client.getAccounts(lunaRequestId="1536751345," + accountId)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/accounts' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      security:
        - BasicAuth: []
        - LunaAccountIdAuth: []
        - BearerAuth: []
      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/accounts_to_receive'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        403:
          description: Permission 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:
                token_permission_denied:
                  value:
                    error_code: 11064
                    desc: Forbidden
                    detail: Access to the resource is denied using authorization by token
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11064
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'


    post:
      tags:
      - accounts

      summary: create account
      description: Create an account.
      parameters:
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id_new_account'
      operationId: createAccount
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            # create account
            url = f"{baseUri}/accounts"
            payload = {"login": "login_accounts_post_python@visionlabs.ru", "password": "string",
                       "account_type": "advanced_user", "description": "main admin account"}
            response = requests.post(url, json=payload)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            
            accountId = "8d5f7c8a-6312-457a-9d82-5caf86621b62"
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            response = luna3client.createAccount(
                lunaRequestId="1536751345," + accountId,
                raiseError=True,
                login="login_accounts_post_luna3@visionlabs.ru",
                password="password",
                accountType="user",
                description="description",
            )
            
            accountId = response.json["account_id"]
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/accounts' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b63' \
            --header 'Content-Type: application/json' \
            --data '{
              "login": "login_accounts_post_bash@visionlabs.ru",
              "password": "password",
              "account_type": "user",
              "description": "description"
            }'
      security:
        - BasicAuth: []
        - LunaAccountIdAuth: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/account_to_create'

      responses:
        201:
          description: Create success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                format: url
                example: /3/account
              description: Location of the account.
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/account_creation_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:
                extra_fields:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''extra fields not permitted'''
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: unexpected value'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022
        409:
          description: Integrity error.
          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:
                login_already_exists:
                  value:
                    error_code: 41001
                    desc: Integrity error
                    detail: Account with login 'mylogin@gmail.com' already exists
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41001
                account_id_already_exists:
                  value:
                    error_code: 41002
                    desc: Integrity error
                    detail: Account with account_id 'f8996094-9f1c-449a-b9d5-7e7279d345e9' already exists
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41002
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - accounts
      summary: accounts options
      description: Get options for the resource.
      operationId: getAccountsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/account:
    parameters:
      - $ref: '#/components/parameters/luna_request_id'

    get:
      tags:
      - account

      summary: get account
      description: Get account.
      operationId: getAccount
      security:
        - BasicAuth: []
        - LunaAccountIdAuth: []
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/account_targets'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            url = f"{baseUri}/account"
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            
            response = requests.get(url, headers=headers)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            
            accountId = "8d5f7c8a-6312-457a-9d82-5caf86621b65"
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            response = luna3client.createAccount(
                lunaRequestId="1536751345," + accountId,
                raiseError=True,
                login="login_account_get_luna3@visionlabs.ru",
                password="password",
                accountType="user",
                description="description",
            )
            
            accountId = response.json["account_id"]
            
            response = luna3client.getAccount(accountId=accountId, lunaRequestId="1536751345," + accountId)
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/account' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      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/account_to_receive'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Permission 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:
                token_permission_denied:
                  value:
                    error_code: 11064
                    desc: Forbidden
                    detail: Access to the resource is denied using authorization by token
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11064
        404:
          description: Account 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'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Account with id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    patch:
      tags:
      - account

      summary: patch account
      description: Patch account. At least one field must be specified.
      operationId: patchAccount
      security:
        - BasicAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            url = f"{baseUri}/account"
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            payload = {"description": "new_description"}
            
            response = requests.patch(url, json=payload, headers=headers)
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            
            accountId = "8d5f7c8a-6312-457a-9d82-5caf86621b67"
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            response = luna3client.createAccount(
                lunaRequestId="1536751345," + accountId,
                raiseError=True,
                login="login_account_patch_luna3@visionlabs.ru",
                password="password",
                accountType="user",
                description="description",
            )
            
            accountId = response.json["account_id"]
            
            response = luna3client.patchAccount(
                accountId=accountId,
                lunaRequestId="1536751345," + accountId,
                description="new description"
            )
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PATCH 'http://127.0.0.1:5000/6/account' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"description": "new description"}'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/account_for_patch'

      responses:
        204:
          description: Update success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            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:
                extra_fields:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: ''extra_field'',  message: ''extra fields not permitted'''
                no_fields:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''at least 1 field must be specified'''
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Permission 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:
                unallowed_to_change_admin_account_type:
                  value:
                    error_code: 41004
                    desc: Forbidden
                    detail: Account with account_id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' has admin type and its type can't be changed
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41004
                token_permission_denied:
                  value:
                    error_code: 11064
                    desc: Forbidden
                    detail: Access to the resource is denied using authorization by token
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11064
        404:
          description: Account 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:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Account with id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001
        409:
          description: Integrity error.
          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:
                login_already_exists:
                  value:
                    error_code: 41001
                    desc: Integrity error
                    detail: Account with login 'mylogin@gmail.com' already exists
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41001
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - account
      summary: accounts options
      description: Get options for the resource.
      operationId: getAccountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tokens:
    parameters:
      - $ref: '#/components/parameters/luna_request_id'

    post:
      tags:
      - tokens

      summary: create token
      description: Create a token.
      operationId: createToken
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/grant_all_permissions'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            url = f"{baseUri}/tokens"
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None}
            response = requests.post(url, json=payload, headers=headers)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.accounts.http_objs import TokenPermissions
            from luna3.lunavl.httpclient import LunaHttpClient
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            
            response = luna3client.createToken(tokenPermissions=TokenPermissions(), raiseError=True)
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tokens' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"permissions": {"face": ["view"]}, "expiration_time": null}'
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/token_to_create'
                - $ref: '#/components/schemas/token_with_all_permissions'
            examples:
                full_token:
                  summary: full_token
                  value: {
                      "description": "main account token",
                      "expiration_time": "2050-11-11T11:11:11.111+03:00",
                      "permissions": {
                        "account": ["view"],
                        "face": ["creation", "view", "modification", "deletion", "matching"],
                        "list": ["creation", "view", "modification", "deletion"],
                        "event": ["creation", "view", "matching"],
                        "attribute": ["creation", "view", "modification", "deletion", "matching"],
                        "handler": ["creation", "view", "modification", "deletion"],
                        "verifier": ["creation", "view", "modification", "deletion"],
                        "task": ["creation", "view", "modification", "deletion"],
                        "face_sample": ["creation", "view", "deletion"],
                        "body_sample": ["creation", "view", "deletion"],
                        "image": ["creation", "view", "deletion"],
                        "object": ["creation", "view", "deletion"],
                        "token": ["creation", "view", "modification", "deletion"],
                        "resources": ["iso", "sdk", "liveness"],
                        "emit_events": {
                            "allowed": 1,
                            "white_list": null,
                            "black_list": null
                        },
                        "lambdas": ["creation", "view", "modification", "deletion"],
                      },
                      "visibility_area": "all"
                    }

      responses:
        201:
          description: Create success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                format: url
                example: /3/tokens/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: Location of the token.
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/token_creation_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:
                extra_fields:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''extra fields not permitted'''
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: unexpected value'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
      - tokens

      summary: get tokens
      description: Get tokens.
      operationId: getTokens
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/page_size'
      - $ref: '#/components/parameters/luna_account_id'
      - $ref: '#/components/parameters/query_account_id'
      - $ref: '#/components/parameters/create_time__lt'
      - $ref: '#/components/parameters/create_time__gte'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            # create token
            url = f"{baseUri}/tokens"
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            payload = {"permissions": {"face": ["view"]}, "description": "description"}
            requests.post(url, json=payload, headers=headers)
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            url = f"{baseUri}/tokens"
            response = requests.get(url, headers=headers, params={"page": 1, "page_size": 10})
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.accounts.http_objs import TokenPermissions
            from luna3.lunavl.httpclient import LunaHttpClient
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            # create token
            luna3client.createToken(tokenPermissions=TokenPermissions(), raiseError=True)
            
            response = luna3client.getTokens(lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a")
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tokens' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      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/tokens_to_receive'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - tokens
      summary: tokens options
      description: Get options for the resource.
      operationId: getTokensOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tokens/{token_id}:
    parameters:
      - $ref: '#/components/parameters/token_id_path_required'
      - $ref: '#/components/parameters/luna_request_id'

    put:
      tags:
      - tokens

      summary: replace token
      description: Update token. You cannot update a part of the token, so you should specify all the fields for your token.
      operationId: putToken
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/grant_all_permissions'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            url = f"{baseUri}/tokens"
            payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None}
            tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"]
            
            url = f"{baseUri}/tokens/{tokenId}"
            response = requests.put(url, headers=headers, json=payload)
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.accounts.http_objs import TokenPermissions
            from luna3.lunavl.httpclient import LunaHttpClient
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            tokenId = luna3client.createToken(
                tokenPermissions=TokenPermissions(), raiseError=True
            ).json["token_id"]
            
            response = luna3client.replaceToken(
                tokenId=tokenId, tokenPermissions=TokenPermissions(), description="new description")
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PUT 'http://127.0.0.1:5000/6/tokens/8d5f7c8a-6312-457a-9d82-a4b254181252' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"permissions": {"face": ["view"]}, "expiration_time": null}'

      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/token_to_create'
                - $ref: '#/components/schemas/token_with_all_permissions'

      responses:
        201:
          description: Replace success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                format: url
                example: /3/tokens/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: Location of the token.
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/token_creation_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:
                extra_fields:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''extra fields not permitted'''
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: unexpected value'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Token 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'
              examples:
                not_found:
                  value:
                    error_code: 41003
                    desc: Object not found
                    detail: Token with id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41003
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
      - tokens

      summary: get token
      description: Get token by ID.
      operationId: getToken
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            url = f"{baseUri}/tokens"
            payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None}
            tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"]
            
            url = f"{baseUri}/tokens/{tokenId}"
            response = requests.get(url, headers=headers)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.accounts.http_objs import TokenPermissions
            from luna3.lunavl.httpclient import LunaHttpClient
            
            luna3client = LunaHttpClient(login="luna@visionlabs.ru", password="luna", origin="http://127.0.0.1:5000")
            
            tokenId = luna3client.createToken(tokenPermissions=TokenPermissions(), raiseError=True).json["token_id"]
            
            response = luna3client.getToken(tokenId=tokenId)
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tokens/8d5f7c8a-6312-457a-9d82-a4b254181252' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      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/token_to_receive'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Token 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'
              examples:
                bad_query_param:
                  value:
                    error_code: 41003
                    desc: Object not found
                    detail: Token with id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41003
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
      - tokens

      summary: delete token
      description: Delete token by ID.
      operationId: deleteToken
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            url = f"{baseUri}/tokens"
            payload = {"permissions": {"face": ["view"]}, "description": "description", "expiration_time": None}
            tokenId = requests.post(url, json=payload, headers=headers).json()["token_id"]
            
            url = f"{baseUri}/tokens/{tokenId}"
            response = requests.delete(url, headers=headers)
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.accounts.http_objs import TokenPermissions
            from luna3.lunavl.httpclient import LunaHttpClient
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            tokenId = luna3client.createToken(tokenPermissions=TokenPermissions(), raiseError=True).json["token_id"]
            
            response = luna3client.deleteToken(tokenId=tokenId)
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/tokens/8d5f7c8a-6312-457a-9d82-a4b254181252' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        204:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Token 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'
              examples:
                not_found:
                  value:
                    error_code: 41003
                    desc: Object not found
                    detail: Token with id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41003
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - tokens
      summary: token options
      description: Get options for the resource.
      operationId: getTokenOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/credentials_verifier:
    parameters:
      - $ref: '#/components/parameters/luna_request_id'

    post:
      tags:
      - credentials verifier

      summary: verify credentials
      description: |
        Verify account or login with password or token.
        * In the case of success `account id` verification, `account_type` will be returned
        * In the case of success `login`/`password` verification, `account_id` and `account_type` will be returned
        * In the case of success `token` verification, `account_type` and token `permissions` will be returned
        * In the case of failure verification, error will be returned
      parameters:
        - $ref: '#/components/parameters/applicationJsonContent'
      operationId: verifyCredentials
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            accountId = "8d5f7c8a-6312-457a-9d82-a4b254181264"
            
            # create account
            headers = {"Luna-Account-Id": accountId}
            url = f"{baseUri}/accounts"
            payload = {"login": "login_verifier_post_python@visionlabs.ru", "password": "string",
                       "account_type": "advanced_user", "description": "main admin account"}
            requests.post(url, json=payload, headers=headers)
            
            url = f"{baseUri}/credentials_verifier"
            payload = {"account_id": accountId}
            response = requests.post(url, json=payload, headers=headers)
            
            print(response.status_code)

        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            
            accountId = "8d5f7c8a-6312-457a-9d82-a4b254181265"
            luna3client = LunaHttpClient(
                origin="http://127.0.0.1:5000"
            )
            
            luna3client.createAccount(
                accountId=accountId,
                lunaRequestId="1536751345," + accountId,
                raiseError=True,
                login="login_verifier_post_luna3@visionlabs.ru",
                password="password",
                accountType="user",
                description="description",
            )
            
            response = luna3client.verifyAccount(accountId=accountId)
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/credentials_verifier' \
            --header 'Luna-Request-Id: 1536751345,8d5f7c8a-6312-457a-9d82-a4b254181264' \
            --header 'Content-Type: application/json' \
            --data '{"account_id": "8d5f7c8a-6312-457a-9d82-a4b254181264"}'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/verifier_post_data'

      responses:
        200:
          description: Verification success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verification_response'
        400:
          description: Bad input data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                request_does_not_contain_json:
                  value:
                    error_code: 12002
                    desc: Bad/incomplete input data
                    detail: Request does not contain json
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12002
        401:
          description: Verification failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                account_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Account with id '8950722f-3fd4-4223-b48f-03f95f0e8dfb' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001
                token_not_found:
                  value:
                    error_code: 41005
                    desc: Object not found
                    detail: JWT token doesn't exist
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41005
                login_password_incorrect:
                  value:
                    error_code: 41006
                    desc: Account credentials wrong
                    detail: Login and password doesn't match any user
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41006
                expired:
                  value:
                    error_code: 41007
                    desc: Account credentials wrong
                    detail: Token has been expired
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-41007
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
      - credentials verifier
      summary: credentials verifier options
      description: Get options for the resource.
      operationId: verifyCredentialsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/sdk:
    post:
      tags:
        - sdk
      summary: sdk resource
      description: |
        Detect faces and/or human bodies and estimate attributes on the input images. After the request is performed, the received data is not saved to the database or Image Store, it is only returned in the response.

        The order of input images corresponds to the order of the elements in the output JSON.

        If an input image is corrupted, an error is returned for the image. The processing of the other images continues in normal mode.

        Notes for incoming data:
          - face or body *bounding boxes* passed with face or body warped image will be ignored.

      operationId: sdk
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      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/luna_account_id'
        - $ref: '#/components/parameters/image_type'
        - $ref: '#/components/parameters/estimate_people_count'
        - $ref: '#/components/parameters/people_count_coordinates'
        - $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_mask'
        - $ref: '#/components/parameters/estimate_glasses'
        - $ref: '#/components/parameters/estimate_liveness'
        - $ref: '#/components/parameters/estimate_deepfake'
        - $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_face_descriptor'
        - $ref: '#/components/parameters/estimate_basic_attributes'
        - $ref: '#/components/parameters/estimate_body_descriptor'
        - $ref: '#/components/parameters/estimate_upper_body'
        - $ref: '#/components/parameters/estimate_lower_body'
        - $ref: '#/components/parameters/estimate_accessories'
        - $ref: '#/components/parameters/estimate_body_basic_attributes'
        - $ref: '#/components/parameters/estimate_body_warp'
        - $ref: '#/components/parameters/estimate_face_warp'
        - $ref: '#/components/parameters/aggregate_attributes_sdk'
        - $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/deepfake_states'
        - $ref: '#/components/parameters/use_exif_info'
        - $ref: '#/components/parameters/extract_exif'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            params = {
                "multiface_policy": 1,
                "detect_face": 1,
                "detect_body": 0,
                "estimate_head_pose": 1,
                "estimate_mouth_attributes": 1,
                "pitch_threshold": 180,
                "score_threshold": 0.5,
            }

            url = f"{baseUri}/sdk"
            response = requests.post(url, headers=headers, params=params, data=image,)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.sdk(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                inputData=BinaryImage("image.jpg"),
                multifacePolicy=1,
                detectFace=1,
                detectBody=0,
                estimateHeadPose=1,
                estimateMouthAttributes=1,
                pitchThreshold=180,
                scoreThreshold=0.5,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/sdk?multiface_policy=1&detect_face=1&detect_body=0&estimate_head_pose=1&estimate_mouth_attributes=1&pitch_threshold=180&score_threshold=0.5' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: image/jpeg' \
            --data-binary '@image.jpg'
      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sdk_response_json'
              examples:
                face_and_body_example:
                  value:
                    images_estimations:
                      - filename: raw image
                        exif:
                          make: Apple
                          model: iPhone 11
                          gps:
                            latitude: 55.0, 45.0, 18.29
                            longitude: 37.0, 39.0, 16.32
                          software: 13.6.1
                          orientation: 6
                        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:
                                    predominant_mask: occluded
                                    estimations:
                                      medical_mask: 0.020060448
                                      missing: 0.3235525191
                                      occluded: 0.6563870311
                                    face_occlusion:
                                      predominant_occlusion: correct
                                      estimations:
                                        full: 0.019
                                        clear: 0.02
                                        correct: 0.6108324766
                                        partially: 0.310
                                        mouth: 0.0209
                                        chin: 0.019097
                                  glasses:
                                    glasses: "no_glasses"
                                  mouth_attributes:
                                    score: 0.3884400725
                                    occluded: 1.4000000000000001e-9
                                    smile: 0.6115599275
                                    opened: 0.121500025
                                  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
                                  liveness:
                                    prediction: "spoof"
                                    estimations:
                                      quality: 0.7361597418785095
                                      score: 0.600364089012146
                                  deepfake:
                                    prediction: "fake"
                                    score: 0.600364089012146
                                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.0
                                  basic_attributes:
                                    apparent_age: 25
                                    apparent_gender: 0
                                  upper_body:
                                    headwear:
                                      state: 0
                                      apparent_color: undefined
                                    sleeve:
                                      length: short
                                    upper_clothing:
                                      colors: [ white, black ]
                                  lower_body:
                                    lower_garment:
                                      type: trousers
                                      colors: [ white, black ]
                                    shoes:
                                      apparent_color: black
                                  accessories:
                                    backpack:
                                      state: 0
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]

                face_with_aggregation:
                  value:
                    images_estimations:
                      - filename: image1
                        estimations:
                          - face:
                              detection:
                                rect:
                                  x: 71
                                  y: 45
                                  width: 134
                                  height: 178
                                attributes:
                                  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:
                                    predominant_mask: occluded
                                    estimations:
                                      medical_mask: 0.020060448
                                      missing: 0.3235525191
                                      occluded: 0.6563870311
                                    face_occlusion:
                                      predominant_occlusion: correct
                                      estimations:
                                        full: 0.019
                                        clear: 0.02
                                        correct: 0.6108324766
                                        partially: 0.310
                                        mouth: 0.0209
                                        chin: 0.019097
                                  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
                                  liveness:
                                    prediction: "spoof"
                                    estimations:
                                      quality: 0.7361597418785095
                                      score: 0.600364089012146
                                  deepfake:
                                    prediction: "fake"
                                    score: 0.600364089012146
                                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: null
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]
                      - filename: image2
                        estimations:
                          - face:
                              detection:
                                rect:
                                  x: 62
                                  y: 51
                                  width: 137
                                  height: 181
                                attributes:
                                  emotions:
                                    predominant_emotion: neutral
                                    estimations:
                                      anger: 8.682e-7
                                      disgust: 1.0670000000000001e-7
                                      fear: 4.386e-7
                                      happiness: 0.05658952
                                      sadness: 4.951e-7
                                      surprise: 0.1500029291
                                      neutral: 0.443405652
                                  mask:
                                    predominant_mask: occluded
                                    estimations:
                                      medical_mask: 0.650060448
                                      missing: 0.0235525191
                                      occluded: 0.2563870311
                                    face_occlusion:
                                      predominant_occlusion: correct
                                      estimations:
                                        full: 0.019
                                        clear: 0.02
                                        correct: 0.6108324766
                                        partially: 0.310
                                        mouth: 0.0209
                                        chin: 0.019097
                                  basic_attributes:
                                    ethnicities:
                                      predominant_ethnicity: caucasian
                                      estimations:
                                        asian: 0.0000025556
                                        indian: 3.417e-7
                                        caucasian: 0.0999949932000001
                                        african_american: 0.5500017718000000000001
                                    age: 30
                                    gender: 0
                                  descriptor:
                                    sdk_descriptor: ZHAAADgAAAB0k4SAf...IB6gHyAgH19fQ==
                                    score: 0.6854047418000001
                                  liveness:
                                    prediction: "spoof"
                                    estimations:
                                      quality: 0.8361597418785095
                                      score: 0.700364089012146
                                  deepfake:
                                    prediction: "fake"
                                    score: 0.600364089012146
                                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: null
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]
                    aggregate_estimations:
                      face:
                        attributes:
                          emotions:
                            predominant_emotion: neutral
                            estimations:
                              anger: 8.682e-7
                              disgust: 1.0670000000000001e-7
                              fear: 4.386e-7
                              happiness: 0.05658952
                              sadness: 4.951e-7
                              surprise: 0.0500029291
                              neutral: 0.643405652
                          mask:
                            predominant_mask: occluded
                            estimations:
                              medical_mask: 0.050060448
                              missing: 0.0235525191
                              occluded: 0.6563870311
                            face_occlusion:
                              predominant_occlusion: correct
                              estimations:
                                full: 0.019
                                clear: 0.02
                                correct: 0.6108324766
                                partially: 0.310
                                mouth: 0.0209
                                chin: 0.019097
                          basic_attributes:
                            ethnicities:
                              predominant_ethnicity: caucasian
                              estimations:
                                asian: 0.0000025556
                                indian: 3.417e-7
                                caucasian: 0.8999949932000001
                                african_american: 0.15000177180000000001
                            age: 30
                            gender: 0
                          liveness:
                            prediction: "spoof"
                            estimations:
                              quality: 0.7061597418785095
                              score: 0.610364089012146
                          deepfake:
                            prediction: "fake"
                            score: 0.600364089012146
                          descriptor:
                            sdk_descriptor: ZHAAAGUAAACBeX1w==
                            score: 0.7
                      body: null

                body_example:
                  value:
                    images_estimations:
                      - filename: raw image
                        estimations:
                          - face: null
                            body:
                              detection:
                                rect:
                                  x: 32
                                  y: 4
                                  width: 224
                                  height: 255
                                warp: /9j/4AAQSkZJRgABAQAAAQABAA...CX6kdapTi1qS00f/Z
                                attributes:
                                  descriptor:
                                    sdk_descriptor: ZHAAAGUAAAC....AfX9
                                    score: 1.0
                                  basic_attributes:
                                    apparent_age: 25
                                    apparent_gender: 0
                                  upper_body:
                                    headwear:
                                      state: 0
                                      apparent_color: undefined
                                    sleeve:
                                      length: short
                                    upper_clothing:
                                      colors: [ white, black ]
                                  lower_body:
                                    lower_garment:
                                      type: trousers
                                      colors: [ white, black ]
                                    shoes:
                                      apparent_color: black
                                  accessories:
                                    backpack:
                                      state: 0
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]

                body_with_aggregation:
                  value:
                    images_estimations:
                      - filename: image1.jpg
                        estimations:
                          - face: null
                            body:
                              detection:
                                rect:
                                  x: 118
                                  y: -17
                                  width: 410
                                  height: 627
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]
                      - filename: image2.jpg
                        estimations:
                          - face: null
                            body:
                              detection:
                                rect:
                                  x: 7
                                  y: -60
                                  width: 1682
                                  height: 2523
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]
                    aggregate_estimations:
                      face: null
                      body:
                        attributes:
                          descriptor:
                            sdk_descriptor: ZHAAAGUAAACBeX1w==
                            score: 0
                          basic_attributes:
                            apparent_age: 25
                            apparent_gender: 0
                          upper_body:
                            headwear:
                              state: 0
                              apparent_color: undefined
                            sleeve:
                              length: short
                            upper_clothing:
                              colors: [ white, black ]
                          lower_body:
                            lower_garment:
                              type: trousers
                              colors: [ white, black ]
                            shoes:
                              apparent_color: black
                          accessories:
                            backpack:
                              state: 0

                with_error:
                  value:
                    images_estimations:
                      - error:
                          error_code: 100033
                          desc: Unsupported image type
                          detail: Unsupported type
                          link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-100033"
                        filename: bad_image.jpg
                      - filename: image_warp.jpg
                        estimations:
                          - face:
                              detection:
                                rect:
                                  x: 71
                                  y: 45
                                  width: 134
                                  height: 178
                            body: null
                        image_estimations:
                          people:
                            count: 1
                            coordinates: [[125, 125]]
            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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_content_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11028"
                bad_content_type_multipart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11029"
                failed_load_image:
                  value:
                    error_code: 11027
                    desc: External request failed
                    detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Forbidden.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                license_problem:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                liveness:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                deepfake:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Deepfake feature disabled"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - sdk
      summary: sdk options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/videosdk:
    post:
      tags: [videosdk]
      summary: video analytics (beta)
      description: Request for video analysis based on the specified analytics parameters eg facial estimations.
      operationId: videosdk
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - in: header
          name: Content-Type
          schema:
            type: string
            enum:
            - application/json
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            body = {
                "video": {"url": "https://lunatestttttt.s3.eu-central-1.amazonaws.com/video_test.avi"},
                "analytics": [
                    {
                        "name": "people_count",
                        "parameters": {}
                    }
                ]
            }
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "application/json",
            }
            
            url = f"{baseUri}/videosdk"
            response = requests.post(url, headers=headers, json=body)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
  
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.remote_sdk.http_objs import VideoSDKAnalytics, VideoSDKInput, VideoSDKProperties
  
            luna3client = LunaHttpClient(
            login="luna@visionlabs.ru",
            password="luna",
            origin="http://127.0.0.1:5000",
            )
  
            videoSDKInput = VideoSDKInput(
            video=VideoSDKProperties("https://lunatestttttt.s3.eu-central-1.amazonaws.com/video_test.avi"),
            analytics=[VideoSDKAnalytics(name="people_count", parameters={"people_count_threshold": 3})],
            )
            response = luna3client.videosdk(videoSDKInput)
  
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/videosdk' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "video": {"url": "https://lunatestttttt.s3.eu-central-1.amazonaws.com/video_test.avi"},
                "analytics": [
                    {
                        "name": "people_count",
                        "parameters": {}
                    }
                ]
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/video_analytics_params'
        required: true

      responses:
        200:
          description: Estimated.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/video_analytics_results'
            application/msgpack:
              schema:
                $ref: '#/components/schemas/video_analytics_results_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_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
        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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11045"
                fsdk_liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness v.2 feature disabled"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                liveness_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                licence_expired:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - videosdk
      summary: videosdk options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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.

        Notes for incoming data:
          - face or body *bounding boxes* passed with face or body warped image will be ignored.

      operationId: checkISO
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      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/raw_or_face_image_type'
        - $ref: '#/components/parameters/iso_multiface_policy'
        - $ref: '#/components/parameters/extract_exif'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()

            params = {
                "multiface_policy": 0,
                "image_type": 1,
            }

            url = f"{baseUri}/iso"
            response = requests.post(url, headers=headers, params=params, data=image)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
                api=6,
            )

            response = luna3client.checkISO(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                inputData=BinaryImage("face_warp.jpg"),
                multifacePolicy=0,
                imageType=1,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/iso?multiface_policy=0&image_type=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: image/jpeg' \
            --data-binary '@face_warp.jpg'
      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/check_iso_response'
              examples:
                check_iso_succeeded:
                  value:
                    {
                      "images": [
                        {
                          "filename": "raw image",
                          "status": 1,
                          "error": {
                            "error_code": 0,
                            "desc": "Success",
                            "detail": "Success",
                            "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                          },
                          "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
                                      },
                                      {
                                        "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": background_lightness,
                                        "object_value": 0.5780888795852661,
                                        "threshold_value": { "min": 0.2, "max": 1.0 },
                                        "result": 1
                                      },
                                      {
                                        "name": background_uniformity,
                                        "object_value": 0.8874394297599792,
                                        "threshold_value": { "min": 0.5, "max": 1.0 },
                                        "result": 1
                                      },
                                      {
                                        "name": shoulders_position,
                                        "object_value": 'parallel',
                                        "threshold_value": [ 'parallel' ],
                                        "result": 1
                                      }
                                    ]
                                  },
                                  "rect": {
                                    "x": 108,
                                    "y": 58,
                                    "width": 113,
                                    "height": 165
                                  }
                                }
                              }
                            }
                          ]
                        }
                      ]
                    }
                bad_image_size:
                  value:
                    {
                      "images": [
                        {
                          "filename": "face image",
                          "status": 0,
                          "error": {
                            "error_code": 11043,
                            "desc": "Bad/incomplete input data",
                            "detail": "Bad image size for face warped image",
                            "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11043"
                          },
                          "estimations": []
                        }
                      ]
                    }

            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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_content_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11028"
                bad_content_type_multepart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11029"
                failed_load_image:
                  value:
                    error_code: 11027
                    desc: External request failed
                    detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
        401:
          $ref: '#/components/responses/authorization_error'
        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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11045"
                licence_expired:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                license_iso_disabled:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: ISO license feature is disabled."
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
        404:
          $ref: '#/components/responses/image_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - iso
      summary: iso options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/detector:
    post:
      tags: [ samples ]
      summary: detect faces
      description: |
        Detect faces in input images, create samples, and estimate face properties.

        Detections can be filtered out by head pose. The pose is defined by yaw, pitch and roll angles. 
        To specify a filtering threshold per-angle, use corresponding query parameters 
        (`yaw_threshold`, `pitch_threshold` and `roll_threshold`). By default no filtering is applied.

        > The estimated face properties are not saved to the Faces database. They are only returned in the response.

        > Samples are saved in the storage without the ability to disable saving. You can disable the saving of 
        > samples only using the handlers.

        Notes for incoming data:
          - face or body *bounding boxes* passed with face or body warped image will be ignored.

      operationId: detectFaces
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/multiple_images_content_type'
        - $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'
        - $ref: '#/components/parameters/estimate_face_quality'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import json

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            with open("image.jpg", "rb") as image_file:
                files = {
                    "image": (
                        "image.jpg",
                        image_file.read(),
                        "image/jpeg",
                    ),
                    "face_bounding_boxes": (
                        "face_bounding_boxes",
                        json.dumps(
                            [
                                {
                                    "filename": "image.jpg",
                                    "face_bounding_boxes": [
                                        {
                                            "x": 0,
                                            "y": 0,
                                            "width": 250,
                                            "height": 250,
                                        },
                                    ],
                                },
                            ]
                        ),
                        "application/json",
                    ),
                }

            params = {
                "multiface_policy": 1,
                "estimate_quality": 1,
                "estimate_eyes_attributes": 1,
                "pitch_threshold": 180,
            }

            url = "http://127.0.0.1:5000/6/detector"
            response = requests.post(
                url, files=files, headers=headers, params=params
            )

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage
            from luna3.common.http_objs import BoundingBox

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.detectFaces(
                inputData=BinaryImage(
                    "image.jpg", faceBoundingBoxList=[BoundingBox(250, 250, 0, 0)]
                ),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                multifacePolicy=1,
                estimateQuality=1,
                estimateEyesAttributes=1,
                pitchThreshold=180,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request POST 'http://127.0.0.1:5000/6/detector?multiface_policy=1&estimate_quality=1&estimate_eyes_attributes=1&pitch_threshold=180' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: multipart/form-data' \
            --form 'image=@image.jpg' \
            --form 'face_bounding_boxes=[{"filename": "image.jpg", "face_bounding_boxes": [{"x": 0, "y": 0, "width": 2500, "height": 2500}]}]; type=application/json'
      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: base64
          image/x-png-base64:
            schema:
              type: string
              format: base64
          image/x-bmp-base64:
            schema:
              type: string
              format: base64
          image/x-tiff-base64:
            schema:
              type: string
              format: base64
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: base64
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_image_schema'
          application/json:
            schema:
              $ref: '#/components/schemas/detect_json_request_body'
        required: true
      responses:
        201:
          description: Created.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/detected_images'
              examples:
                several_estimations:
                  summary: head pose, mouth attributes, gaze, quality
                  value:
                    {
                      "images": [
                        {
                          "filename": "face_1.jpg",
                          "error": {
                            "error_code": 0,
                            "desc": "Success",
                            "detail": "Success",
                            "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                          },
                          "status": 1,
                          "detections": {
                            "samples": [
                              {
                                "face": {
                                  "detection": {
                                    "rect": {
                                      "x": 594,
                                      "y": 181,
                                      "width": 678,
                                      "height": 963
                                    },
                                    "landmarks5": [
                                      [
                                          169,
                                          169
                                      ],
                                      [
                                          454,
                                          454
                                      ],
                                      [
                                          325,
                                          325
                                      ],
                                      [
                                          227,
                                          227
                                      ],
                                      [
                                          466,
                                          466
                                      ]
                                    ],
                                    "quality": {
                                      "blurriness": 0.9740276337,
                                      "dark": 0.9211971164,
                                      "illumination": 0.8751303554,
                                      "specularity": 0.9605293274,
                                      "light": 0.8855836391
                                    },
                                    "attributes": {
                                      "mouth_attributes": {
                                        "opened": 0.021500025,
                                        "occluded": 0.9998804331,
                                        "smile": 0.0,
                                        "score": 1.0
                                      },
                                      "head_pose": {
                                        "pitch": 6.7033782005,
                                        "roll": -6.140639782,
                                        "yaw": 3.3139002323
                                      },
                                      "gaze": {
                                        "yaw": 0.281270504,
                                        "pitch": -1.0716878176
                                      }
                                    }
                                  },
                                  "url": "/6/samples/faces/f9285806-371e-4c61-be00-0424029856e3",
                                  "sample_id": "50cccef8-3ea8-42a0-8e6d-68b90ee148f6"
                                }
                              }
                            ],
                            "filtered_detections": {
                              "face_detections": [ ]
                            }
                          }
                        }
                      ]
                    }

                all_fields_specified:
                  summary: all fields specified without warped image
                  value:
                          {
                              "images": [
                                  {
                                      "filename": "raw image.jpg",
                                      "error": {
                                          "error_code": 0,
                                          "desc": "Success",
                                          "detail": "Success",
                                          "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                                      },
                                      "status": 1,
                                      "detections": {
                                          "samples": [],
                                          "filtered_detections": {
                                              "face_detections": [
                                                  {
                                                      "filter_reasons": [
                                                          {
                                                              "filter_name": "yaw_threshold",
                                                              "object_value": -41.57133102416992,
                                                              "threshold_value": 20
                                                          }
                                                      ],
                                                      "detection": {
                                                          "rect": {
                                                              "x": 922,
                                                              "y": 272,
                                                              "width": 139,
                                                              "height": 137
                                                          },
                                                          "landmarks68": [
                                                              [1,99],[8,111],[18,121],[32,131],[50,139],[73,141],[96,138],[118,130],[134,119],[138,108],[137,98],[134,89],[127,78],[120,67],[110,56],[99,48],[87,42],[26,70],[31,61],[38,54],[49,48],[60,46],[71,38],[73,35],[74,32],[77,30],[80,31],[75,47],[84,50],[93,52],[103,55],[94,74],[100,71],[105,68],[108,66],[109,64],[44,71],[49,64],[55,61],[63,62],[58,66],[52,69],[80,48],[82,43],[86,42],[88,43],[88,46],[85,48],[96,98],[100,87],[107,77],[111,75],[114,72],[115,76],[115,82],[120,86],[122,89],[120,92],[116,94],[107,96],[98,96],[110,82],[112,79],[115,77],[112,82],[117,85],[115,87],[112,90]
                                                          ],
                                                          "landmarks5": [
                                                              [54,66],[85,46],[105,68],[96,98],[115,82]
                                                          ],
                                                          "quality": {
                                                              "blurriness": 0.598679780960083,
                                                              "dark": 0.7336541414260864,
                                                              "illumination": 0.7211454510688782,
                                                              "specularity": 0.8014858961105347,
                                                              "light": 0.6639201641082764
                                                          },
                                                          "attributes": {
                                                              "mouth_attributes": {
                                                                  "opened": 0.5613629817962646,
                                                                  "occluded": 0.005182280670851469,
                                                                  "smile": 0.0005507163587026298,
                                                                  "score": 1.0
                                                              },
                                                              "eyes_attributes": {
                                                                  "right_eye": {
                                                                      "state": "occluded",
                                                                      "iris_landmarks": [
                                                                          [143,109],[143,108],[143,107],[143,105],[144,105],[144,104],[145,103],[146,103],[146,103],[147,103],[148,104],[149,104],[149,105],[150,106],[150,107],[151,108],[151,109],[151,111],[151,112],[150,113],[150,114],[149,114],[148,115],[148,115],[147,115],[146,115],[145,115],[145,114],[144,113],[143,112],[143,111],[143,110]
                                                                      ]
                                                                  },
                                                                  "left_eye": {
                                                                      "state": "closed",
                                                                      "iris_landmarks": [
                                                                          [83,104],[83,102],[83,101],[84,100],[84,99],[85,99],[86,98],[87,98],[88,99],[89,99],[91,99],[92,100],[93,101],[94,102],[95,104],[95,105],[95,106],[96,107],[95,108],[95,109],[94,110],[94,111],[93,111],[92,111],[90,111],[89,111],[88,110],[87,109],[86,108],[85,107],[84,106],[83,105]
                                                                      ]
                                                                  }
                                                              },
                                                              "emotions": {
                                                                  "predominant_emotion": "neutral",
                                                                  "estimations": {
                                                                      "anger": 4.375354762942152e-7,
                                                                      "disgust": 0.000460780574940145,
                                                                      "fear": 3.990096502093365e-6,
                                                                      "happiness": 0.00014543473662342876,
                                                                      "sadness": 0.020742423832416534,
                                                                      "surprise": 2.453069214425341e-7,
                                                                      "neutral": 0.9786466956138611
                                                                  }
                                                              },
                                                              "head_pose": {
                                                                  "pitch": -19.329853057861328,
                                                                  "roll": -36.331607818603516,
                                                                  "yaw": -41.57133102416992
                                                              },
                                                              "gaze": {
                                                                  "yaw": -28.90760612487793,
                                                                  "pitch": 13.863595962524414
                                                              },
                                                              "mask": {
                                                                  "predominant_mask": "missing",
                                                                  "estimations": {
                                                                      "medical_mask": 0.13169622421264648,
                                                                      "missing": 0.8348804116249084,
                                                                      "occluded": 0.033423300832509995
                                                                  },
                                                                  "face_occlusion":
                                                                    {
                                                                      "predominant_occlusion": "correct",
                                                                      "estimations":
                                                                        {
                                                                          "full": 0.019,
                                                                          "clear": 0.02,
                                                                          "correct": 0.6108324766,
                                                                          "partially": 0.310,
                                                                          "mouth": 0.0209,
                                                                          "chin": 0.019097,
                                                                        }
                                                                    }
                                                              }
                                                          }
                                                      }
                                                  }
                                              ]
                                          }
                                      },
                                      "exif": {
                                          "flash": "16",
                                          "software": "Adobe Photoshop CC 2017 (Windows)",
                                          "artist": "VisionLabs",
                                          "make": "NIKON CORPORATION",
                                          "model": "NIKON D810"
                                      }
                                  }
                              ]
                          }
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_content_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11028"
                bad_content_type_multipart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11029"
                failed_load_image:
                  value:
                    error_code: 11027
                    desc: External request failed
                    detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - samples
      summary: detector options
      description: Get options for the resource.
      operationId: geteDetectorOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/samples/{samples_type}:
    parameters:
    - $ref: '#/components/parameters/samples_type'
    post:
      tags: [samples]
      summary: save face/body sample
      description: |
        Save face or body sample to the storage.
      operationId: saveSample
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      - in: header
        name: Content-Type

        schema:
          type: string
          enum: [image/jpeg, image/png, image/bmp, image/tiff, image/x-portable-pixmap]
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/faces"
            response = requests.post(url, data=image, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("body_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/bodies"
            response = requests.post(url, data=image, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.saveFaceSample(
                image=BinaryImage("face_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            sampleId = response.json["sample_id"]

            print(response.statusCode)
            print(response.json)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.saveBodySample(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --request POST 'http://127.0.0.1:5000/6/samples/faces' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: image/jpeg' \
            --data-binary '@face_warp.jpg'
      requestBody:
        content:
          image/jpeg:
            schema:
              oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
          image/png:
            schema:
              oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
          image/bmp:
            schema:
              oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
          image/tiff:
            schema:
              oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
          image/x-portable-pixmap:
            schema:
              oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
        required: true
      responses:
        201:
          description: Created.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                pattern: ^/6/samples/(bodies|faces)/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
              required: true
              description: Body sample location.
              example: /1/samples/bodies/b5d6fd45-fcca-453d-ac05-3e594054b813
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BodySample'
              example:
                sample_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /6/samples/bodies/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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_size:
                  value:
                    error_code: 11030
                    desc: Bad/incomplete input data
                    detail: Image size is not equal to 250x250
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11030"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
      - samples

      summary: face/body samples options
      description: Get options for the resource.
      operationId: getSamplesOptions

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/samples/{samples_type}/{sample_id}:
    parameters:
    - $ref: '#/components/parameters/samples_type'
    - in: path
      name: sample_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
    get:
      tags:
      - samples
      summary: get face/body sample
      description: Get face or body sample by ID.
      operationId: getSample
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/faces"
            sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

            # get sample
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/samples/faces/{sampleId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("body_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/bodies"
            sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

            # get sample
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/samples/bodies/{sampleId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.saveFaceSample(
                image=BinaryImage("face_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["sample_id"]

            response = luna3client.getFaceSample(
                sampleId=sampleId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            bodySampleId = luna3client.saveBodySample(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["sample_id"]

            response = luna3client.getBodySample(
                sampleId=bodySampleId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request HEAD 'http://127.0.0.1:5000/6/samples/faces/bedd11ea-3806-4b93-acc6-faeb1d339889' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/image_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            image/jpeg:
              schema:
                oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
            image/png:
              schema:
                oneOf:
                - $ref: '#/components/schemas/face_sample'
                - $ref: '#/components/schemas/body_sample'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      tags:
      - samples
      summary: check if face/body sample exists
      description: Check if face or body sample with `sample_id` exists.
      operationId: checkSample
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/faces"
            sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

            # get sample
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/samples/faces/{sampleId}"
            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("body_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/bodies"
            bodySampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

            # get sample
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/samples/bodies/{bodySampleId}"
            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.saveFaceSample(
                image=BinaryImage("face_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["sample_id"]

            response = luna3client.checkFaceSample(
                sampleId=sampleId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            bodySampleId = luna3client.saveBodySample(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["sample_id"]

            response = luna3client.checkBodySample(
                sampleId=bodySampleId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --head 'http://127.0.0.1:5000/6/samples/faces/bedd11ea-3806-4b93-acc6-faeb1d339889' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              schema:
                type: string
                enum:
                - image/jpeg
                - image/png
              description: Content type is `image/jpeg` or `image/png`.
              required: true
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'

    delete:
      tags:
      - samples
      summary: remove face/body sample
      description: Remove face or body sample by ID.
      operationId: deleteSample
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/faces"
            sampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

            # get sample
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/samples/faces/{sampleId}"
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("body_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/samples/bodies"
            bodySampleId = requests.post(url, data=image, headers=headers).json()["sample_id"]

            # get sample
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/samples/bodies/{bodySampleId}"
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.saveFaceSample(
                image=BinaryImage("face_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["sample_id"]

            response = luna3client.deleteFaceSample(
                sampleId=sampleId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            bodySampleId = luna3client.saveBodySample(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["sample_id"]

            response = luna3client.deleteBodySample(
                sampleId=bodySampleId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --request DELETE 'http://127.0.0.1:5000/6/samples/faces/bedd11ea-3806-4b93-acc6-faeb1d339889' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        204:
          description: Resource was deleted successfully.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
      - samples

      summary: face/body sample options
      description: Get options for the resource.
      operationId: getSampleOptions

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /5/samples/{sample_id}:
    parameters:
    - in: path
      name: sample_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
    get:
      deprecated: true
      tags:
      - samples
      summary: get sample | previous version
      description: Get sample by ID using previous API version.
      operationId: getSamplePrevious
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/image_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            image/jpeg:
              schema:
                $ref: '#/components/schemas/face_sample'
            image/png:
              schema:
                $ref: '#/components/schemas/face_sample'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      deprecated: true
      tags:
      - samples
      summary: check if sample exists | previous version
      description: Check if face or body sample with `sample_id` exists using previous API version.
      operationId: checkSamplePrevious
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              schema:
                type: string
                enum:
                - image/jpeg
                - image/png
                - application/json
              description: Content type is `image/jpeg` or `image/png` or `application/json` if sample not found.
              required: true
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'
    delete:
      deprecated: true
      tags:
      - samples
      summary: remove sample | previous version
      description: Remove sample by ID using previous API version.
      operationId: deleteSamplePrevious
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      responses:
        204:
          description: Resource was deleted successfully.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      deprecated: true
      tags:
      - samples

      summary: sample options | previous version
      description: Get options for the resource using previous API version.
      operationId: getSamplePreviousOptions

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/samples/{sample_id}:
    parameters:
    - in: path
      name: sample_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
    get:
      deprecated: true
      tags:
      - samples
      summary: get sample | legacy
      description: Get a face sample by ID.
      operationId: getSampleLegacy
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/image_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            image/jpeg:
              schema:
                $ref: '#/components/schemas/face_sample'
            image/png:
              schema:
                $ref: '#/components/schemas/face_sample'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      deprecated: true
      tags:
      - samples
      summary: check if face sample exists | legacy
      description: Check if face sample with `sample_id` exists.
      operationId: checkSampleLegacy
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              schema:
                type: string
                enum:
                - image/jpeg
                - image/png
                - application/json
              description: Content type is `image/jpeg` or `image/png` or `application/json` if sample not found.
              required: true
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'
    delete:
      deprecated: true
      tags:
      - samples
      summary: remove face sample | legacy
      description: Remove sample by ID.
      operationId: deleteSampleLegacy
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      responses:
        204:
          description: Resource was deleted successfully.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      deprecated: true
      tags:
      - samples

      summary: face sample options  | legacy
      description: Get options for the resource.
      operationId: getSampleOptionsLegacy

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        404:
          description: Sample not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/images:
    post:
      tags:
        - images
      summary: create images
      operationId: createImages
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Save images with unique ID.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/content_images'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/meta_headers'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            
            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()
            
            url = f"{baseUri}/images"
            response = requests.post(url, data=image, headers=headers)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            response = luna3client.saveImage(
                image=BinaryImage("face_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            imageId = response.json["image_id"]
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --request POST 'http://127.0.0.1:5000/6/images' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: image/jpeg' \
            --data-binary '@face_warp.jpg'
      requestBody:
        content:
          image/jpeg:
            schema:
              $ref: '#/components/schemas/binary_image'
          image/png:
            schema:
              $ref: '#/components/schemas/binary_image'
          image/bmp:
            schema:
              $ref: '#/components/schemas/binary_image'
          image/tiff:
            schema:
              $ref: '#/components/schemas/binary_image'
          image/x-portable-pixmap:
            schema:
              $ref: '#/components/schemas/binary_image'
      responses:
        201:
          description: Created.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                $ref: '#/components/schemas/image_location'
              required: true
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/images_creation_response'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_parameter:
                  value:
                    error_code: 12012
                    detail: 'Bad/incomplete input data'
                    desc: "Bad query parameters 'thumbnails'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_content_type:
                  value:
                    error_code: 12017
                    detail: "Bad/incomplete input data"
                    desc: "Bad content type"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                failed_convert_to_jpg:
                  value:
                    error_code: 18002
                    detail: 'Bad/incomplete input data'
                    desc: "Failed convert bytes to jpg"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-18002"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - images
      summary: images options
      description: Get options for the resource.
      operationId: getImagesOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/images/{image_id}:
    parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/image_id'
    head:
      tags:
        - images
      summary: check if image exists
      operationId: checkImage
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Check if image with `image_id` exists.
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/with_meta'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            
            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()
            
            url = f"{baseUri}/images"
            imageId = requests.post(url, data=image, headers=headers).json()["image_id"]
            
            # get image
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/images/{imageId}"
            response = requests.head(url, headers=headers)
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            imageId = luna3client.saveImage(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["image_id"]
            
            response = luna3client.checkImage(
                imageId=imageId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request HEAD 'http://127.0.0.1:5000/6/images/bedd11ea-3806-4b93-acc6-faeb1d33988a' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/image_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            '* (X-Luna-Meta-<user_defined_key>)':
              $ref: '#/components/headers/meta_headers'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Image not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'
    delete:
      tags:
        - images
      summary: delete image
      operationId: deleteImage
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Delete an image.
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            
            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()
            
            url = f"{baseUri}/images"
            imageId = requests.post(url, data=image, headers=headers).json()["image_id"]
            
            # get image
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/images/{imageId}"
            response = requests.delete(url, headers=headers)
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            imageId = luna3client.saveImage(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["image_id"]
            
            response = luna3client.deleteImage(
                imageId=imageId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/images/bedd11ea-3806-4b93-acc6-faeb1d33988a' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        204:
          description: No content.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          $ref: '#/components/responses/image_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    get:
      tags:
        - images
      summary: get image
      operationId: getImage
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Receive an origin image.
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/with_meta'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            
            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()
            
            url = f"{baseUri}/images"
            imageId = requests.post(url, data=image, headers=headers).json()["image_id"]
            
            # get image
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/images/{imageId}"
            response = requests.get(url, headers=headers)
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000"
            )
            
            imageId = luna3client.saveImage(
                image=BinaryImage("body_warp.jpg"),
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["image_id"]
            
            response = luna3client.getImage(
                imageId=imageId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl -LI --location --request GET 'http://127.0.0.1:5000/6/images/bedd11ea-3806-4b93-acc6-faeb1d33988a' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/image_content_type'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            '* (X-Luna-Meta-<user_defined_key>)':
              $ref: '#/components/headers/meta_headers'
          content:
            image/jpeg:
              schema:
                $ref: '#/components/schemas/binary_image'
            image/png:
              schema:
                $ref: '#/components/schemas/binary_image'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          $ref: '#/components/responses/image_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - images
      summary: image options
      description: Get options for the resource.
      operationId: getImageOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/objects:
    parameters:
      - $ref: '#/components/parameters/luna_account_id'
    post:
      tags:
        - objects
      summary: create objects
      operationId: createObjects
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Save object with unique ID.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/content_objects'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "text/plain",
            }

            url = f"{baseUri}/objects"
            response = requests.post(url, data="example", headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.saveObject(
                "example",
                contentType="text/plain",
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )
            objectId = response.json["object_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --request POST 'http://127.0.0.1:5000/6/objects' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: text/plain' \
            --data-binary 'example'
      requestBody:
        content:
          '*/*':
            schema:
              type: string
              format: binary
              description: Some user defined bytes. The service saves the bytes `as is`.
      responses:
        201:
          description: Created.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                $ref: '#/components/schemas/object_location'
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/objects_creation_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:
                not_contains_data:
                  value:
                    error_code: 12030
                    detail: "Bad/incomplete body"
                    desc: "Request does not contain data"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12030"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        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"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12024"
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - objects
      summary: objects options
      description: Get options for the resource.
      operationId: getObjectsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/objects/{object_id}:
    parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/object_id'

    get:
      tags:
        - objects
      summary: get object
      operationId: getObject
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Receiving objects.
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create objects
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "text/plain",
            }

            url = f"{baseUri}/objects"
            objectId = requests.post(url, data="example", headers=headers).json()["object_id"]

            # get object
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/objects/{objectId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.text)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            objectId = luna3client.saveObject(
                "example",
                contentType="text/plain",
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["object_id"]

            response = luna3client.getObject(
                objectId=objectId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.text)
        - lang: bash
          source: |
            curl -LI --location --request GET 'http://127.0.0.1:5000/6/objects/bedd11ea-3806-4b93-acc6-faeb1d33988b' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/object_content_type'
            Content-Disposition:
              $ref: '#/components/headers/object_content_disposition'
          content:
            '*/*' :
              schema:
                type: string
                format: binary
                description: User uploaded bytes.
        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
                    detail: 'Bad/incomplete input data'
                    desc: "Bad content type"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          $ref: '#/components/responses/object_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    head:
      tags:
        - objects
      summary: check if object exists
      operationId: checkObject
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description:  Check if object with `object_id` exists.
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create object
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "text/plain",
            }

            url = f"{baseUri}/objects"
            objectId = requests.post(url, data="example", headers=headers).json()["object_id"]

            # check objects
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/objects/{objectId}"
            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            objectId = luna3client.saveObject(
                "example",
                contentType="text/plain",
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["object_id"]

            response = luna3client.checkObject(
                objectId=objectId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request HEAD 'http://127.0.0.1:5000/6/objects/bedd11ea-3806-4b93-acc6-faeb1d33988b' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/object_content_type'
            Content-Disposition:
              $ref: '#/components/headers/object_content_disposition'
          description: No content.
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Object not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'

    delete:
      tags:
        - objects
      summary: delete object
      operationId: deleteObject
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      description: Delete object
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create object
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "text/plain",
            }

            url = f"{baseUri}/objects"
            objectId = requests.post(url, data="example", headers=headers).json()["object_id"]

            # get object
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/objects/{objectId}"
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            objectId = luna3client.saveObject(
                "example",
                contentType="text/plain",
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["object_id"]

            response = luna3client.deleteObject(
                objectId=objectId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/objects/bedd11ea-3806-4b93-acc6-faeb1d33988b' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          description: No content.
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          $ref: '#/components/responses/object_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - objects
      summary: object options
      description: Get options for the resource.
      operationId: getObjectOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/extractor:
    post:
      tags:
        - attributes
      summary: extract attributes
      description: |
        Extract descriptors and basic attributes from samples.

        All the extracted attributes are temporary.

        Temporary attributes have a TTL (time to live) and will be removed from the database after the specified period.

      operationId: extractAttributes
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_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'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("face_warp.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # extract attributes
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "score_threshold": 0.7,
                "extract_descriptor": 1,
                "extract_basic_attributes": 1,
                "ttl": 600,
            }
            payload = [
                sampleId,
            ]
            url = f"{baseUri}/extractor"
            response = requests.post(
                url, json=payload, headers=headers, params=params
            )

            attributeId = response.json()[0]["attribute_id"]

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            response = luna3client.extractAttrFromSample(
                sampleIds=[
                    sampleId,
                ],
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                scoreThreshold=0.7,
                extractDescriptor=1,
                extractBasicAttributes=1,
                ttl=600,
                raiseError=True,
            )

            attributeId = response.json[0]["attribute_id"]
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/extractor?score_threshold=0.7&extract_descriptor=1&extract_basic_attributes=1&ttl=600' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '[
                "bedd11ea-3806-4b93-acc6-faeb1d339889"
            ]'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sample_ids'
        required: true
      responses:
        201:
          description: Created.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Extracted_Attributes'
              examples:
               all_fields_specified:
                  summary: all fields specified without aggregating attributes
                  value:
                    [
                        {
                            "samples": [
                                "f9f03668-27e3-4e23-9b55-681e5927905e"
                            ],
                            "attribute_id": "3917e7a6-2f62-4151-905a-a5d786fcaf0b",
                            "url": "/6/attributes/3917e7a6-2f62-4151-905a-a5d786fcaf0b",
                            "external_url": "http://127.0.0.1:5000/6/attributes/3917e7a6-2f62-4151-905a-a5d786fcaf0b",
                            "basic_attributes": {
                                "ethnicities": {
                                    "predominant_ethnicity": "caucasian",
                                    "estimations": {
                                        "asian": 9.823425273225439e-8,
                                        "indian": 1.5799123502802104e-5,
                                        "caucasian": 0.9999819993972778,
                                        "african_american": 2.058620793832233e-6
                                    }
                                },
                                "age": 19,
                                "gender": 0
                            },
                            "score": 0.9949966669082642
                        },
                        {
                            "samples": [
                                "4967ccb7-b521-43b5-93ba-a0d266631bb2"
                            ],
                            "attribute_id": "87737317-9c75-46b3-a0cc-6cd2b258e027",
                            "url": "/6/attributes/87737317-9c75-46b3-a0cc-6cd2b258e027",
                            "external_url": "http://127.0.0.1:5000/6/attributes/87737317-9c75-46b3-a0cc-6cd2b258e027",
                            "basic_attributes": {
                                "ethnicities": {
                                    "predominant_ethnicity": "caucasian",
                                    "estimations": {
                                        "asian": 2.390194367762888e-6,
                                        "indian": 1.3357706052374851e-8,
                                        "caucasian": 0.9999673366546631,
                                        "african_american": 3.0240154956118204e-5
                                    }
                                },
                                "age": 23,
                                "gender": 0
                            },
                            "score": 0.998572826385498
                        },
                        {
                            "samples": [],
                            "attribute_id": null,
                            "url": null,
                            "external_url": null,
                            "filter": {
                                "is_filtered": true,
                                "filter_reasons": [
                                    {
                                        "filter_name": "score_threshold",
                                        "object_value": 0.8610286712646484,
                                        "threshold_value": 0.9
                                    }
                                ]
                            }
                        }
                    ]

               several_estimations:
                  summary: all fields specified
                  value:
                    [
                        {
                            "samples": [
                                "f9f03668-27e3-4e23-9b55-681e5927905e",
                                "4967ccb7-b521-43b5-93ba-a0d266631bb2",
                                "dd98cf9c-ddf3-4962-a3c5-e8bd540a4fc7"
                            ],
                            "attribute_id": "551cc85d-67a2-4b7a-9747-ea4575d25faf",
                            "url": "/6/attributes/551cc85d-67a2-4b7a-9747-ea4575d25faf",
                            "external_url": "http://127.0.0.1:5000/6/attributes/551cc85d-67a2-4b7a-9747-ea4575d25faf",
                            "basic_attributes": {
                                "ethnicities": {
                                    "predominant_ethnicity": "caucasian",
                                    "estimations": {
                                        "asian": 8.294828717225755e-7,
                                        "indian": 5.270829205983318e-6,
                                        "caucasian": 0.6666497588157654,
                                        "african_american": 0.33334410190582275
                                    }
                                },
                                "age": 26,
                                "gender": 0
                            },
                            "score": 0.9515326619148254
                        }
                    ]
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'extract_basic_attributes'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                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'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/image_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - attributes
      summary: extractor options
      description: Get options for the resource.
      operationId: geteEtractorOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/attributes:
    post:
      tags:
        - attributes
      summary: create temporary attribute
      description: |
        New temporary attributes creation.

        **Note.** Use this request when you need to add basic attributes or descriptors from
        external storage. Otherwise, use the extract attributes request.

        All the extracted attributes are temporary.

        Temporary attributes have a TTL (time to live) and will be removed from the database
        after the specified period.

      operationId: createAttributes
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - in: header
          name: Content-Type
          schema:
            type: string
            enum:
              - application/json
              - multipart/form-data
          description: Content type is `application/json` or `multipart/form-data`.

        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/ttl'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create temporary attribute

            with open("descriptor56", 'rb') as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {
                        "descriptor": descriptor,
                        "version": 56
                    },
                ]
            }
            url = f"{baseUri}/attributes"
            response = requests.post(
                url, json=payload, headers=headers, params=params
            )

            attributeId = response.json()["attribute_id"]

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage
            from luna3.common.http_objs import RawDescriptor

            with open("descriptor56", 'rb') as file:
                descriptor = file.read()

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            response = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                descriptorSamples=[
                    sampleId,
                ],
                ttl=600,
                descriptors=[RawDescriptor(descriptor=descriptor, version=56),],
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            attributeId = response.json["attribute_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/attributes?ttl=600' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3
                },
                "face_descriptors": [
                {
                "descriptor": "eJCHgXqOcYiPfXp4cnWCgnN4d2+Bgod4bXJ1en94g295e4iLgnxydHZwj4F3eIxygJB3iIqKh4BxeHhzh36KiImIgY2JdnyEfXh4hYyChoGGeGx5iXh4e4V5gISLjX2LhIOBf3B/i42KenmBhG93eX6Lg314e4SAfIuKd4uGfoWCgoN+iYB+gYGHiYWJfX+DhIt7g4Z6iXx8fntzg3l8gHSEfIZ4hX6JfoeFfoaFh36Ae4B5g4ODgJCHj3WCdISEgoh+inx+eYKFe4SFhXSEgoWIgn57eIF/eYF8hHuFg3p6dYKDf4F8gICCioOFeYaJgYR+gH1+g4V/g313g3mFfYJ9fHt2e4N/g3+Ae4OAgX97fYaHf3yAfHeCf4OAf4CAf4R7hn+EeX6EeoKGgn96gIOFg4CBg4OEe32EgX+BeoB/gH6Af4B/gX59fX2Ag399gH57g39/e4aAgH6BgX2DfX+Bf32Bg3qAfX9/hH15gHp+fn+ChIKBgH+BgoB+gX1/fn+Bg4CCf4CBfn58gH6CgX+BgIGCf31+gX1+f3+AfoCAe4OCfoF/foOBeoGDgYGAfIGBf4GBf4N7f3+Cgn6Af35/gYF/gH2BgIR/fn9/gIJ/f3uBfoN/gX6BgICAf39+gH6BgH5/gYOBfoGBgX98g4KBgoCAgH+Ae4B8f4B9fn0=",
                "version": 56
                }],
                "face_descriptor_samples": ["bedd11ea-3806-4b93-acc6-faeb1d339889"],
                "basic_attributes_samples": ["bedd11ea-3806-4b93-acc6-faeb1d339889"]
            }'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/created_attribute'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/created_attribute_xpk'
            encoding:
              xpk:
                contentType: application/x-vl-xpk
              meta:
                contentType: application/json
        required: true
      responses:
        201:
          description: Attribute is created.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Location:
              schema:
                type: string
                format: url
                example: /6/attributes/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: Location of new attribute.
              required: true
          content:
            application/json:
              schema:
                type: object
                properties:
                  attribute_id:
                    $ref: '#/components/schemas/attribute_id'
                  url:
                    type: string
                    format: uri-reference
                    description: Attribute location url.
                  external_url:
                    $ref: '#/components/schemas/external_url'
                required:
                  - url
                  - attribute_id
                  - external_url
              example:
                attribute_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /6/attributes/b5d6fd45-fcca-453d-ac05-3e594054b813
                external_url: http://127.0.0.1:5000/6/attributes/b5d6fd45-fcca-453d-ac05-3e594054b813
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: ''face_descriptors[0]'',  message:
                      ''face_descriptors[0] must be valid exactly by one of oneOf definition'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                broken_descriptor:
                  value:
                    error_code: 12034
                    desc: Bad/incomplete input data
                    detail: 'Descriptor has incorrect length ''23'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12034"
                broken_xpk:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: 'Failed to parse xpk file'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12035"
                unknown_descriptor_version:
                  value:
                    error_code: 12036
                    desc: Bad/incomplete input data
                    detail: 'Descriptor version 37 is not registered in the system'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12036"
                xpk_without_descriptor:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: 'XPK file does not contain descriptor'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
                not_valid_sdk_descriptor:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: 'SDK descriptor is not valid'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12038"
                unknown_multipart_name:
                  value:
                    error_code: 12039
                    desc: Bad/incomplete input data
                    detail: 'Unknown multipart name ''account'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12039"
                duplicate_multipart_name:
                  value:
                    error_code: 12040
                    desc: Bad/incomplete input data
                    detail: 'Duplicate multipart name ''meta'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12040"
                bad_multipart_content_type:
                  value:
                    error_code: 12041
                    desc: Bad/incomplete input data
                    detail: 'Multipart with name ''meta'' has bad Content-Type'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12041"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
        - attributes
      summary: get temporary attributes
      description: |
        Get temporary attributes by IDs.

        For each attribute:

        - If the attribute TTL has not expired, the attribute data is returned.

        - If the TTL has expired, no data is returned for this attribute in the response.

      operationId: getAttributes
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/required_attribute_ids'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/temporary_attributes_targets'
        - $ref: '#/components/parameters/descriptor_version'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create attribute
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
            }

            url = f"{baseUri}/attributes"
            attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

            # get attributes
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            params = {
                "attribute_ids": [
                    attributeId,
                ],
                "targets": "basic_attributes,basic_attributes_samples,account_id",
            }

            url = f"{baseUri}/attributes"
            response = requests.get(
                url, headers=headers, params=params
            )

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                raiseError=True,
            ).json["attribute_id"]

            response = luna3client.getAttributes(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                attributeIds=[
                    attributeId,
                ],
                targets=[
                    "basic_attributes",
                    "basic_attributes_samples",
                    "account_id",
                ],
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/attributes?attribute_ids=02f0267b-d023-46b6-af10-cccc0e93e595' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  attributes:
                    type: array
                    items:
                      $ref: '#/components/schemas/output_attribute'
                required: [attributes]
              examples:
                default (full):
                  value:
                    attributes:
                      - create_time: "2021-08-11T14:57:18.416928+03:00"
                        attribute_id: 7fdf9225-3c06-4c21-b774-8bea99bcce20
                        account_id: 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                        face_descriptor_samples:
                          - 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                          - 2f1cbb34-12e5-486c-8f7f-57273053c32d
                        basic_attributes_samples: [ 00000000-0000-4000-8000-000000000000 ]
                        face_descriptor: 2xQ2gprbMUePw1s9gw9fvA==
                        basic_attributes:
                          age: 33
                          gender: 1
                          ethnicity: 3
                only basic attributes:
                  value:
                    attributes:
                      - basic_attributes:
                          age: 33
                          gender: 1
                          ethnicity: 3
                full with null:
                  value:
                    attributes:
                      - create_time: "2021-08-11T14:57:18.416928+03:00"
                        attribute_id: 7fdf9225-3c06-4c21-b774-8bea99bcce20
                        account_id: 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                        face_descriptor_samples: []
                        basic_attributes_samples: [ 00000000-0000-4000-8000-000000000000 ]
                        face_descriptor: null
                        basic_attributes:
                          age: 33
                          gender: 1
                          ethnicity: 3
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'descriptor_version'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_target:
                  value:
                    error_code: 22016
                    desc: Bad/incomplete input data
                    detail: '''not_a_target'' is not valid target to get faces. Valid target should be one of
                            [''attribute_id'', ''account_id'', ''basic_attributes'', ''face_descriptor_samples'',
                            ''face_descriptor'', ''basic_attributes_samples'', ''create_time''].'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22016"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - attributes
      summary: temporary attributes options
      description: Get options for the resource.
      operationId: getAttributesOptions

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/attributes/{attribute_id}:
    parameters:
      - in: path
        name: attribute_id
        schema:
          $ref: '#/components/schemas/attribute_id'
        required: true
        description: ID of the temporary attribute.

    get:
      tags:
        - attributes
      summary: get temporary attribute
      description: |
        Get temporary attribute by ID.

        If the attribute TTL has not expired, the attribute data is returned.

        Otherwise, the "Attributes not found" error is returned.

      operationId: getAttribute
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/descriptor_version'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/temporary_attributes_targets'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create attribute
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 1,
                    "ethnicity": 3,
                },
            }

            url = f"{baseUri}/attributes"
            attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

            # get attributes
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/attributes/{attributeId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                raiseError=True,
            ).json["attribute_id"]

            response = luna3client.getBasicAttributesById(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                attributeId=attributeId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/attributes/02f0267b-d023-46b6-af10-cccc0e93e595' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/output_attribute'
              examples:
                default (full):
                  value:
                    create_time: "2021-08-11T14:57:18.416928+03:00"
                    attribute_id: 7fdf9225-3c06-4c21-b774-8bea99bcce20
                    account_id: 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                    face_descriptor_samples:
                      - 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                      - 2f1cbb34-12e5-486c-8f7f-57273053c32d
                    basic_attributes_samples: [ 00000000-0000-4000-8000-000000000000 ]
                    face_descriptor: 2xQ2gprbMUePw1s9gw9fvA==
                    basic_attributes:
                      age: 33
                      gender: 1
                      ethnicity: 3
                only basic attributes:
                  value:
                    basic_attributes:
                      age: 33
                      gender: 1
                      ethnicity: 3
                full with null:
                  value:
                    create_time: "2021-08-11T14:57:18.416928+03:00"
                    attribute_id: 7fdf9225-3c06-4c21-b774-8bea99bcce20
                    account_id: 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                    face_descriptor_samples: []
                    basic_attributes_samples: [ 00000000-0000-4000-8000-000000000000 ]
                    face_descriptor: null
                    basic_attributes:
                      age: 33
                      gender: 1
                      ethnicity: 3
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'temporary_attributes_targets'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          description: Attributes not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 22011
                desc: Object not found
                detail: Attributes with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22011"

        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      tags:
        - attributes
      summary: check temporary attribute
      description: |
        Check if temporary attribute with `attribute_id` exists.
      operationId: checkAttribute
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/descriptor_version'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/temporary_attributes_targets'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create attribute
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 1,
                    "ethnicity": 3,
                },
            }

            url = f"{baseUri}/attributes"
            attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

            # get attributes
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/attributes/{attributeId}"
            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                raiseError=True,
            ).json["attribute_id"]

            response = luna3client.checkBasicAttributesById(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                attributeId=attributeId,
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --head 'http://127.0.0.1:5000/6/attributes/02f0267b-d023-46b6-af10-cccc0e93e595' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Attributes not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'
    delete:
      tags:
        - attributes
      summary: delete attribute
      description: Delete the attribute by its ID.
      operationId: deleteAttribute
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            # create attribute
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 1,
                    "ethnicity": 3,
                },
            }

            url = "http://127.0.0.1:5000/6/attributes"
            attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

            # get attributes
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"http://127.0.0.1:5000/6/attributes/{attributeId}"
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                raiseError=True,
            ).json["attribute_id"]

            response = luna3client.deleteAttributeById(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                attributeId=attributeId,
                raiseError=True,
            )

            print(response.statusCode)

        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/attributes/02f0267b-d023-46b6-af10-cccc0e93e595' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: Resource was deleted successfully.
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - attributes
      summary: temporary attributes attribute options
      description: Get options for the resource.
      operationId: getAttributesAttributeOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/attributes/{attribute_id}/samples:
    parameters:
      - in: path
        name: attribute_id
        schema:
          $ref: '#/components/schemas/attribute_id'
        required: true
        description: ID of the temporary attribute.

    get:
      tags:
        - attributes
      summary: get temporary attribute samples
      description: |
        Get all the temporary attribute samples by the attribute ID.

        If the attribute TTL has not expired, the attribute data is returned.

        Otherwise, the "Attributes not found" error is returned.
      operationId: getAttributeSamples
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # exreact attr
            # create attribute
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 1,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
            }

            url = f"{baseUri}/attributes"
            attributeId = requests.post(url, json=payload, headers=headers).json()["attribute_id"]

            # get attributes by id
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/attributes/{attributeId}/samples"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                ttl=600,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["attribute_id"]

            response = luna3client.getAttributeSamples(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                attributeId=attributeId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/attributes/02f0267b-d023-46b6-af10-cccc0e93e595/samples' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attribute_samples'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          description: Attributes not found.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 22011
                desc: Object not found
                detail: Attributes with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22011"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - attributes
      summary: temporary attribute samples options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/faces:
    post:
      tags:
        - faces
      summary: create face
      description: |
        Create a face.

        The face can be attached to one or several lists.

        You can create new face using a temporary attribute ID or using external attribute data (descriptors and/or basic attributes).

        You can also create the face without any attributes specified.

      operationId: createFace
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/json_or_msgpack_content'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            # create list
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = "http://127.0.0.1:5000/6/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create handler
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            params = {"city": "New York", "district": "Midtown"}
            payload = {
                "description": "non_dynamic_handler",
                "policies": {},
                "handler_type": 0,
            }
            url = f"{baseUri}/handlers"
            handlerId = requests.post(url, json=payload, headers=headers).json()[
                "handler_id"
            ]

            # create event
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
                "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
            }
            url = f"{baseUri}/handlers/{handlerId}/events"
            eventId = requests.post(
                url,
                headers=headers,
                data=image,
                params=params,
            ).json()["events"][0]["event_id"]

            # create face
            payload = {
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": attributeId},
                "user_data": "some_string",
                "lists": [
                    listId,
                ],
                "avatar": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg",
                "event_id": eventId,
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            response = requests.post(
                url,
                headers=headers,
                json=payload,
            )

            faceId = response.json()["face_id"]

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import Policies
            from luna3.common.http_objs import BinaryImage
            from luna3.common.http_objs import RawDescriptor
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # create sample
            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as f:
                descriptor = f.read()
            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                descriptors=[
                    RawDescriptor(descriptor=descriptor, version=56),
                ],
                descriptorSamples=[
                    sampleId,
                ],
                raiseError=True,
            ).json["attribute_id"]

            # create list
            listId = luna3client.createList(raiseError=True).json["list_id"]

            # create handler
            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="test_handler",
                policies=Policies(),
                raiseError=True,
            ).json["handler_id"]

            # create event
            eventId = luna3client.emitEvents(
                handlerId=handlerId,
                inputData=[
                    BinaryImage("image.jpg"),
                ],
                raiseError=True,
            ).json["events"][0]["event_id"]

            # We are waiting for the event to be created
            time.sleep(5)

            # create face
            response = luna3client.createFace(
                externalId="2xQ2gprbMUePw1s9gw9fvA==",
                attributeId=attributeId,
                userData="nice looking face",
                lists=[
                    listId,
                ],
                avatar="https://upload.wikimedia.org/wikipedia/commons/thumb/2"
                "/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg",
                eventId=eventId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
            )

            faceId = response.json["face_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/faces' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": "02f0267b-d023-46b6-af10-cccc0e93e595"},
                "user_data": "some_string",
                "lists": ["8d5f7c8a-6312-457a-9d82-a4b25418124e"],
                "avatar": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg",
                "event_id": "fdd015be-f4b5-47dc-bfea-385e507b7b62"
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/New_Face'
            examples:
              attribute_by_attribute_id:
                value:
                  external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                  attribute:
                    attribute_id: "b4a40d88-8998-4e19-8cc8-be894a1ceb5e"
                  user_data: "some_string"
                  lists: [ '234fc28c-a767-42fc-a0c2-e01ad00b5c59', 'c2a09aff-0116-41cf-a7c7-91631d40d0c2' ]
                  avatar: "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg"
                  event_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
                summary: create face using attribute ID
              attribute_with_descriptors_and_basic_attributes:
                value:
                  external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                  attribute:
                    basic_attributes:
                      age: 18
                      gender: 0
                      ethnicity: 4
                    basic_attributes_samples:
                      - "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c"
                      - "2f1cbb34-12e5-486c-8f7f-57273053c32d"
                    face_descriptors:
                      - descriptor: "2xQ2gprbMUePw1s9gw9fvA=="
                        version: 46
                      - descriptor: "1xWqdsdwew32fsdsdw1s9gw9fvA=="
                        version: 56
                    face_descriptor_samples:
                      - "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
                      - "e909cfbe-29d3-44ed-a949-6cb700b89eba"
                  user_data: "some_string"
                  lists: [ '234fc28c-a767-42fc-a0c2-e01ad00b5c59', 'c2a09aff-0116-41cf-a7c7-91631d40d0c2' ]
                  avatar: "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg"
                  event_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
                summary: create face using basic attributes and descriptors
              attribute_with_descriptors:
                value:
                  external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                  attribute:
                    face_descriptors:
                      - descriptor: "2xQ2gprbMUePw1s9gw9fvA=="
                        version: 46
                      - descriptor: "1xWqdsdwew32fsdsdw1s9gw9fvA=="
                        version: 56
                    face_descriptor_samples:
                      - "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b"
                      - "e909cfbe-29d3-44ed-a949-6cb700b89eba"
                  user_data: "some_string"
                  lists: [ '234fc28c-a767-42fc-a0c2-e01ad00b5c59', 'c2a09aff-0116-41cf-a7c7-91631d40d0c2' ]
                  avatar: "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg"
                  event_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
                summary: create face using descriptors
              attribute_with_basic_attributes:
                value:
                  external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                  attribute:
                    basic_attributes:
                      age: 18
                      gender: 0
                      ethnicity: 4
                    basic_attributes_samples:
                      - "0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c"
                      - "2f1cbb34-12e5-486c-8f7f-57273053c32d"
                  user_data: "some_string"
                  lists: [ '234fc28c-a767-42fc-a0c2-e01ad00b5c59', 'c2a09aff-0116-41cf-a7c7-91631d40d0c2' ]
                  avatar: "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg"
                  event_id: 557d54ec-29ad-4f3c-93b4-c9092ef12515
                summary: create face using basic attributes
          application/msgpack:
            schema:
              $ref: '#/components/schemas/New_Face_binary'
        required: true
      responses:
        201:
          description: Face is created.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  face_id:
                    allOf:
                      - $ref: '#/components/schemas/uuid'
                      - description: ID of the created face.
                  url:
                    type: string
                    description: Relative URL of the created face.
                    format: uri-reference
                  external_url:
                    $ref: '#/components/schemas/external_url'
                required:
                  - url
                  - face_id
                  - external_url
              example:
                face_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /6/faces/b5d6fd45-fcca-453d-ac05-3e594054b813
                external_url: http://127.0.0.1:5000/6/faces/b5d6fd45-fcca-453d-ac05-3e594054b813
          links:
            get_face_by_id:
              operationId: getFace
              parameters:
                face_id: '$response.body#/face_id'
              description: >
                The 'face_id' returned in the response can be used as the `face_id` parameter in `GET /faces/{face_id}`.

        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                bad_target:
                  value:
                    error_code: 22016
                    desc: Bad/incomplete input data
                    detail: '''not_a_target'' is not valid target to get faces. Valid target should be one of
                      [''face_id'', ''account_id'', ''event_id'', ''user_data'', ''create_time'', ''external_id'', ''avatar'', ''lists''].'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22016"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Forbidden.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                auth_required:
                  value:
                    error_code: 12010
                    desc: Bad/incomplete input data
                    detail: "This resource needs 'Authorization' authorization headers"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12010"
                license_problem:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                license_limit_exceeded:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License limit exceeded. Please contact VisionLabs for license upgrade or delete redundant faces."
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    get:
      tags:
        - faces
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/create_time__lt'
        - $ref: '#/components/parameters/create_time__gte'
        - $ref: '#/components/parameters/event_id'
        - $ref: '#/components/parameters/face_id__lt_sorting'
        - $ref: '#/components/parameters/face_id__gte_sorting'
        - $ref: '#/components/parameters/face_ids'
        - $ref: '#/components/parameters/external_ids'
        - $ref: '#/components/parameters/user_data'
        - $ref: '#/components/parameters/list_id'
        - $ref: '#/components/parameters/get_face_target'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            params = {
                "create_time__gte": "2018-08-11T09:11:41.674Z",
                "user_data": "face",
                "targets": "face_id,account_id,event_id,user_data,create_time",
            }

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getFaces(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                userData="face",
                timeGte="2018-08-11T09:11:41.674Z",
                targets=[
                    "face_id",
                    "account_id",
                    "event_id",
                    "user_data",
                    "create_time",
                ],
                page=1,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/faces?create_time__gte=2018-08-11T09:11:41.674Z&user_data=face&targets=face_id,account_id,event_id,user_data,create_time' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      summary: get faces
      description: Get faces according to filters.
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      operationId: getFaces
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_faces'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
        - faces
      summary: delete faces
      description: | 
          Delete several faces by IDs.

          When the faces are removed, attributes (descriptors and basic attributes) linked to the faces are deleted.
          Samples linked to the faces are not deleted. 
          
          If you need to delete faces according to some filters and with all samples, 
          you can use the ["garbage collection task"](operation/createGCTask) with `target = faces` and `remove_samples` flag enabled.
      operationId: deleteFaces
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/ignore'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
            ).json()["face_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "face_ids": [
                    faceId,
                ]
            }
            url = f"{baseUri}/faces"
            response = requests.delete(
                url,
                headers=headers,
                json=payload,
            )

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            response = luna3client.deleteFaces(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceIds=[
                    faceId,
                ],
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/faces' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
              "face_ids": [
                "95113f42-849d-4240-8493-00f125ae29e5"
              ]
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/faces_to_be_deleted'
      responses:
        204:
          description: Delete success.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not
                      allowed (''faces'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/face_not_found_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - faces
      summary: faces options
      description: Get options for the resource.
      operationId: getFacesOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/faces/count:
    get:
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/create_time__lt'
        - $ref: '#/components/parameters/create_time__gte'
        - $ref: '#/components/parameters/face_ids'
        - $ref: '#/components/parameters/face_id__lt'
        - $ref: '#/components/parameters/face_id__gte'
        - $ref: '#/components/parameters/event_id'
        - $ref: '#/components/parameters/external_ids'
        - $ref: '#/components/parameters/user_data'
        - $ref: '#/components/parameters/list_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/count"
            params = {
                "create_time__gte": "2018-08-11T09:11:41.674Z",
                "user_data": "face",
            }
            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.countFaces(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                userData="face",
                timeGte="2018-08-11T09:11:41.674Z",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/faces/count?create_time__gte=2018-08-11T09:11:41.674Z&user_data=face' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      tags:
        - faces
      summary: get face count
      description: Count faces according to the filters.
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      operationId: getFacesCount
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/faces_count'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - faces
      summary: faces count options
      description: Get options for the resource.
      operationId: getFacesCountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/faces/attributes/count:
    get:
      tags:
        - faces
      summary: get count of faces with attributes
      description: |
        Count faces with attributes.

      operationId: getFaceAttributeCount
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/attributes/count"

            response = requests.get(
                url,
                headers=headers,
            )

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getFacesAttributesCount(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/faces/attributes/count' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/faces_count'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - faces
      summary: get count of faces with attributes options
      description: Get options for the resource.
      operationId: getFaceAttributesCountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/faces/{face_id}:
    parameters:
      - in: path
        name: face_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: ID of the face (face_id received in the "create face" request).
    get:
      tags:
        - faces
      summary: get face
      description: Get face by ID.
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      operationId: getFace
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/get_face_target'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/faces/{faceId}"
            response = requests.get(
                url,
                headers=headers,
            )

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            response = luna3client.getFace(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/output_face'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'descriptor_version'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_target:
                  value:
                    error_code: 22016
                    desc: Bad/incomplete input data
                    detail: '''not_a_target'' is not valid target to get faces. Valid target should be one of
                      [''face_id'', ''attribute_id'', ''account_id'', ''event_id'', ''user_data'', ''create_time'', ''external_id'', ''avatar'', ''lists'']'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22016"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Face not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 22002
                desc: Object not found
                detail: Face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    patch:
      tags:
        - faces
      summary: patch face
      description: |
        Update face fields: `user_data`, `external_id`, `event_id`, `avatar`.
      operationId: patchFace
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
            ).json()["face_id"]

            # patch face
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "user_data": "nice looking face",
            }
            url = f"{baseUri}/faces/{faceId}"
            response = requests.patch(
                url,
                headers=headers,
                json=payload,
            )

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # create face
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            # patch face
            response = luna3client.patchFace(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId,
                userData="nice looking face",
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PATCH 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "user_data": "nice looking face"
            }'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Update_Face'
        required: true
      responses:
        204:
          description: Updated.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/face_not_found_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    delete:
      tags:
        - faces
      summary: remove face
      description: |
        Remove face by ID.

          When the face is removed, attributes (descriptors and basic attributes) linked to the face are deleted.
          Samples linked to the face are not deleted. If there are a small number of samples for face, then you can use the resources 
          ["get face attribute samples"](#operation/getFaceAttributesOptions) > 
          ["remove face/body sample"](operation/deleteSample) > "delete face" (this resource). If you need to delete faces according to some filters and with all samples, 
          you can use the ["garbage collection task"](operation/createGCTask) with `target = faces` and `remove_samples` flag enabled.
      operationId: deleteFace
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
            ).json()["face_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/{faceId}"
            response = requests.delete(
                url,
                headers=headers,
            )

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            response = luna3client.deleteFace(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        204:
          description: The resource was deleted successfully.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/face_not_found_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      tags:
        - faces
      summary: check if face exists
      description: Check if face with `face_id` exists.
      operationId: checkFace
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/get_face_target'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
            ).json()["face_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/{faceId}"
            response = requests.head(
                url,
                headers=headers,
            )

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            response = luna3client.checkFace(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --head 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Face not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'

    options:
      tags:
        - faces
      summary: face options
      description: Get options for the resource.
      operationId: getFaceOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/faces/{face_id}/attributes:
    parameters:
      - in: path
        name: face_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: ID of the face (`face_id` received in the "create face" request).

    put:
      tags:
        - face attributes
      summary: put face attribute
      description: |
        Put face attribute.

        This request changes all the attribute data corresponding to the specified face.

        The attribute can be specified by temporary attribute ID or using external attribute data (descriptors and/or basic attributes).

      operationId: putFaceAttributes
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'

      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create face
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
            ).json()["face_id"]

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()
            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            # put face attribute
            payload = {"attribute_id": attributeId}
            url = f"{baseUri}/faces/{faceId}/attributes"
            response = requests.put(
                url,
                headers=headers,
                json=payload,
            )

            print(response.status_code)

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import RawDescriptor
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            with open("descriptor56", "rb") as f:
                descriptor = f.read()

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                descriptorSamples=[
                    sampleId,
                ],
                ttl=600,
                descriptors=[
                    RawDescriptor(descriptor=descriptor, version=56),
                ],
                raiseError=True,
            ).json["attribute_id"]

            response = luna3client.putFaceAttributes(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                attributeId=attributeId,
                faceId=faceId,
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PUT 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5/attributes' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "attribute_id": "02f0267b-d023-46b6-af10-cccc0e93e595"
            }
            '

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/face_attribute'
            examples:
              put_face_attribute_by_attribute_id:
                value:
                  attribute_id: 'b668c4a5-2191-476e-a261-3b4f9ce2e25e'
                summary: put face attribute specified by attribute ID
              put_face_attribute_by_descriptors_and_basic_attributes:
                value:
                  basic_attributes:
                    age: 18
                    gender: 0
                    ethnicity: 4
                  basic_attributes_samples:
                    - 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                    - 2f1cbb34-12e5-486c-8f7f-57273053c32d
                  face_descriptors:
                    - descriptor: 2xQ2gprbMUePw1s9gw9fvA==
                      version: 46
                    - descriptor: 1xWqdsdwew32fsdsdw1s9gw9fvA==
                      version: 56
                  face_descriptor_samples:
                    - ee4c42b6-23ae-410e-a2aa-a4220e64ba4b
                    - e909cfbe-29d3-44ed-a949-6cb700b89eba
                summary: put face attribute specified by descriptors and basic attributes
              put_face_attribute_by_descriptorss:
                value:
                  face_descriptors:
                    - descriptor: 2xQ2gprbMUePw1s9gw9fvA==
                      version: 46
                    - descriptor: 1xWqdsdwew32fsdsdw1s9gw9fvA==
                      version: 56
                  face_descriptor_samples:
                    - ee4c42b6-23ae-410e-a2aa-a4220e64ba4b
                    - e909cfbe-29d3-44ed-a949-6cb700b89eba
                summary: put face attribute specified by descriptors
              put_face_attribute_by_basic_attributes:
                value:
                  basic_attributes:
                    age: 18
                    gender: 0
                    ethnicity: 4
                  basic_attributes_samples:
                    - 0d1cc36e-d719-4f54-8abe-4e5e0cb1f43c
                    - 2f1cbb34-12e5-486c-8f7f-57273053c32d
                summary: put face attribute specified by basic attributes
        required: true
      responses:
        204:
          description: Put success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message:
                          ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                attribute_not_found:
                  value:
                    error_code: 22011
                    desc: Object not found
                    detail: Attribute with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22011"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Forbidden.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                auth_required:
                  value:
                    error_code: 12010
                    desc: Bad/incomplete input data
                    detail: "This resource needs 'Authorization' authorization headers"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12010"
                license_problem:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                license_limit_exceeded:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License limit exceeded. Please contact VisionLabs for license upgrade or delete redundant faces."
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
        404:
          $ref: '#/components/responses/face_not_found_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
        - face attributes
      summary: get face attribute
      description: Get face attribute by ID.
      operationId: getFaceAttributes
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/face_attributes_targets'
        - $ref: '#/components/parameters/descriptor_version'

      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            # create face
            payload = {
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": attributeId},
            }
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
                json=payload,
            ).json()["face_id"]

            # get face attribute by ID
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/{faceId}/attributes"
            response = requests.get(
                url,
                headers=headers,
            )

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import RawDescriptor
            from luna3.common.http_objs import BinaryImage

            with open("descriptor56", "rb") as f:
                descriptor = f.read()

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                descriptors=[
                    RawDescriptor(descriptor=descriptor, version=56),
                ],
                descriptorSamples=[
                    sampleId,
                ],
                raiseError=True,
            ).json["attribute_id"]

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            response = luna3client.getFace(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5/attributes' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/output_face_attribute'
              example:
                attributes:
                  create_time: "2018-08-11T09:11:41.674Z"
                  basic_attributes:
                    age: 29
                    gender: 1
                    ethnicity: 2
                  face_descriptor:
                    descriptor: "byte string"
                    descriptor_version: 56
                  basic_attributes_samples: [ "ee4c42b6-23ae-410e-a2aa-a4220e64ba4b", "e909cfbe-29d3-44ed-a949-6cb700b89eba" ]
                  face_descriptor_samples: [ "951de511-7ef5-4ed9-9c06-dcfbb399712e", "3c3a83c2-c21e-4855-91b5-34e6b63fb12d" ]

        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'version'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_target:
                  value:
                    error_code: 22016
                    desc: Bad/incomplete input data
                    detail: '''not_a_target'' is not valid target to get faces. Valid target should be one of
                                        [''basic_attributes'', ''face_descriptor_samples'', ''face_descriptor'',
                                        ''basic_attributes_samples'', ''create_time''].'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22016"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/face_not_found_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
        - face attributes
      summary: delete face attribute
      description: Remove face attribute by ID.
      operationId: deleteFaceAttributes
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()
            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            payload = {
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": attributeId},
            }

            # create face
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
                json=payload,
            ).json()["face_id"]

            # get face attribute by ID
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/{faceId}/attributes"
            response = requests.delete(
                url,
                headers=headers,
            )

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import RawDescriptor
            from luna3.common.http_objs import BinaryImage

            with open("descriptor56", "rb") as f:
                descriptor = f.read()

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                descriptors=[
                    RawDescriptor(descriptor=descriptor, version=56),
                ],
                descriptorSamples=[
                    sampleId,
                ],
                raiseError=True,
            ).json["attribute_id"]

            faceId = luna3client.createFace(
                attributeId=attributeId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["face_id"]

            response = luna3client.deleteFaceAttributes(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId,
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5/attributes' \
             --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
             --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        204:
          description: Delete success.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Face not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 22002
                desc: Object not found
                detail: Face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22022"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - face attributes
      summary: faces attributes options
      description: Get options for the resource.
      operationId: getFaceAttributesOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/faces/{face_id}/attributes/samples:
    parameters:
      - in: path
        name: face_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: ID of the face (`face_id` received in the "create face" request).

    get:
      tags:
        - face attributes
      summary: get face attribute samples
      description: Get face attribute samples by face ID.
      operationId: getFaceAttributeSamples
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            # create face
            payload = {
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": attributeId},
            }
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
                json=payload,
            ).json()["face_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces/{faceId}/attributes/samples"
            response = requests.get(
                url,
                headers=headers,
            )

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import RawDescriptor
            from luna3.common.http_objs import BinaryImage

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            with open("descriptor56", "rb") as f:
                descriptor = f.read()
            attributeId = luna3client.createAttribute(
                basicAttributes={"age": 29, "gender": 0, "ethnicity": 3},
                basicAttributesSamples=[
                    sampleId,
                ],
                descriptors=[
                    RawDescriptor(descriptor=descriptor, version=56),
                ],
                descriptorSamples=[
                    sampleId,
                ],
                raiseError=True,
            ).json["attribute_id"]

            faceId = luna3client.createFace(
                attributeId=attributeId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            ).json["face_id"]

            response = luna3client.getFaceSamples(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                faceId=faceId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/faces/95113f42-849d-4240-8493-00f125ae29e5/attributes/samples' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attribute_samples'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/face_not_found_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - face attributes
      summary: faces attributes samples options
      description: Get options for the resource.
      operationId: getFaceAttributesSamplesOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lists:
    post:
      tags:
        - lists
      summary: create list
      description: Create a list.
      operationId: createList
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            payload = {"user_data": "list of good persons"}
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"

            response = requests.post(url, json=payload, headers=headers)

            listId = response.json()["list_id"]
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.createList(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
                userData="list of good persons",
            )

            listId = response.json["list_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/lists' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
              "user_data": "list of good persons"
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/New_List'
      responses:
        201:
          description: Created.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  list_id:
                    allOf:
                      - description: List ID.
                      - $ref: '#/components/schemas/uuid'
                  url:
                    type: string
                    format: uri-reference
                    description: List location.
                  external_url:
                    $ref: '#/components/schemas/external_url'
                required:
                  - url
                  - list_id
                  - external_url
              example:
                list_id: "b5d6fd45-fcca-453d-ac05-3e594054b813"
                url: "/6/lists/b5d6fd45-fcca-453d-ac05-3e594054b813"
                external_url: "http://127.0.0.1:5000/6/lists/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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userData'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    get:
      tags:
        - lists
      summary: get lists
      description: Get lists according to the filters.
      operationId: getLists
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/list_create_time__lt'
        - $ref: '#/components/parameters/list_create_time__gte'
        - $ref: '#/components/parameters/list_last_update_time__lt'
        - $ref: '#/components/parameters/list_last_update_time__gte'
        - $ref: '#/components/parameters/user_data'
        - $ref: '#/components/parameters/user_data__eq'
        - $ref: '#/components/parameters/list_ids'
        - $ref: '#/components/parameters/list_id__lt'
        - $ref: '#/components/parameters/list_id__gte'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            params = {
                "user_data": "good",
                "page_size": 20,
                "create_time__gte": "2020-10-10T09:11:41.674Z",
            }
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            response = requests.get(url, params=params, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getLists(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
                userData="good",
                pageSize=20,
                createTimeGte="2020-10-10T09:11:41.674Z",
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/lists?user_data=good&page_size=20&create_time__gte=2020-10-10T09:11:41.674Z' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/get_lists'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'user_data'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
        - lists
      summary: delete lists
      description: Delete several lists.
      operationId: deleteLists
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/with_faces'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # delete list
            payload = {"list_ids": [listId]}
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {"with_faces": 1}
            url = f"{baseUri}/lists"

            response = requests.delete(
                url, json=payload, params=params, headers=headers
            )

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            response = luna3client.deleteLists(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
                withFaces=1,
                listIds=[
                    listId,
                ],
            )

            print(response.statusCode)

        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/lists?with_faces=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "list_ids": ["8d5f7c8a-6312-457a-9d82-a4b25418124e"]
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/deleted_lists'
      responses:
        202:
          description: Successful list deletion ("with_faces" is enabled), removing faces in progress (time depends on number of faces, server load, etc.).
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        204:
          description: Successful lists deletion ("with_faces" is disabled).
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''faces'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        413:
          $ref: '#/components/responses/payload_to_large'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - lists
      summary: lists options
      description: Get options for the resource.
      operationId: getListsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lists/count:
    get:
      tags:
        - lists
      summary: get list count
      description: Count lists according to the filters.
      operationId: getListsCount
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/user_data'
        - $ref: '#/components/parameters/user_data__eq'
        - $ref: '#/components/parameters/list_create_time__lt'
        - $ref: '#/components/parameters/list_create_time__gte'
        - $ref: '#/components/parameters/list_last_update_time__lt'
        - $ref: '#/components/parameters/list_last_update_time__gte'
        - $ref: '#/components/parameters/list_ids'
        - $ref: '#/components/parameters/list_id__lt'
        - $ref: '#/components/parameters/list_id__gte'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # get list according to the filters
            params = {
                "user_data": "good",
                "create_time__gte": "2020-10-10T09:11:41.674Z",
                "last_update_time__gte": "2020-10-10T09:11:41.674Z",
            }
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists/count"
            response = requests.get(url, params=params, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getListsCount(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
                userData="good persons",
                createTimeGte="2020-10-10T09:11:41.674Z",
                lastUpdateTimeGte="2020-10-10T09:11:41.674Z",
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/lists?user_data=good&create_time__gte=2020-10-10T09:11:41.674Z&last_update_time__gte=2020-10-10T09:11:41.674Z' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lists_count'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'user_data'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - lists
      summary: lists count options
      description: Get options for the resource.
      operationId: getListsCountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lists/{list_id}:
    parameters:
      - in: path
        name: list_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: List ID  (list_id received in the "create list" request).
    get:
      tags:
        - lists
      summary: get list
      description: Get list by ID.
      operationId: getList
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists/{listId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            response = luna3client.getList(
                listId=listId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/lists/8d5f7c8a-6312-457a-9d82-a4b25418124e' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/List'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/list_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      tags:
        - lists
      summary: check if list exists
      description: Check if list with `list_id` exists.
      operationId: checkList
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # check list
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists/{listId}"
            response = requests.head(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            response = luna3client.checkList(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                listId=listId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --head 'http://127.0.0.1:5000/6/lists/8d5f7c8a-6312-457a-9d82-a4b25418124e' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: OK.
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: List not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'
    patch:
      tags:
        - lists
      summary: update list
      description: Update the *user_data* field of the list.
      operationId: patchList
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {"user_data": "list of good persons"}
            url = f"{baseUri}/lists/{listId}"
            response = requests.patch(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            response = luna3client.updateList(
                listId=listId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                userData="list of good persons",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PATCH 'http://127.0.0.1:5000/6/lists/8d5f7c8a-6312-457a-9d82-a4b25418124e' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"user_data": "list of good persons"}'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update_list'
        required: true
      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: Updated.
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userData'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/list_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    delete:
      tags:
        - lists
      summary: delete list
      description: Delete list by ID.
      operationId: deleteList
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/with_faces'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # delete list
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {"with_faces": 1}
            url = f"{baseUri}/lists/{listId}"
            response = requests.delete(url, params=params, headers=headers)

            print(response.status_code)

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            response = luna3client.deleteList(
                listId=listId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
                withFaces=1,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/lists/8d5f7c8a-6312-457a-9d82-a4b25418124e?with_faces=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"user_data": "list of bad persons"}'
      responses:
        202:
          description: Successful list deletion ("with_faces" is enabled), removing faces in progress (time depends on number of faces, server load, etc.).
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: Successful list deletion ("with_faces" is disabled).
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: List not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 22003
                desc: Object not found
                detail: List with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - lists
      summary: list options
      description: Get options for the resource.
      operationId: getListOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lists/{list_id}/faces:
    parameters:
      - in: path
        name: list_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: List ID (list_id received in the "create list" request).
    patch:
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      tags:
        - lists
      summary: attach/detach faces to the list
      description: Attach or detach faces to the list.
      operationId: linkFaces
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Link'
        required: true
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            url = f"{baseUri}/lists/{listId}/faces"

            # attach face to list
            payload = {"action": "attach", "face_ids": [faceId]}
            response = requests.patch(url, headers=headers, json=payload)

            print(response.status_code)

            # detach face from list
            payload = {"action": "detach", "face_ids": [faceId]}
            response = requests.patch(url, headers=headers, json=payload)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            # attach face to list
            response = luna3client.linkFacesToList(
                listId=listId,
                action="attach",
                faceIds=[
                    faceId,
                ],
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)

            # detach face from list
            response = luna3client.linkFacesToList(
                listId=listId,
                action="detach",
                faceIds=[
                    faceId,
                ],
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PATCH 'http://127.0.0.1:5000/6/lists/8d5f7c8a-6312-457a-9d82-a4b25418124e/faces' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"action": "attach", "face_ids": ["95113f42-849d-4240-8493-00f125ae29e5"]}'
      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: Updated.
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: ''action'',  message: ''''detach1'' is not one of [''attach'', ''detach'']'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
                faces_not_found:
                  value:
                    error_code: 22004
                    desc: Object not found
                    detail: One or more faces not found, including face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22004"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          $ref: '#/components/responses/list_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - lists
      summary: link options
      description: Get options for the resource.
      operationId: getLinkerOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/matcher/faces:
    post:
      tags:
        - matcher
      summary: matching faces
      description: |
        Performs matching of given references with given candidates.

        >**Note!** *Descriptors must be extracted for reference(s) and
        candidate(s). Objects without descriptors cannot be matched.*

        The sources for candidates are faces, attributes and events. See the "compare two faces using their IDs",
        "compare two events using their IDs", and "compare events using filters" examples.

        You can specify the "list_id" filter of the "faces" candidate to perform matching by the specified list.
        See the "search by list and creation time" examples.

        The sources for references are faces, events, attributes, external IDs of faces,
        or descriptors (raw, SDK format, or binary XPK format).

        Matching results are returned for the candidates that correspond to the specified filters.
        If none of the candidates corresponds to the filters (for example, a non-existent ID is set in the
        "event_ids" field or the "face_ids" field), there will be no matching result and no error returned.
        The result field will be empty. See the "nonexistent references errors" examples.

        If a non-existent reference is set (for example, a non-existent ID is set in the "event_id" field or
        the "face_id" field), the corresponding error is returned. See the "no ID for reference
        face found" response example.

      operationId: matchFaces
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/json_or_msgpack_content'
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/match_response_accept'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            # create face
            payload = {
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": attributeId},
            }
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
                json=payload,
            ).json()["face_id"]

            # match
            payload = {
                "candidates": [
                    {
                        "filters": {
                            "origin": "faces",
                            "face_ids": [faceId],
                        },
                        "limit": 3,
                        "threshold": 0.5,
                    }
                ],
                "references": [{"type": "face", "id": faceId}],
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/matcher/faces"
            response = requests.post(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import BinaryImage
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters
            from luna3.python_matcher.match_objects import Reference
            from luna3.python_matcher.match_objects import Candidates

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # create sample
            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            attributeId = luna3client.extractAttrFromSample(
                sampleIds=[
                    sampleId,
                ],
                raiseError=True,
            ).json[0]["attribute_id"]

            # create face
            faceId = luna3client.createFace(
                attributeId=attributeId,
                raiseError=True,
            ).json["face_id"]

            # match
            candidates = Candidates(
                FaceFilters(
                    faceIds=[
                        faceId,
                    ]
                ),
                limit=3,
                threshold=0.5,
            )
            reference = Reference("face", faceId)

            response = luna3client.matchFaces(
                candidates=[candidates], references=[reference],
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/matcher/faces' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "candidates": [{"filters": {"origin": "faces", "face_ids": ["95113f42-849d-4240-8493-00f125ae29e5"]}, "limit": 3, "threshold": 0.5}],
                "references": [{"type": "face", "id": "95113f42-849d-4240-8493-00f125ae29e5"}]
            }'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/match_faces_request_json'
            examples:
              compare_faces_using_IDs:
                summary: compare two faces using their IDs
                value:
                  candidates:
                    - filters:
                        origin: "faces"
                        face_ids: [ "557d54ec-29ad-4f3c-93b4-c9092ef12515" ]
                        account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                        external_ids: [ "557d54ec-29ad-4f3c-93b4-c9092ef12550" ]
                        user_data: "some_string"
                        create_time__gte: "2018-08-11T09:11:41.674Z"
                        create_time__lt: "2022-08-11T09:11:41.674Z"
                        face_id__gte: "557d54ec-29ad-4f3c-93b4-c9092ef12515"
                        face_id__lt: "557d54ec-29ad-4f3c-93b4-c9092ef12519"
                        list_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                      limit: 3
                      targets: [ "face_id", "account_id", "event_id", "user_data", "create_time", "external_id", "lists", "similarity" ]
                      threshold: 0.01
                  references:
                    - type: "face"
                      id: "35229c93-85f8-44f3-ab30-3248d7051af9"

              search_by_list_and_creation_time:
                summary: search by list and creation time
                value:
                  candidates:
                    - filters:
                        origin: "faces"
                        create_time__gte: "2018-08-11T09:11:41.674Z"
                        create_time__lt: "2022-08-11T09:11:41.674Z"
                        list_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                      limit: 3
                      targets: [ "face_id", "user_data", "create_time", "similarity" ]
                      threshold: 0.5
                  references:
                    - type: "face"
                      id: "35229c93-85f8-44f3-ab30-3248d7051af9"

              compare_events_using_filters:
                summary: compare events using filters
                value:
                  {
                    "candidates": [
                      {
                        "filters": {
                          "origin": "events",
                          "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                          "create_time__gte": "2018-08-11T09:11:41.674Z",
                          "create_time__lt": "2022-08-11T09:11:41.674Z",
                          "end_time__gte": "2018-08-11T09:11:42.500Z",
                          "end_time__lt": "2022-08-11T09:11:42.500Z",
                          "track_ids": [ "track_id_number_1", "track_id_number_2" ],
                        },

                        "limit": 1,
                        "targets": [
                            "event_id",
                            "account_id",
                            "create_time",
                            "external_id",
                            "handler_id",
                            "source",
                            "face_id",
                            "gender",
                            "age",
                            "emotion",
                            "ethnic_group",
                            "tags",
                            "user_data",
                            "track_id",
                            "similarity"
                        ],
                        "threshold": 0.01
                      }
                    ],
                    "references": [
                      {
                        "type": "event",
                        "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a"
                      }
                    ]
                  }

              compare_events_using_ids:
                summary: compare two events using their IDs
                value:
                  {
                    "candidates": [
                      {
                        "filters": {
                          "origin": "events",
                          "event_ids": [
                              "baa77249-a2c8-4b7b-814f-cc2189f67f15"
                          ]
                        },
                        "limit": 1,
                        "targets": [
                            "event_id",
                            "account_id",
                            "create_time",
                            "external_id",
                            "handler_id",
                            "source",
                            "face_id",
                            "gender",
                            "age",
                            "emotion",
                            "ethnic_group",
                            "tags",
                            "user_data",
                            "similarity"
                        ],
                        "threshold": 0.01
                      }
                    ],
                    "references": [
                      {
                        "type": "event",
                        "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a"
                      }
                    ]
                  }

              several_candidates_and_references:
                summary: several candidates and references
                value:
                  {
                    "candidates": [
                      {
                        "filters": {
                          "origin": "faces",
                          "face_ids": [
                              "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                          ]
                        },
                        "limit": 3,
                        "targets": [
                            "face_id",
                            "account_id",
                            "event_id",
                            "user_data",
                            "create_time",
                            "external_id",
                            "avatar",
                            "lists",
                            "similarity"
                        ],
                        "threshold": 0.01
                      },
                      {
                        "filters": {
                          "origin": "events",
                          "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                          "create_time__gte": "2018-08-11T09:11:41.674Z",
                          "create_time__lt": "2022-08-11T09:11:41.674Z",
                        },

                        "limit": 1,
                        "targets": [
                            "event_id",
                            "account_id",
                            "create_time",
                            "external_id",
                            "handler_id",
                            "source",
                            "face_id",
                            "gender",
                            "age",
                            "emotion",
                            "ethnic_group",
                            "tags",
                            "user_data",
                            "similarity"
                        ],
                        "threshold": 0.01
                      }
                    ],
                    "references": [
                      {
                        "type": "event",
                        "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a"
                      },
                      {
                        "type": "face",
                        "id": "a68f5995-766d-4a27-889a-35e373d0f0b2"
                      },
                      {
                        "type": "attribute",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      },
                      {
                        "type": "face_external_id",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      },
                      {
                        "type": "event_external_id",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      },
                      {
                        "type": "event_track_id",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      }
                    ]
                  }

              nonexistent_references_errors:
                summary: nonexistent references errors
                value:
                  {
                    "candidates": [
                      {
                        "filters": {
                          "origin": "faces",
                          "face_ids": [
                              "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                          ]
                        },
                        "limit": 3,
                        "targets": [
                            "face_id",
                            "account_id",
                            "event_id",
                            "user_data",
                            "create_time",
                            "external_id",
                            "avatar",
                            "lists",
                            "similarity"
                        ],
                        "threshold": 0.01
                      },
                      {
                        "filters": {
                          "origin": "events",
                          "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                          "create_time__gte": "2018-08-11T09:11:41.674Z",
                          "create_time__lt": "2022-08-11T09:11:41.674Z"
                        },
                        "limit": 1,
                        "targets": [
                            "event_id",
                            "account_id",
                            "create_time",
                            "external_id",
                            "handler_id",
                            "source",
                            "face_id",
                            "gender",
                            "age",
                            "emotion",
                            "ethnic_group",
                            "tags",
                            "user_data",
                            "similarity"
                        ],
                        "threshold": 0.01
                      }
                    ],
                    "references": [
                      {
                        "type": "event",
                        "id": "e983b50f-d4c3-4d41-bb53-5705b8f6f33a"
                      },
                      {
                        "type": "face",
                        "id": "a68f4995-766d-4a27-889a-35e373d0f0b2"
                      },
                      {
                        "type": "attribute",
                        "id": "9b39e212-f744-49f1-aa84-e857d44e222b"
                      },
                      {
                        "type": "face_external_id",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      },
                      {
                        "type": "event_external_id",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      },
                      {
                        "type": "event_track_id",
                        "id": "9b39e912-f744-49f1-aa84-e857d44e222b"
                      }
                    ]
                  }
          application/msgpack:
            schema:
              $ref: '#/components/schemas/match_faces_request_msgpack'
        required: true
      responses:
        200:
          description: Success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/match_result'
              examples:
                compare_faces_using_IDs:
                  summary: compare two faces using their IDs
                  value:
                    [
                      {
                        "reference": {
                          "id": "a68f5995-766d-4a27-889a-35e373d0f0b2",
                          "type": "face"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "face": {
                                  "face_id": "557d54ec-29ad-4f3c-93b4-c9092ef12515",
                                  "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
                                  "event_id": null,
                                  "user_data": "some_string",
                                  "create_time": "2020-08-13T18:12:20.469171+03:00",
                                  "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                                  "lists": [
                                      "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                  ]
                                },
                                "similarity": 0.9
                              }
                            ],
                            "filters": {
                              "origin": "faces",
                              "account_id": "0468ca85-f6ca-4841-b30c-5ccc26b6f397",
                              "external_ids": [
                                  "557d54ec-29ad-4f3c-93b4-c9092ef12550"
                              ],
                              "face_ids": [
                                  "557d54ec-29ad-4f3c-93b4-c9092ef12515"
                              ],
                              "user_data": "some_string",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z",
                              "face_id__gte": "000d54ec-29ad-4f3c-93b4-c9092ef12515",
                              "face_id__lt": "557d54ec-29ad-4f3c-93b4-c9092ef12519",
                              "list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                            }
                          }
                        ]
                      }
                    ]

                compare_faces_using_IDs_no_reference_ID:
                  summary: no ID for reference face found
                  value:
                    [
                      {
                        "reference": {
                          "id": "a68f5995-766d-4a27-889a-35e373d0f0b2",
                          "type": "face"
                        },
                        "matches": [
                          {
                            "result": [ ],
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a3bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          }
                        ]
                      }
                    ]

                search_by_list_and_creation_time:
                  summary: search by list and creation time
                  value:
                    [
                      {
                        "reference": {
                          "id": "35229c93-85f8-44f3-ab30-3248d7051af9",
                          "type": "face"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "face": {
                                  "face_id": "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7",
                                  "user_data": "some_string",
                                  "create_time": "2020-08-13T18:12:20.469171+03:00"
                                },
                                "similarity": 0.9
                              }
                            ],
                            "filters": {
                              "origin": "faces",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z",
                              "list_id": "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                            }
                          }
                        ]
                      }
                    ]

                compare_events_using_filters:
                  summary: compare events using filters
                  value:
                    [
                      {
                        "reference": {
                          "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a",
                          "type": "event"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:17:21.237708+03:00",
                                  "external_id": "",
                                  "handler_id": "d62a87ef-ee1f-419a-940c-55031b90b970",
                                  "source": null,
                                  "face_id": "e65ed861-64a2-4c5e-b348-017c090578d2",
                                  "gender": null,
                                  "age": null,
                                  "emotion": null,
                                  "ethnic_group": null,
                                  "user_data": "",
                                  "tags": null
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            }
                          }
                        ]
                      }
                    ]
                compare_events_using_ids:
                  summary: compare two events using their IDs
                  value:
                    [
                      {
                        "reference": {
                          "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a",
                          "type": "event"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "baa77249-a2c8-4b7b-814f-cc2189f67f15",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:24:59.921013+03:00",
                                  "external_id": "",
                                  "handler_id": "49c4355f-97c6-4a95-8539-67bab7fc919b",
                                  "source": null,
                                  "face_id": "14ee7ea4-b0b2-4abb-979a-68159ec9b786",
                                  "gender": 0,
                                  "age": 22,
                                  "emotion": null,
                                  "ethnic_group": 4,
                                  "user_data": "",
                                  "tags": null
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "event_ids": [
                                  "baa77249-a2c8-4b7b-814f-cc2189f67f15"
                              ]
                            }
                          }
                        ]
                      }
                    ]

                several_candidates_and_references:
                  summary: several candidates and references
                  value:
                    [
                      {
                        "reference": {
                          "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a",
                          "type": "event"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "face": {
                                  "face_id": "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "event_id": null,
                                  "user_data": "some_string",
                                  "create_time": "2020-08-13T18:12:20.469171+03:00",
                                  "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                                  "avatar": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg",
                                  "lists": [
                                      "c309ebfc-8485-45c4-a9e2-cbd1357b20a1"
                                  ]
                                },
                                "similarity": 0.0326438951
                              }
                            ],
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:17:21.237708+03:00",
                                  "external_id": "",
                                  "handler_id": "d62a87ef-ee1f-419a-940c-55031b90b970",
                                  "source": null,
                                  "face_id": "e65ed861-64a2-4c5e-b348-017c090578d2",
                                  "gender": null,
                                  "age": null,
                                  "emotion": null,
                                  "ethnic_group": null,
                                  "user_data": "",
                                  "tags": null
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "a68f5995-766d-4a27-889a-35e373d0f0b2",
                          "type": "face"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "face": {
                                  "face_id": "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "event_id": null,
                                  "user_data": "some_string",
                                  "create_time": "2020-08-13T18:12:20.469171+03:00",
                                  "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                                  "avatar": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg",
                                  "lists": [
                                      "c309ebfc-8485-45c4-a9e2-cbd1357b20a1"
                                  ]
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:17:21.237708+03:00",
                                  "external_id": "",
                                  "handler_id": "d62a87ef-ee1f-419a-940c-55031b90b970",
                                  "source": null,
                                  "face_id": "e65ed861-64a2-4c5e-b348-017c090578d2",
                                  "gender": null,
                                  "age": null,
                                  "emotion": null,
                                  "ethnic_group": null,
                                  "user_data": ""
                                },
                                "similarity": 0.0326438951
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "9b39e912-f744-49f1-aa84-e857d44e222b",
                          "type": "attribute"
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "face": {
                                  "face_id": "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "event_id": null,
                                  "user_data": "some_string",
                                  "create_time": "2020-08-13T18:12:20.469171+03:00",
                                  "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                                  "avatar": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2d/Yfke-sturm-1326186044.jpg/800px-Yfke-sturm-1326186044.jpg",
                                  "lists": [
                                      "c309ebfc-8485-45c4-a9e2-cbd1357b20a1"
                                  ]
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:17:21.237708+03:00",
                                  "external_id": "",
                                  "handler_id": "d62a87ef-ee1f-419a-940c-55031b90b970",
                                  "source": null,
                                  "face_id": "e65ed861-64a2-4c5e-b348-017c090578d2",
                                  "gender": null,
                                  "age": null,
                                  "emotion": null,
                                  "ethnic_group": null,
                                  "user_data": ""
                                },
                                "similarity": 0.0326438951
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "9b39e912-f744-49f1-aa84-e857d44e222b",
                          "type": "face_external_id"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 11041,
                              "desc": "Object not found",
                              "detail": "No one face found with external id 9b39e912-f744-49f1-aa84-e857d44e222b",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11041"
                            },
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            },
                            "error": {
                              "error_code": 11041,
                              "desc": "Object not found",
                              "detail": "No one face found with external id 9b39e912-f744-49f1-aa84-e857d44e222b",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11041"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a",
                          "type": "event_external_id",
                          "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:17:21.237708+03:00",
                                  "external_id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a",
                                  "handler_id": "d62a87ef-ee1f-419a-940c-55031b90b970",
                                  "source": null,
                                  "face_id": "e65ed861-64a2-4c5e-b348-017c090578d2",
                                  "gender": null,
                                  "age": null,
                                  "emotion": null,
                                  "ethnic_group": null,
                                  "user_data": "",
                                  "tags": null
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "e981b50f-d4c3-4d41-bb53-5705b8f6f33a",
                          "type": "event_track_id",
                          "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                        },
                        "matches": [
                          {
                            "result": [
                              {
                                "event": {
                                  "event_id": "cf0d6ce9-bb5e-4978-a1e7-b5c01ac577ec",
                                  "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                                  "create_time": "2020-08-14T12:17:21.237708+03:00",
                                  "external_id": "",
                                  "handler_id": "d62a87ef-ee1f-419a-940c-55031b90b970",
                                  "source": null,
                                  "face_id": "e65ed861-64a2-4c5e-b348-017c090578d2",
                                  "gender": null,
                                  "age": null,
                                  "emotion": null,
                                  "ethnic_group": null,
                                  "user_data": "",
                                  "tags": null
                                },
                                "similarity": 1.0
                              }
                            ],
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            }
                          }
                        ]
                      }
                    ]
                nonexistent_references_errors:
                  summary: nonexistent references errors
                  value:
                    [
                      {
                        "reference": {
                          "id": "e983b50f-d4c3-4d41-bb53-5705b8f6f33a",
                          "type": "event"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 23001,
                              "desc": "Object not found",
                              "detail": "Event with id e983b50f-d4c3-4d41-bb53-5705b8f6f33a not found",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-23001"
                            },
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            },
                            "error": {
                              "error_code": 23001,
                              "desc": "Object not found",
                              "detail": "Event with id e983b50f-d4c3-4d41-bb53-5705b8f6f33a not found",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-23001"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "a68f4995-766d-4a27-889a-35e373d0f0b2",
                          "type": "face"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 22002,
                              "desc": "Object not found",
                              "detail": "Face with id 'a68f4995-766d-4a27-889a-35e373d0f0b2' not found",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"
                            },
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            },
                            "error": {
                              "error_code": 22002,
                              "desc": "Object not found",
                              "detail": "Face with id 'a68f4995-766d-4a27-889a-35e373d0f0b2' not found",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "9b39e212-f744-49f1-aa84-e857d44e222b",
                          "type": "attribute"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 22011,
                              "desc": "Object not found",
                              "detail": "Attributes with id 9b39e212-f744-49f1-aa84-e857d44e222b not found",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22011"
                            },
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            },
                            "error": {
                              "error_code": 22011,
                              "desc": "Object not found",
                              "detail": "Attributes with id 9b39e212-f744-49f1-aa84-e857d44e222b not found",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22011"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "9b39e912-f744-49f1-aa84-e857d44e222b",
                          "type": "face_external_id"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 11041,
                              "desc": "Object not found",
                              "detail": "No one face found with external id 9b39e912-f744-49f1-aa84-e857d44e222b",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11041"
                            },
                            "filters": {
                              "origin": "faces",
                              "face_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          },
                          {
                            "filters": {
                              "origin": "events",
                              "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                              "create_time__gte": "2018-08-11T09:11:41.674Z",
                              "create_time__lt": "2022-08-11T09:11:41.674Z"
                            },
                            "error": {
                              "error_code": 11041,
                              "desc": "Object not found",
                              "detail": "No one face found with external id 9b39e912-f744-49f1-aa84-e857d44e222b",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11041"
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "9b39e912-f744-49f1-aa84-e857d44e222b",
                          "type": "event_external_id"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 11057,
                              "desc": "Object not found",
                              "detail": "No one event found with external id 9b39e912-f744-49f1-aa84-e857d44e222b",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11057"
                            },
                            "filters": {
                              "origin": "events",
                              "event_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          }
                        ]
                      },
                      {
                        "reference": {
                          "id": "9b39e912-f744-49f1-aa84-e857d44e222b",
                          "type": "event_track_id"
                        },
                        "matches": [
                          {
                            "error": {
                              "error_code": 11058,
                              "desc": "Object not found",
                              "detail": "No one event found with track id 9b39e912-f744-49f1-aa84-e857d44e222b",
                              "link": "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11058"
                            },
                            "filters": {
                              "origin": "events",
                              "event_ids": [
                                  "55a1bfd7-ef35-45ea-a811-a018fbc7f5d7"
                              ]
                            }
                          }
                        ]
                      }
                    ]
            application/msgpack:
              schema:
                $ref: '#/components/schemas/match_result'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: ''action'',  message: ''''detach1'' is not one of [''attach'', ''detach'']'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
                lists_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: One or more lists not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
                face_not_found:
                  value:
                    error_code: 22002
                    desc: Object not found
                    detail: Face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"
                faces_not_found:
                  value:
                    error_code: 22004
                    desc: Object not found
                    detail: One or more faces not found, including face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22004"
                descriptor_not_extracted:
                  value:
                    error_code: 11034
                    desc: Bad/incomplete input data
                    detail: Descriptor for attribute '793877ae-171a-4810-8d29-ad7c0f404dfe' was not extracted
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11034"
                bad_xpk_file:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: Failed to parse xpk file
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12035"
                bad_sdk_descriptor:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: SDK descriptor is not valid
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12038"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_events_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - matcher
      summary: matcher options
      description: Get options for the resource.
      operationId: getMatcherOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/matcher/bodies:
    post:
      tags:
        - matcher
      summary: human body matching
      description: |
        Matcher API allows to submit tasks to a service that searches for human bodies similar to a given reference(s) by
        matching them. A body attribute descriptor should be extracted for reference(s) and candidate(s).

        The sources for references are events or binary descriptor. The sources for candidates is events.
      operationId: matchBodies
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/json_or_msgpack_content'
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/match_response_accept'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/match_bodies_request_json'
          application/msgpack:
            schema:
              $ref: '#/components/schemas/match_bodies_request_msgpack'
        required: true
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/match_bodies_result'
              examples:
                compare_events_with_filters:
                  summary: compare events using filters
                  value:
                    - reference:
                        id: "a68f5995-766d-4a27-889a-35e373d0f0b2"
                        type: "event"
                      matches:
                        - result:
                            - similarity: 0.5
                              event:
                                create_time: "2018-08-11T09:11:41.674Z"
                                event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                handler_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                                external_id: "14159261415926"
                                source: "Main_hall_camera"
                                stream_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                                top_match:
                                  face_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                  similarity: 0.6
                                  label: "good guys"
                                  external_id: "external_id_1"
                                match_result:
                                  - candidates:
                                      - event:
                                          event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                          create_time: "2018-08-11T09:11:41.674Z"
                                          external_id: null
                                          user_data: "user data"
                                          handler_id: null
                                          stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                                          source: "cam_1"
                                        similarity: 0.5
                                    label: "good guy"
                                face_detections:
                                  - sample_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                    detection:
                                      rect:
                                        height: 240
                                        width: 209
                                        x: 170
                                        y: 198
                                    detect_time: "2018-08-11T09:11:41.674Z"
                                    detect_ts: 123.456
                                    image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                body_detections:
                                  - sample_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                    detection:
                                      rect:
                                        height: 240
                                        width: 209
                                        x: 170
                                        y: 198
                                    detect_time: "2018-08-11T09:11:41.674Z"
                                    detect_ts: 123.456
                                    image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                face_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                attach_result: [ "b668c4a5-2191-476e-a261-3b4f9ce2e25e" ]
                                gender: 1
                                age: 29
                                emotion: 1
                                mask: 1
                                ethnic_group: 4
                                tags: [ "tag1","tag2" ]
                                user_data: "info"
                                location:
                                  city: "Moscow"
                                  area: "string"
                                  district: "string"
                                  street: "Lenina"
                                  house_number: "3"
                                  geo_position:
                                    longitude: -63.9
                                    latitude: 40.7
                                track_id: "useful_track_id_number_1"
                          filters:
                            origin: "events"
                            event_ids: [ "b668c4a5-2191-476e-a261-3b4f9ce2e25e" ]
                            account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                            event_id__gte: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                            event_id__lt: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                            create_time__gte: "2018-08-11T09:11:41.674Z"
                            create_time__lt: "2018-08-11T09:11:41.674Z"
                            handler_ids: [ "b668c4a5-2191-476e-a261-3b4f9ce2e25e" ]
                            external_ids: [ "14159261415926" ]
                            top_matching_candidates_label: "good guys"
                            top_similar_object_ids: [ "b668c4a5-2191-476e-a261-3b4f9ce2e25e" ]
                            top_similar_external_ids: [ "external_id_1" ]
                            top_similar_object_similarity__gte: 0.5
                            top_similar_object_similarity__lt: 0.5
                            age__gte: 22
                            age__lt: 30
                            gender: 1
                            emotions: [ 4,7 ]
                            masks: [ 2, 3 ]
                            ethnic_groups: [ 4,3 ]
                            face_ids: [ "557d54ec-29ad-4f3c-93b4-c9092ef12515" ]
                            user_data: "user info"
                            sources: [ "cam1","cam2" ]
                            tags: [ "tag1","tag2" ]
                            cities: [ "Moscow","New-York" ]
                            areas: [ "area1","area2" ]
                            districts: [ "mitino", "central park" ]
                            streets: [ "arbat", "schepkina" ]
                            house_numbers: [ "1", "1/2str3" ]
                            geo_position:
                              origin_longitude: 36.616
                              origin_latitude: 55.752
                              longitude_delta: 0.01
                              latitude_delta: 0.01
                            track_ids: [ "track_id_number_1", "track_id_number_2" ]
                    - reference:
                        id: "a68f5995-766d-4a27-889a-35e373d0f0b2"
                        type: "event_external_id"
                        event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                      matches:
                        - result:
                            - similarity: 1.0
                              event:
                                create_time: "2018-08-11T09:11:41.674Z"
                                event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                handler_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                                external_id: "14159261415926"
                                source: "Main_hall_camera"
                                stream_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                                top_match:
                                  face_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                  similarity: 0.6
                                  label: "good guys"
                                  external_id: "external_id_1"
                                match_result:
                                  - candidates:
                                      - event:
                                          event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                          create_time: "2018-08-11T09:11:41.674Z"
                                          external_id: null
                                          user_data: "user data"
                                          handler_id: null
                                          stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                                          source: "cam_1"
                                        similarity: 0.5
                                    label: "good guy"
                                face_detections:
                                  - sample_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                    detection:
                                      rect:
                                        height: 240
                                        width: 209
                                        x: 170
                                        y: 198
                                    detect_time: "2018-08-11T09:11:41.674Z"
                                    detect_ts: 123.456
                                    image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                body_detections:
                                  - sample_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                    detection:
                                      rect:
                                        height: 240
                                        width: 209
                                        x: 170
                                        y: 198
                                    detect_time: "2018-08-11T09:11:41.674Z"
                                    detect_ts: 123.456
                                    image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                face_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                                attach_result: [ "b668c4a5-2191-476e-a261-3b4f9ce2e25e" ]
                                gender: 1
                                age: 29
                                emotion: 1
                                mask: 1
                                ethnic_group: 4
                                tags: [ "tag1","tag2" ]
                                user_data: "info"
                                location:
                                  city: "Moscow"
                                  area: "string"
                                  district: "string"
                                  street: "Lenina"
                                  house_number: "3"
                                  geo_position:
                                    longitude: -63.9
                                    latitude: 40.7
                                track_id: "useful_track_id_number_1"
                          filters:
                            origin: "events"
                            account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                nonexistent_reference_error:
                  summary: nonexistent reference error
                  value:
                    - reference:
                        id: "e983b50f-d4c3-4d41-bb53-5705b8f6f33a"
                        type: "event"
                      matches:
                        - error:
                            error_code: 23001
                            desc: "Object not found"
                            detail: "Event with id e983b50f-d4c3-4d41-bb53-5705b8f6f33a not found"
                            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-23001"
                          filters:
                            origin: "events"
                            account_id: "6d071cca-fda5-4a03-84d5-5bea65904480"
                            create_time__gte: "2018-08-11T09:11:41.674Z"
                            create_time__lt: "2022-08-11T09:11:41.674Z"
                    - reference:
                        id: "e983b50f-d4c3-4d41-bb53-5705b8f6f33a"
                        type: "event_external_id"
                      matches:
                        - error:
                            error_code: 11057
                            desc: "Object not found"
                            detail: "No one event found with external id e983b50f-d4c3-4d41-bb53-5705b8f6f33a"
                            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11057"
                          filters:
                            origin: "events"
                            account_id: "6d071cca-fda5-4a03-84d5-5bea65904480"
                            create_time__gte: "2018-08-11T09:11:41.674Z"
                            create_time__lt: "2022-08-11T09:11:41.674Z"
                    - reference:
                        id: "e983b50f-d4c3-4d41-bb53-5705b8f6f33a"
                        type: "event_track_id"
                      matches:
                        - error:
                            error_code: 11057
                            desc: "Object not found"
                            detail: "No one event found with track id e983b50f-d4c3-4d41-bb53-5705b8f6f33a"
                            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11057"
                          filters:
                            origin: "events"
                            account_id: "6d071cca-fda5-4a03-84d5-5bea65904480"
                            create_time__gte: "2018-08-11T09:11:41.674Z"
                            create_time__lt: "2022-08-11T09:11:41.674Z"
            application/msgpack:
              schema:
                $ref: '#/components/schemas/match_result'

        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: ''candidates'',  message: ''candidates must contain [''type'', ''ids''] properties'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: 'Bad query parameters ''limit'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                bad_target_to_get_events:
                  value:
                    error_code: 22016
                    desc: Bad input data
                    detail: '''invalid'' is not valid target to get events. Valid target should be one of ["event_id", "account_id", "create_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"].'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22016"
                bad_base64_for_one_descriptor:
                  value:
                    error_code: 18001
                    desc: Bad/incomplete input data
                    detail: Failed convert data from base64 to bytes
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-18001"
                wrong_descriptors_length:
                  value:
                    error_code: 12034
                    desc: Bad/incomplete input data
                    detail: Descriptor has incorrect length 200
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12034"
                bad_xpk_file:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: Failed to parse xpk file
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12035"
                bad_sdk_descripot:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: SDK descriptor is not valid
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12038"
                xpk_does_not_contain_descriptor:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: XPK file does not contain descriptor
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
                unknown_descriptor_version:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: Descriptor version 37 are not registered in the system
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_events_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
      x-codeSamples:
        - lang: python
          source: |

            # This example is written using requests library

            import time
            import requests

            # Create handler
            payload = {
                "description": "Strange persons",
                "policies": {
                    "detect_policy": {
                        "detect_body": 1,
                    },
                    "extract_policy": {
                        "extract_body_descriptor": 1,
                    },
                }
            }
            baseUri = "http://127.0.0.1:5000/6"
            url = f"{baseUri}/handlers"
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            response = requests.post(url, json=payload, headers=headers)
            handlerId = response.json()["handler_id"]

            # Emit events with created handler
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()
            eventUrl = f"{url}/{handlerId}/events"
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }
            response = requests.post(
                eventUrl,
                headers=headers,
                data=image,
            )
            eventId = response.json()["events"][0]["event_id"]

            # Wait for event to be recorded
            time.sleep(2)

            # Perform matching
            payload = {
                "candidates": [{ "filters": {"origin": "events"}}],
                "references": [{"type": "event", "id": eventId}],
            }
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/matcher/faces"
            response = requests.post(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            import time

            from luna3.common.http_objs import BinaryImage
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import EventFilters
            from luna3.python_matcher.match_objects import Reference
            from luna3.python_matcher.match_objects import Candidates
            from luna3.common.http_objs import DetectPolicy
            from luna3.common.http_objs import ExtractPolicy
            from luna3.common.http_objs import Policies

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create handler
            detectPolicy = DetectPolicy(detectBody=1, detectFace=0)
            extractPolicy = ExtractPolicy(extractBodyDescriptor=1, extractFaceDescriptor=0)
            policies = Policies(detectPolicy=detectPolicy, extractPolicy=extractPolicy)
            response = luna3client.createHandler(description="Strange persons", policies=policies)
            handlerId = response.json["handler_id"]

            # Emit events with created handler
            image = BinaryImage("image.jpg")
            response = luna3client.emitEvents(handlerId, inputData=image)
            eventId = response.json["events"][0]["event_id"]

            # Wait for event to be recorded
            time.sleep(2)

            # Perform matching
            candidates = Candidates(EventFilters(), limit=1, threshold=0.5)
            reference = Reference("event", eventId)
            response = luna3client.matchBodies(
                candidates=[candidates], references=[reference],
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/matcher/bodies' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "candidates": [{"filters": {"origin": "events", "event_ids": ["fdd015be-f4b5-47dc-bfea-385e507b7b62"]}, "limit": 3, "threshold": 0.5}],
                "references": [{"type": "event", "id": "fdd015be-f4b5-47dc-bfea-385e507b7b62"}]
            }'

    options:
      tags:
        - matcher
      summary: matcher options
      description: Get options for the resource.
      operationId: getBodiesMatcherOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/matcher/raw:
    post:
      tags:
        - matcher
      summary: raw matching
      description: |
        Matcher raw API allows to do similarity calculations for input descriptors.
      operationId: matchingRaw
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/json_or_msgpack_content'
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/match_response_accept'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import base64

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            payload = {
                "references": [
                    {
                        "id": "string",
                        "type": "raw_descriptor",
                        "data": {"descriptor": descriptor, "version": 56},
                    }
                ],
                "candidates": [
                    {
                        "id": "string",
                        "type": "raw_descriptor",
                        "data": {"descriptor": descriptor, "version": 56},
                    }
                ],
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/matcher/raw"
            response = requests.post(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import RawDescriptor
            from luna3.python_matcher.match_objects import RawDescriptorReference

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            with open("descriptor56", "rb") as f:
                descriptor = f.read()

            candidates = RawDescriptorReference(
                "raw_descriptor",
                RawDescriptor(descriptor=descriptor, version=56),
            )
            reference = RawDescriptorReference(
                "raw_descriptor",
                RawDescriptor(descriptor=descriptor, version=56),
            )

            response = luna3client.matchRaw(
                candidates=[candidates], references=[reference],
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/matcher/raw' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"references":
            [{
                "id": "string",
                "type": "raw_descriptor",
                "data": {
                    "descriptor": "eJCHgXqOcYiPfXp4cnWCgnN4d2+Bgod4bXJ1en94g295e4iLgnxydHZwj4F3eIxygJB3iIqKh4BxeHhzh36KiImIgY2JdnyEfXh4hYyChoGGeGx5iXh4e4V5gISLjX2LhIOBf3B/i42KenmBhG93eX6Lg314e4SAfIuKd4uGfoWCgoN+iYB+gYGHiYWJfX+DhIt7g4Z6iXx8fntzg3l8gHSEfIZ4hX6JfoeFfoaFh36Ae4B5g4ODgJCHj3WCdISEgoh+inx+eYKFe4SFhXSEgoWIgn57eIF/eYF8hHuFg3p6dYKDf4F8gICCioOFeYaJgYR+gH1+g4V/g313g3mFfYJ9fHt2e4N/g3+Ae4OAgX97fYaHf3yAfHeCf4OAf4CAf4R7hn+EeX6EeoKGgn96gIOFg4CBg4OEe32EgX+BeoB/gH6Af4B/gX59fX2Ag399gH57g39/e4aAgH6BgX2DfX+Bf32Bg3qAfX9/hH15gHp+fn+ChIKBgH+BgoB+gX1/fn+Bg4CCf4CBfn58gH6CgX+BgIGCf31+gX1+f3+AfoCAe4OCfoF/foOBeoGDgYGAfIGBf4GBf4N7f3+Cgn6Af35/gYF/gH2BgIR/fn9/gIJ/f3uBfoN/gX6BgICAf39+gH6BgH5/gYOBfoGBgX98g4KBgoCAgH+Ae4B8f4B9fn0=",
                    "version": 56}}],
            "candidates": [{
                "id": "string",
                "type": "raw_descriptor",
                "data": {
                    "descriptor": "eJCHgXqOcYiPfXp4cnWCgnN4d2+Bgod4bXJ1en94g295e4iLgnxydHZwj4F3eIxygJB3iIqKh4BxeHhzh36KiImIgY2JdnyEfXh4hYyChoGGeGx5iXh4e4V5gISLjX2LhIOBf3B/i42KenmBhG93eX6Lg314e4SAfIuKd4uGfoWCgoN+iYB+gYGHiYWJfX+DhIt7g4Z6iXx8fntzg3l8gHSEfIZ4hX6JfoeFfoaFh36Ae4B5g4ODgJCHj3WCdISEgoh+inx+eYKFe4SFhXSEgoWIgn57eIF/eYF8hHuFg3p6dYKDf4F8gICCioOFeYaJgYR+gH1+g4V/g313g3mFfYJ9fHt2e4N/g3+Ae4OAgX97fYaHf3yAfHeCf4OAf4CAf4R7hn+EeX6EeoKGgn96gIOFg4CBg4OEe32EgX+BeoB/gH6Af4B/gX59fX2Ag399gH57g39/e4aAgH6BgX2DfX+Bf32Bg3qAfX9/hH15gHp+fn+ChIKBgH+BgoB+gX1/fn+Bg4CCf4CBfn58gH6CgX+BgIGCf31+gX1+f3+AfoCAe4OCfoF/foOBeoGDgYGAfIGBf4GBf4N7f3+Cgn6Af35/gYF/gH2BgIR/fn9/gIJ/f3uBfoN/gX6BgICAf39+gH6BgH5/gYOBfoGBgX98g4KBgoCAgH+Ae4B8f4B9fn0=",
                    "version": 56}}]}'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/matcher_raw_request_json'
          application/msgpack:
            schema:
              $ref: '#/components/schemas/matcher_raw_request_msgpack'
        required: true
      responses:
        201:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json_or_msgpack_content'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/matcher_raw_result'
              example:
                matches:
                  - reference_id: "46aeab25-df7d-46bd-afe2-cf60706a0d96"
                    matches:
                      - candidate_id: "f096439d-f306-49dc-bee9-266cb37e95eb"
                        similarity: 0.635
                  - reference_id: "raw-0"
                    matches:
                      - candidate_id: "candidate"
                        similarity: 1.0
                      - candidate_id: "sdk"
                        similarity: 0.867
                      - candidate_id: "xpk"
                        similarity: 0.678
            application/msgpack:
              schema:
                $ref: '#/components/schemas/matcher_raw_result'

        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: ''candidates'',  message: ''candidates[0] must be valid exactly by one of oneOf definition'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                bad_base64_for_one_descriptor:
                  value:
                    error_code: 18001
                    desc: Bad/incomplete input data
                    detail: Failed convert data from base64 to bytes
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-18001"
                wrong_descriptors_length:
                  value:
                    error_code: 12034
                    desc: Bad/incomplete input data
                    detail: Descriptor has incorrect length 200
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12034"
                bad_xpk_file:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: Failed to parse xpk file
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12035"
                bad_sdk_descriptor:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: SDK descriptor is not valid
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12038"
                xpk_does_not_contain_descriptor:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: XPK file does not contain descriptor
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
                unknown_descriptor_version:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: Descriptor version 37 are not registered in the system
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_events_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - matcher
      summary: matcher raw options
      description: Get options for the resource.
      operationId: getMatcherRawOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/handlers:
    post:
      tags:
        - handlers
      summary: create handler
      description: |
        Create a handler.

        The handler determines the list of rules (policies) for processing of input images.

        Handlers can be static, dynamic or lambda.

        When the handler is static, you specify its policies and then you specify the created handler ID during the [event creation](#operation/generateEvents).

        When the handler is dynamic, you create it without predefined policies and then you specify
        them during [event creation](#operation/generateEvents).
        You can create the dynamic handler by setting "handler_type" field to 1.

        > Some parameters from the `storage_policy` are enabled by default (for example, `face_sample_policy > store_sample`). Don't forget to disable saving
        the necessary objects to avoid overflowing the storage.

      operationId: createHandler
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            # create list
            payload = {"user_data": "list of good persons"}
            url = f"{baseUri}/lists"
            listId = requests.post(url, json=payload, headers=headers).json()["list_id"]

            policies = {
                "detect_policy": {
                    "estimate_emotions": 1,
                    "estimate_mask": 1,
                },
                "extract_policy": {
                    "extract_basic_attributes": 1,
                    "extract_face_descriptor": 1,
                    "fd_score_threshold": 0,
                },
                "match_policy": [
                    {
                        "label": "good guys",
                        "candidates": {
                            "origin": "faces",
                            "list_id": listId,
                        },
                        "filters": {"gender": 0},
                        "limit": 3,
                        "threshold": 0.5,
                    }
                ],
            }
            url = f"{baseUri}/handlers"

            # For non-dynamic handler case:
            payload = {
                "description": "non_dynamic_handler",
                "policies": policies,
                "handler_type": 0,
            }
            responseFirst = requests.post(url, json=payload, headers=headers)
            handlerId = responseFirst.json()["handler_id"]

            print(responseFirst.status_code)
            print(responseFirst.json())

            # For dynamic handler case:
            payload = {
                "description": "dynamic_handler",
                "handler_type": 1,
            }
            responseSecond = requests.post(url, json=payload, headers=headers)
            dynamicHandlerId = responseSecond.json()["handler_id"]

            print(responseSecond.status_code)
            print(responseSecond.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                Policies,
                DetectPolicy,
                ExtractPolicy,
                MatchPolicy,
                MatchPolicyCandidates,
            )

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            policies = Policies(
                detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1),
                extractPolicy=ExtractPolicy(
                    extractBasicAttributes=1,
                    extractFaceDescriptor=1,
                    fdScoreThreshold=0.0,
                ),
                matchPolicy=[
                    MatchPolicy(
                        candidates=MatchPolicyCandidates(
                            origin="faces", listId=listId
                        ),
                        label="good guys",
                        limit=3,
                        threshold=0.5,
                        gender=0,
                    )
                ],
            )

            # create non-dynamic handler
            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="test_handler",
                policies=policies,
                raiseError=True,
            ).json["handler_id"]

            print(response.statusCode)
            print(response.json)

            # create dynamic handler
            response = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="dynamic_handler",
                handlerType=1,
                raiseError=True,
            )
            dynamicHandlerId = response.json["handler_id"]
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/handlers' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "description": "non_dynamic_handler",
                "policies":{
                        "detect_policy": {
                            "estimate_emotions": 1,
                            "estimate_mask": 1
                        },
                        "extract_policy": {
                            "extract_basic_attributes": 1,
                            "extract_face_descriptor": 1,
                            "fd_score_threshold": 0
                        },
                        "match_policy": [
                            {
                                "label": "good guys",
                                "candidates": {
                                    "origin": "faces",
                                    "list_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e"
                                },
                                "filters": {"gender": 0},
                                "limit": 3,
                                "threshold": 0.5
                            }
                        ]
                    },
                "handler_type": 0
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/New_Handler'
            examples:
              all_policies_specified:
                summary: all policies specified
                value:
                  {
                    "description": "Full handler example",
                    "policies": {
                      "detect_policy": {
                        "estimate_people_count": {
                            "estimate": 1,
                            "people_coordinates": 1,
                        },
                        "detect_face": 1,
                        "detect_body": 1,
                        "multiface_policy": 1,
                        "estimate_head_pose": 1,
                        "estimate_emotions": 1,
                        "estimate_mask": 1,
                        "estimate_quality": 1,
                        "estimate_gaze": 1,
                        "estimate_glasses": 1,
                        "estimate_eyes_attributes": 1,
                        "estimate_mouth_attributes": 1,
                        "detect_landmarks68": 1,
                        "extract_exif": 1,
                        "yaw_threshold": 180,
                        "roll_threshold": 180,
                        "pitch_threshold": 180,
                        "mask_states": [
                            1
                        ],
                        "estimate_liveness": {
                          "estimate": 1,
                          "quality_threshold": 0.7,
                          "liveness_threshold": 0.7
                        },
                        "liveness_states": [ 1 ],
                        "estimate_deepfake": {
                          "estimate": 1,
                          "real_threshold": 0.7,
                          "mode": 2
                        },
                        "deepfake_states": [ 1 ],
                        "face_quality": {
                          "estimate": 1,
                          "filter": 0,
                          "checks": {
                            "image_format": {
                              "estimate": 1,
                              "threshold": [
                                  "JPEG",
                                  "JPEG2000",
                                  "PNG"
                              ]
                            },
                            "illumination_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.3,
                                "max": 1.0
                              }
                            },
                            "specularity_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.3,
                                "max": 1.0
                              }
                            },
                            "blurriness_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.61,
                                "max": 1.0
                              }
                            },
                            "dark_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "light_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.57,
                                "max": 1.0
                              }
                            },
                            "head_yaw": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "head_pitch": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "head_roll": {
                              "estimate": 1,
                              "threshold": {
                                "min": -8,
                                "max": 8
                              }
                            },
                            "gaze_yaw": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "gaze_pitch": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "mouth_smiling": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.0,
                                "max": 0.5
                              }
                            },
                            "mouth_occluded": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.0,
                                "max": 0.5
                              }
                            },
                            "mouth_open": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.0,
                                "max": 0.5
                              }
                            },
                            "glasses": {
                              "estimate": 1,
                              "threshold": [
                                  "no_glasses",
                                  "eyeglasses"
                              ]
                            },
                            "left_eye": {
                              "estimate": 1,
                              "threshold": [
                                  "open"
                              ]
                            },
                            "right_eye": {
                              "estimate": 1,
                              "threshold": [
                                  "open"
                              ]
                            },
                            "head_horizontal_center": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.45,
                                "max": 0.55
                              }
                            },
                            "head_vertical_center": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.3,
                                "max": 0.5
                              }
                            },
                            "head_width": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 0.75
                              }
                            },
                            "head_height": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.6,
                                "max": 0.9
                              }
                            },
                            "eye_distance": {
                              "estimate": 1,
                              "threshold": {
                                "min": 90,
                                "max": 1920
                              }
                            },
                            "image_width": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1920
                              }
                            },
                            "image_height": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1080
                              }
                            },
                            "aspect_ratio": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.74,
                                "max": 0.8
                              }
                            },
                            "face_width": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1920
                              }
                            },
                            "face_height": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1920
                              }
                            },
                            "indent_left": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "indent_right": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "indent_upper": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "indent_lower": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "image_size": {
                              "estimate": 1,
                              "threshold": {
                                "min": 5120,
                                "max": 2097152
                              }
                            },
                            "eyebrows_state": {
                              "estimate": 1,
                              "threshold": [ "neutral" ]
                            },
                            "headwear_type": {
                              "estimate": 1,
                              "threshold": [ "none" ]
                            },
                            "smile_properties": {
                              "estimate": 1,
                              "threshold": [ "none" ]
                            },
                            "face_color_type": {
                              "estimate": 1,
                              "threshold": [ "color" ]
                            },
                            "natural_light": {
                              "estimate": 1,
                              "threshold": 1
                            },
                            "radial_distortion": {
                              "estimate": 1,
                              "threshold": 0
                            },
                            "red_eyes": {
                              "estimate": 1,
                              "threshold": 0
                            },
                            "illumination_uniformity": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "dynamic_range": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "background_uniformity": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "background_lightness": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.2,
                                "max": 1.0
                              }
                            },

                          }
                        },
                        "body_attributes": {
                          "estimate_basic_attributes": 1,
                          "estimate_upper_body": 1,
                          "estimate_lower_body": 1,
                          "estimate_accessories": 1
                        }
                      },
                      "extract_policy": {
                        "extract_basic_attributes": 1,
                        "extract_face_descriptor": 1,
                        "fd_score_threshold": 0.6,
                        "extract_body_descriptor": 1
                      },
                      "match_policy": [
                        {
                          "label": "good guys",
                          "candidates": {
                            "origin": "faces",
                            "face_ids": [
                                "4db81a9a-515c-4cde-ac73-1810f5f737f2",
                                "957a48ba-f457-4814-829a-0fa55bc246fc"
                            ],
                            "account_id": "6d071cca-fda5-4a03-84d5-5bea65904480",
                            "external_ids": [ "557d54ec-29ad-4f3c-93b4-c9092ef12550" ],
                            "user_data": "operator",
                            "create_time__gte": "now-2y",
                            "create_time__lt": "2022-08-11T09:11:41.674Z",
                            "face_id__gte": "2046d39b-410d-481e-b9de-ede6a0c7367f",
                            "face_id__lt": "957a48ba-f457-4814-829a-0fa55bc246fc",
                            "list_id": "275d96c0-e655-4a69-a374-ad5e94b89bf9"
                          },
                          "filters": {
                            "gender": 1,
                            "ethnicities": [
                                4,
                                3
                            ],
                            "age__lt": 50,
                            "age__gte": 22,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ]
                          },
                          "limit": 3,
                          "targets": [
                              "face_id"
                          ],
                          "threshold": 0.5
                        }
                      ],
                      "storage_policy": {
                        "face_sample_policy": {
                          "store_sample": 1,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [ 1 ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          }
                        },
                        "body_sample_policy": {
                          "store_sample": 1,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [ 1 ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          }
                        },
                        "image_origin_policy": {
                          "store_image": 1,
                          "use_external_references": 1,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [
                                1
                            ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          }
                        },
                        "attribute_policy": {
                          "store_attribute": 1,
                          "ttl": 300,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [
                                1
                            ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          }
                        },
                        "face_policy": {
                          "store_face": 1,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [ 1 ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          },
                          "set_sample_as_avatar": 0,
                          "link_to_lists_policy": [
                            {
                              "list_id": "79bee337-484f-4124-b7e2-e4b76fb26308",
                              "filters": {
                                "gender": 1,
                                "ethnicities": [ 1 ],
                                "age__lt": 0,
                                "age__gte": 0,
                                "liveness": [ 1 ],
                                "deepfake": [ 1 ],
                                "match": [
                                  {
                                    "label": "good guys",
                                    "similarity__lte": 0.9,
                                    "similarity__gte": 0.9
                                  }
                                ]
                              }
                            }
                          ]
                        },
                        "event_policy": {
                          "store_event": 1,
                          "wait_saving": 1,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [ 1 ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          }
                        },
                        "notification_policy": {
                          "send_notification": 1,
                          "filters": {
                            "gender": 1,
                            "ethnicities": [ 1 ],
                            "age__lt": 0,
                            "age__gte": 0,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.9
                              }
                            ]
                          }
                        },
                        callbacks:[
                          {
                            type: "http",
                            authorization: {
                              type: "basic",
                              login: "username",
                              password: "password",
                            },
                            url: "http://127.0.0.1/",
                            params: {
                              timeout: 5,
                              content_type: "application/json",
                              headers: { }
                            },
                            filters: {
                              gender: 1,
                              ethnicities: [ 1 ],
                              age__lt: 0,
                              age__gte: 0,
                              match: [
                                {
                                  label: "good guys",
                                  similarity__lte: 0.9,
                                  similarity__gte: 0.9
                                }
                              ]
                            },
                            enable: 1
                          }
                        ],
                      },
                      "conditional_tags_policy": [
                        {
                          "tag": "new_tag",
                          "filters": {
                            "gender": 1,
                            "ethnicities": [
                                4,
                                3
                            ],
                            "age__lt": 50,
                            "age__gte": 22,
                            "liveness": [ 1 ],
                            "deepfake": [ 1 ],
                            "match": [
                              {
                                "label": "good guys",
                                "similarity__lte": 0.9,
                                "similarity__gte": 0.3
                              }
                            ]
                          }
                        }
                      ]
                    },
                    "handler_type": 0
                  }
              simple_handler_create_face:
                summary: simple handler for face creation
                value:
                  {
                    "description": "simple handler for storing face",
                    "policies": {
                      "storage_policy": {
                        "face_policy": {
                          "store_face": 1
                        },
                      }
                    },
                    "handler_type": 0
                  }
              basic_attributes_and_descriptor:
                summary: basic attributes and descriptor
                value:
                  {
                    "description": "properties, basic attributes, descriptor",
                    "policies": {
                      "detect_policy": {
                        "estimate_people_count": {
                          "estimate": 1,
                          "people_coordinates": 1,
                        },
                        "detect_face": 1,
                        "detect_body": 1,
                        "multiface_policy": 1,
                        "estimate_head_pose": 0,
                        "estimate_emotions": 0,
                        "estimate_quality": 0,
                        "estimate_gaze": 0,
                        "estimate_eyes_attributes": 0,
                        "estimate_mouth_attributes": 0,
                        "detect_landmarks68": 0,
                        "extract_exif": 0,
                        "yaw_threshold": 180,
                        "roll_threshold": 180,
                        "pitch_threshold": 180,
                        "mask_states": [
                            1
                        ],
                        "estimate_liveness": {
                          "estimate": 0,
                          "quality_threshold": 0.7,
                          "liveness_threshold": 0.7
                        },
                        "liveness_states": [ 1 ],
                        "estimate_deepfake": {
                          "estimate": 0,
                          "real_threshold": 0.7,
                          "mode": 2
                        },
                        "deepfake_states": [ 1 ]
                      },
                      "extract_policy": {
                        "extract_basic_attributes": 1,
                        "extract_face_descriptor": 1,
                        "fd_score_threshold": 0,
                        "extract_body_descriptor": 1
                      }
                    },
                    "handler_type": 0
                  }
              simple_all_policies_request_no_filters:
                summary: request with all policies without filters
                value:
                  {
                    "description": "second avenue",
                    "policies": {
                      "detect_policy": {
                        "estimate_people_count": {
                          "estimate": 1,
                          "people_coordinates": 1,
                        },
                        "detect_face": 1,
                        "detect_body": 1,
                        "multiface_policy": 1,
                        "estimate_head_pose": 1,
                        "estimate_emotions": 1,
                        "estimate_mask": 1,
                        "estimate_quality": 1,
                        "estimate_gaze": 1,
                        "estimate_glasses": 1,
                        "estimate_eyes_attributes": 1,
                        "estimate_mouth_attributes": 1,
                        "detect_landmarks68": 1,
                        "extract_exif": 1,
                        "yaw_threshold": 180,
                        "roll_threshold": 180,
                        "pitch_threshold": 180,
                        "mask_states": [
                            1
                        ],
                        "estimate_liveness": {
                          "estimate": 1,
                          "quality_threshold": 0.7,
                          "liveness_threshold": 0.7
                        },
                        "liveness_states": [ 1 ],
                        "estimate_deepfake": {
                          "estimate": 0,
                          "real_threshold": 0.7,
                          "mode": 2
                        },
                        "deepfake_states": [ 1 ],
                        "face_quality": {
                          "estimate": 1,
                          "filter": 0,
                          "checks": {
                            "image_format": {
                              "estimate": 1,
                              "threshold": [
                                  "JPEG",
                                  "JPEG2000",
                                  "PNG"
                              ]
                            },
                            "illumination_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.3,
                                "max": 1.0
                              }
                            },
                            "specularity_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.3,
                                "max": 1.0
                              }
                            },
                            "blurriness_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.61,
                                "max": 1.0
                              }
                            },
                            "dark_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "light_quality": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.57,
                                "max": 1.0
                              }
                            },
                            "head_yaw": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "head_pitch": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "head_roll": {
                              "estimate": 1,
                              "threshold": {
                                "min": -8,
                                "max": 8
                              }
                            },
                            "gaze_yaw": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "gaze_pitch": {
                              "estimate": 1,
                              "threshold": {
                                "min": -5,
                                "max": 5
                              }
                            },
                            "mouth_smiling": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.0,
                                "max": 0.5
                              }
                            },
                            "mouth_occluded": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.0,
                                "max": 0.5
                              }
                            },
                            "mouth_open": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.0,
                                "max": 0.5
                              }
                            },
                            "glasses": {
                              "estimate": 1,
                              "threshold": [
                                  "no_glasses",
                                  "eyeglasses"
                              ]
                            },
                            "left_eye": {
                              "estimate": 1,
                              "threshold": [
                                  "open"
                              ]
                            },
                            "right_eye": {
                              "estimate": 1,
                              "threshold": [
                                  "open"
                              ]
                            },
                            "head_horizontal_center": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.45,
                                "max": 0.55
                              }
                            },
                            "head_vertical_center": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.3,
                                "max": 0.5
                              }
                            },
                            "head_width": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.5,
                                "max": 0.75
                              }
                            },
                            "head_height": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.6,
                                "max": 0.9
                              }
                            },
                            "eye_distance": {
                              "estimate": 1,
                              "threshold": {
                                "min": 90,
                                "max": 1920
                              }
                            },
                            "image_width": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1920
                              }
                            },
                            "image_height": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1080
                              }
                            },
                            "aspect_ratio": {
                              "estimate": 1,
                              "threshold": {
                                "min": 0.74,
                                "max": 0.8
                              }
                            },
                            "face_width": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1920
                              }
                            },
                            "face_height": {
                              "estimate": 1,
                              "threshold": {
                                "min": 180,
                                "max": 1920
                              }
                            },
                            "indent_left": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "indent_right": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "indent_upper": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "indent_lower": {
                              "estimate": 1,
                              "threshold": {
                                "min": 20,
                                "max": 1920
                              }
                            },
                            "image_size": {
                              "estimate": 1,
                              "threshold": {
                                "min": 5120,
                                "max": 2097152
                              }
                            },
                            "eyebrows_state": {
                              "estimate": 1,
                              "threshold": [ "neutral" ]
                            },
                            "headwear_type": {
                              "estimate": 1,
                              "threshold": [ "none" ]
                            },
                            "smile_properties": {
                              "estimate": 1,
                              "threshold": [ "none" ]
                            },
                            "face_color_type": {
                              "estimate": 1,
                              "threshold": [ "color" ]
                            },
                            "natural_light": {
                              "estimate": 1,
                              "threshold": 1
                            },
                            "red_eyes": {
                              "estimate": 1,
                              "threshold": 0
                            },
                            "radial_distortion": {
                              "estimate": 1,
                              "threshold": 0
                            },
                            "illumination_uniformity": {
                              "estimate": 1,
                              "thershold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "dynamic_range": {
                              "estimate": 1,
                              "thershold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "background_uniformity": {
                              "estimate": 1,
                              "thershold": {
                                "min": 0.5,
                                "max": 1.0
                              }
                            },
                            "background_lightness": {
                              "estimate": 1,
                              "thershold": {
                                "min": 0.2,
                                "max": 1.0
                              }
                            },
                            "shoulders_position": {
                              "estimate": 1,
                              "thershold": ["parallel"]
                            }
                          }
                        }
                      },
                      "extract_policy": {
                        "extract_basic_attributes": 0,
                        "extract_face_descriptor": 1,
                        "fd_score_threshold": 0.1,
                        "extract_body_descriptor": 1
                      },
                      "storage_policy": {
                        "face_sample_policy": {
                          "store_sample": 1
                        },
                        "body_sample_policy": {
                          "store_sample": 1
                        },
                        "image_origin_policy": {
                          "store_image": 1
                        },
                        "attribute_policy": {
                          "store_attribute": 1
                        },
                        "face_policy": {
                          "store_face": 1,
                          "link_to_lists_policy": [
                            {
                              "list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                            }
                          ]
                        },
                        "event_policy": {
                          "store_event": 1
                        },
                        "notification_policy": {
                          "send_notification": 1
                        }
                      },
                      "conditional_tags_policy": [
                        {
                          "tag": "new_tag"
                        }
                      ]
                    },
                    "handler_type": 0
                  }
              events_set_as_matching_candidates:
                summary: events set as matching candidates
                value:
                  {
                    "description": "create faces based on recent events",
                    "policies": {
                      "extract_policy": {
                        "extract_basic_attributes": 0,
                        "extract_face_descriptor": 1,
                        "fd_score_threshold": 0,
                        "extract_body_descriptor": 0
                      },
                      "match_policy": [
                        {
                          "label": "recent events",
                          "candidates": {
                            "origin": "events",
                            "create_time__gte": "2018-08-11T09:11:41.674Z",
                            "top_similar_external_ids": [ "external_id_1" ]
                          },
                          "limit": 3,
                          "threshold": 0.6
                        }
                      ],
                      "storage_policy": {
                        "face_policy": {
                          "store_face": 1,
                          "filters": {
                            "match": [
                              {
                                "label": "recent events",
                                "similarity__lte": 0.85
                              }
                            ]
                          }
                        }
                      }
                    },
                    "handler_type": 0
                  }
      responses:
        201:
          description: Created.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  handler_id:
                    $ref: '#/components/schemas/uuid'
                  url:
                    type: string
                    format: uri-reference
                  external_url:
                    $ref: '#/components/schemas/external_url'
                required:
                  - handler_id
                  - url
                  - external_url
              example:
                handler_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /6/handlers/b5d6fd45-fcca-453d-ac05-3e594054b813
                external_url: http://127.0.0.1:5000/6/handlers/b5d6fd45-fcca-453d-ac05-3e594054b813
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id 'b5d6fd45-fcca-453d-ac05-3e594054b813' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
                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'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12027"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
        - handlers
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/handler_type'
        - $ref: '#/components/parameters/is_dynamic'
        - $ref: '#/components/parameters/description'
      summary: get handlers
      description: Get handlers by filters.
      operationId: getHandlers
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []

      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            params = {
                "description": "handler",
                "handler_type": 1,
                "page": 1,
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/handlers"

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getHandlers(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="handler",
                handlerType=0,
                page=1,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/handlers?description=handler&handler_type=1&page=2' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/HandlerInResponse'
              example:
                - handler_id: "de0846a8-09b2-4c6f-8175-99cfae98cf6b"
                  account_id: "3c3a83c2-c21e-4855-91b5-34e6b63fb12d"
                  description: "first handler"
                  policies:
                    detect_policy:
                      estimate_people_count:
                        estimate: 1
                        people_coordinates: 1
                      detect_face: 1
                      detect_body: 1
                      multiface_policy: 1
                      estimate_head_pose: 1
                      estimate_emotions: 1
                      estimate_mask: 1
                      estimate_quality: 1
                      estimate_gaze: 1
                      estimate_glasses: 1
                      estimate_eyes_attributes: 1
                      estimate_mouth_attributes: 1
                      detect_landmarks68: 1
                      extract_exif: 1
                      yaw_threshold: 180
                      roll_threshold: 180
                      pitch_threshold: 180
                      mask_states: [ 1 ]
                      estimate_liveness:
                        estimate: 1
                        quality_threshold: 0.7
                        liveness_threshold: 0.7
                      liveness_states: [ 1 ]
                      estimate_deepfake:
                        estimate: 1
                        real_threshold: 0.7
                        mode: 2
                      deepfake_states: [ 1 ]
                      face_quality:
                        estimate: 1
                        filter: 0
                        checks:
                          image_format:
                            estimate: 1
                            threshold: ["JPEG", "JPEG2000", "PNG"]
                          illumination_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          specularity_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          blurriness_quality:
                            estimate: 1
                            threshold:
                              min: 0.61
                              max: 1.0
                          dark_quality:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          light_quality:
                            estimate: 1
                            threshold:
                              min: 0.57
                              max: 0.9
                          head_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_roll:
                            estimate: 1
                            threshold:
                              min: -8
                              max: 8
                          gaze_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          gaze_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          mouth_smiling:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_occluded:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_open:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          glasses:
                            estimate: 1
                            threshold: ["no_glasses", "eyeglasses"]
                          left_eye:
                            estimate: 1
                            threshold: ["open"]
                          right_eye:
                            estimate: 1
                            threshold: ["open"]
                          head_horizontal_center:
                            estimate: 1
                            threshold:
                              min: 0.45
                              max: 0.55
                          head_vertical_center:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 0.5
                          head_width:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 0.75
                          head_height:
                            estimate: 1
                            threshold:
                              min: 0.6
                              max: 0.9
                          eye_distance:
                            estimate: 1
                            threshold:
                              min: 90
                              max: 1920
                          image_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          image_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1080
                          aspect_ratio:
                            estimate: 1
                            threshold:
                              min: 0.74
                              max: 0.8
                          face_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          face_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          indent_left:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_right:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_upper:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_lower:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          image_size:
                            estimate: 1
                            threshold:
                              min: 5120
                              max: 2097152
                          eyebrows_state:
                            estimate: 1
                            threshold: [ "neutral" ]
                          smile_properties:
                            estimate: 1
                            threshold: [ "none" ]
                          headwear_type:
                            estimate: 1
                            threshold: [ "none" ]
                          natural_light:
                            estimate: 1
                            threshold: 1
                          radial_distortion:
                            estimate: 1
                            threshold: 0
                          red_eyes:
                            estimate: 1
                            threshold: 0
                          face_color_type:
                            estimate: 1
                            threshold: [ "color" ]
                          illumination_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          dynamic_range:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          background_lightness:
                            estimate: 1
                            threshold:
                              min: 0.2
                              max: 1.0
                          background_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          shoulders_position:
                            estimate: 1
                            threshold:
                              - parallel

                      body_attributes:
                        estimate_basic_attributes: 0
                        estimate_upper_body: 0
                        estimate_lower_body: 0
                        estimate_accessories: 0
                    extract_policy:
                      extract_basic_attributes: 1
                      extract_face_descriptor: 1
                      fd_score_threshold: 0.6
                      extract_body_descriptor: 1
                    match_policy:
                      - label: "good guys"
                        candidates:
                          origin: "faces"
                          create_time__gte: "2018-08-11T09:11:41.674Z"
                          create_time__lt: "2022-08-11T09:11:41.674Z"
                        filters:
                          gender: 1
                          ethnicities: [ 4, 3 ]
                          age__lt: 50
                          age__gte: 22
                        limit: 3
                        targets: [ "face_id" ]
                        threshold: 0.5
                    storage_policy:
                      face_sample_policy:
                        store_sample: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                      body_sample_policy:
                        store_sample: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                      image_origin_policy:
                        store_image: 1
                        use_external_references: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                      attribute_policy:
                        store_attribute: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                        ttl: 300
                      face_policy:
                        store_face: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                        set_sample_as_avatar: 0
                        link_to_lists_policy:
                          - list_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                            filters:
                              gender: 1
                              ethnicities: [ 1 ]
                              age__lt: 0
                              age__gte: 0
                              match:
                                - label: "good guys"
                                  similarity__lte: 0.9
                                  similarity__gte: 0.9
                      event_policy:
                        store_event: 1
                        wait_saving: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                      notification_policy:
                        send_notification: 1
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                      callbacks:
                        - type: "http"
                          authorization:
                            type: "basic"
                            login: "username"
                            password: "password"
                          url: "http://127.0.0.1/"
                          params:
                            timeout: 5
                            content_type: "application/json"
                            headers: { }
                          filters:
                            gender: 1
                            ethnicities: [ 1 ]
                            age__lt: 0
                            age__gte: 0
                            match:
                              - label: "good guys"
                                similarity__lte: 0.9
                                similarity__gte: 0.9
                          enable: 1
                    conditional_tags_policy:
                      - tag: "new_tag"
                        filters:
                          gender: 1
                          ethnicities: [ 4, 3 ]
                          age__lt: 50
                          age__gte: 22
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.3
                  create_time: "2018-08-11T09:11:41.674Z"
                  last_update_time: "2018-08-11T09:11:41.674Z"
                  handler_type: 0

                - handler_id: "ff0be071-1fd6-4641-a780-b8a87a871ef8"
                  account_id: "3c3a83c2-c21e-4855-91b5-34e6b63fb12d"
                  create_time: "2020-05-19T13:09:47.414773+03:00"
                  last_update_time: "2020-05-19T13:09:47.414773+03:00"
                  description: "76919ac6-95d2-4349-a7e9-5637117cdd29"
                  policies:
                    detect_policy:
                      estimate_people_count:
                        estimate: 1
                        people_coordinates: 1
                      multiface_policy: 1
                      estimate_head_pose: 0
                      estimate_emotions: 0
                      estimate_mask: 0
                      estimate_quality: 0
                      estimate_gaze: 0
                      estimate_glasses: 1
                      estimate_eyes_attributes: 0
                      estimate_mouth_attributes: 0
                      detect_landmarks68: 0
                      extract_exif: 0
                      detect_face: 1
                      detect_body: 0
                      pitch_threshold: null
                      roll_threshold: null
                      yaw_threshold: null
                      mask_states: null
                      estimate_liveness:
                        estimate: 1
                        quality_threshold: 0.7
                        liveness_threshold: 0.7
                      liveness_states: [ 1 ]
                      estimate_deepfake:
                        estimate: 1
                        real_threshold: 0.7
                        mode: 2
                      deepfake_states: [ 1 ]
                      face_quality:
                        estimate: 1
                        filter: 0
                        checks:
                          image_format:
                            estimate: 1
                            threshold: ["JPEG", "JPEG2000", "PNG"]
                          illumination_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          specularity_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          blurriness_quality:
                            estimate: 1
                            threshold:
                              min: 0.61
                              max: 1.0
                          dark_quality:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          light_quality:
                            estimate: 1
                            threshold:
                              min: 0.57
                              max: 0.9
                          head_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_roll:
                            estimate: 1
                            threshold:
                              min: -8
                              max: 8
                          gaze_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          gaze_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          mouth_smiling:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_occluded:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_open:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          glasses:
                            estimate: 1
                            threshold: ["no_glasses", "eyeglasses"]
                          left_eye:
                            estimate: 1
                            threshold: ["open"]
                          right_eye:
                            estimate: 1
                            threshold: ["open"]
                          head_horizontal_center:
                            estimate: 1
                            threshold:
                              min: 0.45
                              max: 0.55
                          head_vertical_center:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 0.5
                          head_width:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 0.75
                          head_height:
                            estimate: 1
                            threshold:
                              min: 0.6
                              max: 0.9
                          eye_distance:
                            estimate: 1
                            threshold:
                              min: 90
                              max: 1920
                          image_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          image_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1080
                          aspect_ratio:
                            estimate: 1
                            threshold:
                              min: 0.74
                              max: 0.8
                          face_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          face_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          indent_left:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_right:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_upper:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_lower:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          image_size:
                            estimate: 1
                            threshold:
                              min: 5120
                              max: 2097152
                          eyebrows_state:
                            estimate: 1
                            threshold: [ "neutral" ]
                          smile_properties:
                            estimate: 1
                            threshold: [ "none" ]
                          headwear_type:
                            estimate: 1
                            threshold: [ "none" ]
                          natural_light:
                            estimate: 1
                            threshold: 1
                          radial_distortion:
                            estimate: 1
                            threshold: 0
                          red_eyes:
                            estimate: 1
                            threshold: 0
                          face_color_type:
                            estimate: 1
                            threshold: [ "color" ]
                          illumination_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          dynamic_range:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          background_lightness:
                            estimate: 1
                            threshold:
                              min: 0.2
                              max: 1.0
                          background_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          shoulders_position:
                            estimate: 1
                            threshold:
                              - parallel
                      body_attributes:
                        estimate_basic_attributes: 1
                        estimate_upper_body: 1
                        estimate_lower_body: 1
                        estimate_accessories: 1
                    extract_policy:
                      extract_basic_attributes: 0
                      fd_score_threshold: 0.0
                      extract_face_descriptor: 1
                      extract_body_descriptor: 0
                    match_policy: [ ]
                    conditional_tags_policy: [ ]
                    storage_policy:
                      face_sample_policy:
                        filters: { }
                        store_sample: 1
                      body_sample_policy:
                        filters: { }
                        store_sample: 1
                      image_origin_policy:
                        filters: { }
                        store_image: 0
                        use_external_references: 0
                      attribute_policy:
                        filters: { }
                        store_attribute: 0
                        ttl: 300
                      face_policy:
                        filters: { }
                        store_face: 0
                        set_sample_as_avatar: 1
                        link_to_lists_policy: [ ]
                      event_policy:
                        filters: { }
                        store_event: 1
                        wait_saving: 1
                      notification_policy:
                        filters: { }
                        send_notification: 1
                      callbacks: [ ]
                  handler_type: 0
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - handlers
      summary: handlers options
      description: Get options for the resource.
      operationId: getHandlersOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/handlers/count:
    get:
      tags:
        - handlers
      summary: get handler count
      description: Count handlers.
      operationId: getHandlerCount
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - in: query
          name: description
          schema:
            type: string
          description: Find all the handlers with description similar to this parameter.
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/handler_type'
        - $ref: '#/components/parameters/is_dynamic'
      x-codeSamples:
        - lang: python
          source: |
            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            params = {
                "description": "handler",
                "handler_type": 0,
            }

            url = f"{baseUri}/handlers/count"

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getHandlersCount(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="handler",
                handlerType=0,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/handlers/count?description=handler&handler_type=0' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers_count'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - handlers
      summary: handler count options
      description: Get options for the resource.
      operationId: getHandlersCountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/handlers/validator:
    post:
      tags:
        - handlers
      summary: validate handler policies
      description: Validate handler policies before using them to create or update a handler.
      operationId: validatePolicies
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            # create list
            payload = {"user_data": "list of good persons"}
            url = f"{baseUri}/lists"
            listId = requests.post(url, json=payload, headers=headers).json()["list_id"]

            policies = {
                "detect_policy": {
                    "estimate_emotions": 1,
                    "estimate_mask": 1,
                },
                "extract_policy": {
                    "extract_basic_attributes": 1,
                    "extract_face_descriptor": 1,
                    "fd_score_threshold": 0,
                },
                "match_policy": [
                    {
                        "label": "good guys",
                        "candidates": {
                            "origin": "faces",
                            "list_id": listId,
                        },
                        "filters": {"gender": 0},
                        "limit": 3,
                        "threshold": 0.5,
                    }
                ],
            }

            payload = {
                "policies": policies
            }

            url = f"{baseUri}/handlers/validator"
            response = requests.post(url, json=payload, headers=headers)

            print(response.status_code)

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                Policies,
                DetectPolicy,
                ExtractPolicy,
                MatchPolicy,
                MatchPolicyCandidates,
            )

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            policies = Policies(
                detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1),
                extractPolicy=ExtractPolicy(
                    extractBasicAttributes=1,
                    extractFaceDescriptor=1,
                    fdScoreThreshold=0.0,
                ),
                matchPolicy=[
                    MatchPolicy(
                        candidates=MatchPolicyCandidates(
                            origin="faces", listId=listId
                        ),
                        label="good guys",
                        limit=3,
                        threshold=0.5,
                        gender=0,
                    )
                ],
            )

            response = luna3client.validateHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                policies=policies,
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/handlers/validator' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "policies":{
                    "detect_policy": {
                        "estimate_emotions": 1,
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1,
                        "extract_face_descriptor": 1,
                        "fd_score_threshold": 0
                    },
                    "match_policy": [
                        {
                            "label": "good guys",
                            "candidates": {
                                "origin": "faces",
                                "list_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e"
                            },
                            "filters": {"gender": 0},
                            "limit": 3,
                            "threshold": 0.5
                        }
                    ]
                }
            }'
      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id 'b5d6fd45-fcca-453d-ac05-3e594054b813' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
                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'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - handlers
      summary: handler policies validator options
      description: Get options for the resource.
      operationId: getHandlersPoliciesValidatorOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

  /6/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
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create handler
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/handlers"
            payload = {"handler_type": 1}
            dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            # get handler
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="
            }
            url = f"{baseUri}/handlers/{dynamicHandlerId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            dynamicHandlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerType=1,
                raiseError=True,
            ).json["handler_id"]

            response = luna3client.getHandlerById(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerId=dynamicHandlerId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/handlers/fad2b0c4-75de-4507-a270-84665679c8fa' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HandlerInResponse'
              example:
                handler_id: "de0846a8-09b2-4c6f-8175-99cfae98cf6b"
                account_id: "3c3a83c2-c21e-4855-91b5-34e6b63fb12d"
                description: "first handler"
                policies:
                  detect_policy:
                    estimate_people_count:
                      estimate: 0
                    detect_face: 1
                    detect_body: 1
                    multiface_policy: 1
                    estimate_head_pose: 1
                    estimate_emotions: 1
                    estimate_mask: 1
                    estimate_quality: 1
                    estimate_gaze: 1
                    estimate_glasses: 1
                    estimate_eyes_attributes: 1
                    estimate_mouth_attributes: 1
                    detect_landmarks68: 1
                    extract_exif: 1
                    yaw_threshold: 180
                    roll_threshold: 180
                    pitch_threshold: 180
                    mask_states: [ 1 ]
                    estimate_liveness:
                      estimate: 1
                      quality_threshold: 0.7
                      liveness_threshold: 0.7
                    liveness_states: [1]
                    estimate_deepfake:
                      estimate: 1
                      real_threshold: 0.7
                      mode: 2
                    deepfake_states: [ 1 ]
                    face_quality:
                      estimate: 1
                      filter: 0
                      checks:
                        image_format:
                          estimate: 1
                          threshold: ["JPEG", "JPEG2000", "PNG"]
                        illumination_quality:
                          estimate: 1
                          threshold:
                            min: 0.3
                            max: 1.0
                        specularity_quality:
                          estimate: 1
                          threshold:
                            min: 0.3
                            max: 1.0
                        blurriness_quality:
                          estimate: 1
                          threshold:
                            min: 0.61
                            max: 1.0
                        dark_quality:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        light_quality:
                          estimate: 1
                          threshold:
                            min: 0.57
                            max: 0.9
                        head_yaw:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        head_pitch:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        head_roll:
                          estimate: 1
                          threshold:
                            min: -8
                            max: 8
                        gaze_yaw:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        gaze_pitch:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        mouth_smiling:
                          estimate: 1
                          threshold:
                            min: 0.0
                            max: 0.5
                        mouth_occluded:
                          estimate: 1
                          threshold:
                            min: 0.0
                            max: 0.5
                        mouth_open:
                          estimate: 1
                          threshold:
                            min: 0.0
                            max: 0.5
                        glasses:
                          estimate: 1
                          threshold: ["no_glasses", "eyeglasses"]
                        left_eye:
                          estimate: 1
                          threshold: ["open"]
                        right_eye:
                          estimate: 1
                          threshold: ["open"]
                        head_horizontal_center:
                          estimate: 1
                          threshold:
                            min: 0.45
                            max: 0.55
                        head_vertical_center:
                          estimate: 1
                          threshold:
                            min: 0.3
                            max: 0.5
                        head_width:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 0.75
                        head_height:
                          estimate: 1
                          threshold:
                            min: 0.6
                            max: 0.9
                        eye_distance:
                          estimate: 1
                          threshold:
                            min: 90
                            max: 1920
                        image_width:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1920
                        image_height:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1080
                        aspect_ratio:
                          estimate: 1
                          threshold:
                            min: 0.74
                            max: 0.8
                        face_width:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1920
                        face_height:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1920
                        indent_left:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        indent_right:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        indent_upper:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        indent_lower:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        image_size:
                          estimate: 1
                          threshold:
                            min: 5120
                            max: 2097152
                        eyebrows_state:
                          estimate: 1
                          threshold: [ "neutral" ]
                        smile_properties:
                          estimate: 1
                          threshold: [ "none" ]
                        headwear_type:
                          estimate: 1
                          threshold: [ "none" ]
                        natural_light:
                          estimate: 1
                          threshold: 1
                        radial_distortion:
                          estimate: 1
                          threshold: 0
                        red_eyes:
                          estimate: 1
                          threshold: 0
                        face_color_type:
                          estimate: 1
                          threshold: [ "color" ]
                        illumination_uniformity:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        dynamic_range:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        background_lightness:
                          estimate: 1
                          threshold:
                            min: 0.2
                            max: 1.0
                        background_uniformity:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        shoulders_position:
                          estimate: 1
                          threshold:
                            - parallel
                    body_attributes:
                      estimate_basic_attributes: 0
                      estimate_upper_body: 0
                      estimate_lower_body: 0
                      estimate_accessories: 0
                  extract_policy:
                    extract_basic_attributes: 1
                    extract_face_descriptor: 1
                    fd_score_threshold: 0.6
                    extract_body_descriptor: 1
                  match_policy:
                    - label: "good guys"
                      candidates:
                        origin: "faces"
                        create_time__gte: "2018-08-11T09:11:41.674Z"
                        create_time__lt: "2022-08-11T09:11:41.674Z"
                      filters:
                        gender: 1
                        ethnicities: [ 4, 3 ]
                        age__lt: 50
                        age__gte: 22
                      limit: 3
                      targets: [ "face_id" ]
                      threshold: 0.5
                  storage_policy:
                    face_sample_policy:
                      store_sample: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                    body_sample_policy:
                      store_sample: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                    image_origin_policy:
                      store_image: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                    attribute_policy:
                      store_attribute: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                      ttl: 300
                    face_policy:
                      store_face: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                      set_sample_as_avatar: 0
                      link_to_lists_policy:
                        - list_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                          filters:
                            gender: 1
                            ethnicities: [ 1 ]
                            age__lt: 0
                            age__gte: 0
                            match:
                              - label: "good guys"
                                similarity__lte: 0.9
                                similarity__gte: 0.9
                    event_policy:
                      store_event: 1
                      wait_saving: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                    notification_policy:
                      send_notification: 1
                      filters:
                        gender: 1
                        ethnicities: [ 1 ]
                        age__lt: 0
                        age__gte: 0
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.9
                    callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "username"
                          password: "password"
                        url: "http://127.0.0.1/"
                        params:
                          timeout: 5
                          content_type: "application/json"
                          headers: { }
                        filters:
                          gender: 1
                          ethnicities: [ 1 ]
                          age__lt: 0
                          age__gte: 0
                          match:
                            - label: "good guys"
                              similarity__lte: 0.9
                              similarity__gte: 0.9
                        enable: 1
                  conditional_tags_policy:
                    - tag: "new_tag"
                      filters:
                        gender: 1
                        ethnicities: [ 4, 3 ]
                        age__lt: 50
                        age__gte: 22
                        match:
                          - label: "good guys"
                            similarity__lte: 0.9
                            similarity__gte: 0.3
                create_time: "2018-08-11T09:11:41.674Z"
                last_update_time: "2018-08-11T09:11:41.674Z"
                handler_type: 0
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/handler_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    put:
      tags:
        - handlers
      summary: replace handler
      description: |
        Update handler. You cannot update a part of the handler, so you should specify all the fields for your handler.
      operationId: putHandler
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            # create handler
            url = f"{baseUri}/handlers"
            payload = {"handler_type": 1}
            handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            # replace handler
            policies = {
                "detect_policy": {
                    "estimate_emotions": 1,
                    "estimate_mask": 1,
                },
            }

            payload = {
                "description": "handler",
                "policies": policies,
                "handler_type": 0,
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/handlers/{handlerId}"
            response = requests.put(url, json=payload, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                Policies,
                DetectPolicy,
            )

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # create handler
            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerType=1,
                raiseError=True,
            ).json["handler_id"]

            # replace handler
            policies = Policies(
                detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1),
            )

            response = luna3client.updateHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerId=handlerId,
                policies=policies,
                handlerType=0,
                description="handler",
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PUT 'http://127.0.0.1:5000/6/handlers/a0e73adf-e00e-4caf-8cc7-f0bf91081969' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data ' {
                "description": "handler",
                "handler_type": 0,
                "policies" :{
                    "detect_policy":
                    {
                        "estimate_emotions": 1,
                        "estimate_mask": 1
                    }
                }
            }'
      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                list_not_found:
                  value:
                    error_code: 22003
                    desc: Object not found
                    detail: List with id 'b5d6fd45-fcca-453d-ac05-3e594054b813' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22003"
                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'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/handler_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      tags:
        - handlers
      summary: check if handler exists
      description: Check if handler with `handler_id` exists.
      operationId: checkHandler
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/handlers"

            payload = {"handler_type": 1}
            dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/handlers/{dynamicHandlerId}"
            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            dynamicHandlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerType=1,
                raiseError=True,
            ).json["handler_id"]

            response = luna3client.checkHandlerById(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerId=dynamicHandlerId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --head 'http://127.0.0.1:5000/6/handlers/fad2b0c4-75de-4507-a270-84665679c8fa' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: OK.
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Handler not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'

    delete:
      tags:
        - handlers
      summary: remove handler
      description: Remove handler by ID.
      operationId: removeHandler
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/handlers"

            payload = {"handler_type": 1}
            dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/handlers/{dynamicHandlerId}"
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            dynamicHandlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="dynamic_handler",
                handlerType=1,
                raiseError=True,
            ).json["handler_id"]

            response = luna3client.deleteHandlerById(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                handlerId=dynamicHandlerId,
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/handlers/fad2b0c4-75de-4507-a270-84665679c8fa' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        204:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: The resource was deleted successfully.
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          description: Handler not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 11033
                desc: Object not found
                detail: Handler not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11033"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - handlers
      summary: handler options
      description: Get options for the resource.
      operationId: getHandlerOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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: |
        Process images and/or raw descriptors using the specified handler and generate events.

        Specify the `multipart/form-data` schema if you need to specify the dynamic handler policies.

        If the Events service support is disabled on the server, events will not be saved to the database.

        Notes for incoming data:
          - set the image detection time, if necessary, otherwise it will be equal to the request time.
          - face or body *bounding boxes* passed with face or body warped image will presented as sample detection rect
            in generated event.
        
        Objects to be processed must belong to the user account making the request.

      operationId: generateEvents
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $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/multiple_data_content_type'
        - in: query
          name: external_id
          schema:
            $ref: '#/components/schemas/event_external_id'
          description: |
            External ID for created events and faces (if `store_face` is enabled in handler).

            When Unicode symbols (for example, the "+" symbol) are used in "external_id", the string should be encoded.
            Otherwise, the Unicode symbols will be lost. The "luna3" client library provides the encoding example
        - in: query
          name: user_data
          schema:
            $ref: '#/components/schemas/face_user_data'
          description: User data for created events and faces (if `store_face` is enabled in handler).
        - $ref: '#/components/parameters/image_type'
        - $ref: '#/components/parameters/aggregate_attributes_events'
        - $ref: '#/components/parameters/source'
        - $ref: '#/components/parameters/stream_id'
        - $ref: '#/components/parameters/tags'
        - $ref: '#/components/parameters/track_id'
        - $ref: '#/components/parameters/use_exif_info'

      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import json

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            # create list
            payload = {"user_data": "list of good persons"}
            url = f"{baseUri}/lists"
            listId = requests.post(url, json=payload, headers=headers).json()["list_id"]

            policies = {
                "detect_policy": {
                    "estimate_emotions": 1,
                    "estimate_mask": 1,
                },
                "extract_policy": {
                    "extract_basic_attributes": 1,
                    "extract_face_descriptor": 1,
                    "fd_score_threshold": 0,
                },
                "match_policy": [
                    {
                        "label": "good guys",
                        "candidates": {
                            "origin": "faces",
                            "list_id": listId,
                        },
                        "filters": {"gender": 0},
                        "limit": 3,
                        "threshold": 0.5,
                    }
                ],
            }
            url = f"{baseUri}/handlers"

            # For non-dynamic handler case:
            payload = {
                "description": "non_dynamic_handler",
                "policies": policies,
                "handler_type": 0,
            }
            handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            # For dynamic handler case:
            payload = {
                "description": "dynamic_handler",
                "handler_type": 1,
            }
            dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            # emit event
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            params = {"city": "New York", "district": "Midtown", "track_id": "There_and_Back_Again"}

            # For non-dynamic handler case:
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
                "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
                "Luna-Event-End-Time": "2020-10-10T09:11:42.555Z",
            }
            eventUrl = f"{url}/{handlerId}/events"
            responseFirst = requests.post(
                eventUrl,
                headers=headers,
                data=image,
                params=params,
            )

            print(responseFirst.status_code)
            print(responseFirst.json())

            # For dynamic handler case:
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
                "Luna-Event-End-Time": "2020-10-10T09:11:42.555Z",
            }
            files = {
                "image": ("image.jpg", image, "image/jpeg"),
                "policies": (
                    "policies",
                    json.dumps(policies),
                    "application/json",
                ),
            }
            eventUrl = f"{url}/{dynamicHandlerId}/events"
            responseSecond = requests.post(
                eventUrl,
                headers=headers,
                files=files,
                params=params,
            )

            print(responseSecond.status_code)
            print(responseSecond.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                Policies,
                DetectPolicy,
                ExtractPolicy,
                MatchPolicy,
                MatchPolicyCandidates,
                BinaryImage,
            )
            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(
                raiseError=True, userData="list of good persons"
            ).json["list_id"]
            policies = Policies(
                detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1),
                extractPolicy=ExtractPolicy(
                    extractBasicAttributes=1,
                    extractFaceDescriptor=1,
                    fdScoreThreshold=0.0,
                ),
                matchPolicy=[
                    MatchPolicy(
                        candidates=MatchPolicyCandidates(
                            origin="faces", listId=listId
                        ),
                        label="good guys",
                        limit=3,
                        threshold=0.5,
                        gender=0,
                    )
                ],
            )

            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="test_handler",
                policies=policies,
                raiseError=True,
            ).json["handler_id"]

            response = luna3client.emitEvents(
                handlerId=handlerId,
                inputData=[
                    BinaryImage("image.jpg"),
                ],
                city="New York",
                district="Midtown",
                meta= { "foo" : "bar"},
                trackId="There_and_Back_Again",
                lunaEventTime="2020-10-10T09:11:41.674Z",
                lunaEventEndTime="2020-10-10T09:11:42.555Z",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/handlers/fad2b0c4-75de-4507-a270-84665679c8fa/events?city=New%20York&district=Midtown&track_id=There_and_Back_Again' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: multipart/form-data' \
            --header 'Luna-Event-Time: "2020-10-10T09:11:41.674Z"' \
            --header 'Luna-Event-End-Time: "2020-10-10T09:11:42.555Z"' \
            --form 'image=@image.jpg' \
            --form 'policies={"detect_policy": {"estimate_emotions": 1, "estimate_mask": 1},  "extract_policy": {"extract_basic_attributes": 1,"extract_face_descriptor": 1, "fd_score_threshold": 0}, "match_policy": [{"label": "good guys", "candidates": {"origin": "faces", "list_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e"}, "filters": {"gender": 0}, "limit": 3,"threshold": 0.5}]}'
        - lang: bash
          source: |
            # Example of processing an image in base64 format and dynamic handler

            curl --location --request POST 'http://127.0.0.1:5000/6/handlers/fad2b0c4-75de-4507-a270-84665679c8fa/events' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: multipart/form-data' \
            --form 'image=@base64.txt;type=image/x-jpeg-base64;filename=image.jpg' \
            --form 'policies={
                "detect_policy": {
                  "detect_face": 1,
                  "face_quality": {
                    "estimate": 1
                  }
                },
                "extract_policy": {
                  "extract_basic_attributes": 1,
                  "extract_face_descriptor": 1
                },
                "storage_policy": {
                  "face_policy": {
                    "store_face": 1
                  },
                  "image_origin_policy": {
                    "store_image": 1
                  }
                }
              }'
      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:
              type: string
              format: binary
          application/x-vl-xpk:
            schema:
              type: string
              format: binary
          image/x-jpeg-base64:
            schema:
              type: string
              format: base64
          image/x-png-base64:
            schema:
              type: string
              format: base64
          image/x-bmp-base64:
            schema:
              type: string
              format: base64
          image/x-tiff-base64:
            schema:
              type: string
              format: base64
          image/x-portable-pixmap-base64:
            schema:
              type: string
              format: base64
          application/x-sdk-descriptor-base64:
            schema:
              type: string
              format: byte
          application/x-vl-xpk-base64:
            schema:
              type: string
              format: byte
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/multipart_raw_data_schema_with_policies'
          application/json:
            schema:
              $ref: '#/components/schemas/emit_event_json_request_body'
        required: true
      responses:
        201:
          $ref: '#/components/responses/generate_event_success_response'
        400:
          $ref: '#/components/responses/generate_events_bad_input_data'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/generate_events_access_errors'
        404:
          description: Handler not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11033"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - events
      summary: generate events options
      description: Get options for the resource.
      operationId: generateEventsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/handlers/{handler_id}/stream_events:
    parameters:
      - in: path
        name: handler_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: Handler ID.
    post:
      tags: [ events ]
      summary: generate stream events (beta)
      description: |
        **WARNING** Experimental resource. Backwards compatibility is not guaranteed.
        
        Process images using the specified handler and generate stream events.

        If the Events service support is disabled on the server, events will not be saved to the database.

        Notes for incoming data:
          - set the image detection time, if necessary, otherwise it will be equal to the request time.
          - face or body *bounding boxes* passed with face or body warped image will presented as sample detection rect
            in generated event.
        
        Objects to be processed must belong to the user account making the request.

      operationId: generateStreamEvents
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/msgpack_content'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            import msgpack
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            
            policies = {
                "detect_policy": {
                    "estimate_emotions": 1,
                    "estimate_mask": 1,
                },
                "extract_policy": {
                    "extract_basic_attributes": 1,
                    "extract_face_descriptor": 1
                }
            }
            url = f"{baseUri}/handlers"
            
            payload = {
                "description": "non_dynamic_handler",
                "policies": policies,
                "handler_type": 0,
            }
            handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]
            
            # emit event
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()
            
            params = {"city": "New York", "district": "Midtown", "track_id": "There_and_Back_Again"}
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "application/msgpack",
                "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
                "Luna-Event-End-Time": "2020-10-10T09:11:42.555Z",
            }
            eventUrl = f"{url}/{handlerId}/stream_events"
            
            payload = {
                "aggregate_attributes": 0,
                "sources": [
                    {
                        "detect_time": "2023-11-29T10:48:14.741Z",
                        "filename": "filename_267.jpg",
                        "source": [
                            {"body": {"bounding_box": {"height": 468, "width": 96, "x": 1824, "y": 294}, "warp": image},
                             "source_data": {
                                 "event_end_time": "2023-11-29T10:48:14.741Z",
                                 "event_time": "2023-11-29T10:48:14.741Z",
                                 "location": {
                                     "area": "Central",
                                     "city": "Moscow",
                                     "district": "Basmanny",
                                     "geo_position": {"latitude": 55.752, "longitude": 36.616},
                                     "house_number": "23 bldg.3",
                                     "street": "Podsosensky lane",
                                 },
                                 "source": "Source 0",
                                 "stream_id": "319d711e-6148-4c55-9eed-094b7e535fe7",
                                 "track_id": "8d57654a-3905-4326-8db6-dcf8000000a3",
                                 "user_data": "",
                             }
                             }
                        ],
                        "source_type": "detections",
                    }
                ],
                "use_exif_info": 1,
            }
            response = requests.post(
                eventUrl,
                headers=headers,
                data=msgpack.packb(payload),
                params=params,
            )
            
            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library
            
            from uuid import uuid4
            
            from luna3.common.http_objs import (
                Policies,
                DetectPolicy,
                ExtractPolicy,
                BinaryImage,
            )
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.handlers.http_objs import StreamEventsSource, StreamEventSourceNonAggregated, NonAggregatedRawImage
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            
            policies = Policies(
                detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1),
                extractPolicy=ExtractPolicy(
                    extractBasicAttributes=1,
                    extractFaceDescriptor=1
                ),
            )
            
            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="test_handler",
                policies=policies,
                raiseError=True,
            ).json["handler_id"]
            
            rawImageSource = StreamEventSourceNonAggregated(
                        sourceType="raw_image", source=NonAggregatedRawImage(body=BinaryImage("image.jpg").body), filename=str(uuid4())
                    )
            
            response = luna3client.emitStreamEvents(
                handlerId=handlerId,
                inputData=StreamEventsSource(aggregateAttributes=0, sources=[rawImageSource]),
                raiseError=True,
            )
            
            print(response.statusCode)
            print(response.json)

      requestBody:
        content:
          application/msgpack:
            schema:
              $ref: '#/components/schemas/stream_event_request_body'
            examples:
              detections:
                summary: detections without aggregation
                value:
                  {
                    "aggregate_attributes": 0,
                    "sources": [
                      {
                        "detect_time": "2023-11-29T10:48:14.741Z",
                        "filename": "filename_267.jpg",
                        "source": [
                          { "body": { "bounding_box": { "height": 468, "width": 96, "x": 1824, "y": 294 }, "warp": image_bytes },
                            "source_data": {
                              "event_end_time": "2023-11-29T10:48:14.741Z",
                              "event_time": "2023-11-29T10:48:14.741Z",
                              "location": {
                                "area": "Central",
                                "city": "Moscow",
                                "district": "Basmanny",
                                "geo_position": { "latitude": 55.752, "longitude": 36.616 },
                                "house_number": "23 bldg.3",
                                "street": "Podsosensky lane",
                              },
                              "source": "Source 0",
                              "stream_id": "319d711e-6148-4c55-9eed-094b7e535fe7",
                              "track_id": "8d57654a-3905-4326-8db6-dcf8000000a3",
                              "user_data": ""
                            }
                          }
                        ],
                        "source_type": "detections"
                      }
                    ],
                    "use_exif_info": 1,
                  }
              raw_images:
                summary: raw images with aggregation
                value:
                  {
                    "aggregate_attributes": 1,
                    "source_data": {
                      "event_end_time": "2023-11-29T10:48:14.741Z",
                      "event_time": "2023-11-29T10:48:14.741Z",
                      "location": {
                        "area": "Central",
                        "city": "Moscow",
                        "district": "Basmanny",
                        "geo_position": { "latitude": 55.752, "longitude": 36.616 },
                        "house_number": "23 bldg.3",
                        "street": "Podsosensky lane",
                      },
                      "source": "Source 0",
                      "stream_id": "319d711e-6148-4c55-9eed-094b7e535fe7",
                      "track_id": "8d57654a-3905-4326-8db6-dcf8000000a3",
                      "user_data": "",
                    },
                    "sources": [
                      {
                        "source": { "body": image_bytes },
                        "source_type": "raw_image",
                      },
                      {
                        "source": { "body": image_bytes2 },
                        "source_type": "raw_image",
                      }
                    ],
                    "use_exif_info": 1,
                  }
              detections_and_raw_images:
                summary: detections and raw images in one request
                value:
                  {
                    "aggregate_attributes": 0,
                    "sources": [
                      {
                        "source": { "body": image_bytes },
                        "source_type": "raw_image",
                      },
                      {
                        "source": { "body": image_bytes,
                                    "source_data": {
                                      "event_end_time": "2023-11-29T10:48:14.741Z",
                                      "event_time": "2023-11-29T10:48:14.741Z",
                                      "location": {
                                        "area": "Central",
                                        "city": "Moscow",
                                        "district": "Basmanny",
                                        "geo_position": { "latitude": 55.752, "longitude": 36.616 },
                                        "house_number": "23 bldg.3",
                                        "street": "Podsosensky lane",
                                      },
                                      "source": "Source 0",
                                      "stream_id": "319d711e-6148-4c55-9eed-094b7e535fe7",
                                      "track_id": "8d57654a-3905-4326-8db6-dcf8000000a3",
                                      "user_data": "",
                                    },
                        },
                        "source_type": "raw_image",
                      },
                      {
                        "source": [
                          {
                            "body": { "bounding_box": { "height": 468, "width": 96, "x": 1824, "y": 294 }, "warp": image_bytes },
                          }
                        ],
                        "source_type": "detections"
                      }
                    ],
                    "use_exif_info": 1,
                  }



        required: true
      responses:
        201:
          $ref: '#/components/responses/generate_event_success_response'
        400:
          $ref: '#/components/responses/generate_events_bad_input_data'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/generate_events_access_errors'
        404:
          description: Handler not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11033"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'


    options:
      tags:
        - events
      summary: generate stream events options
      description: Get options for the resource.
      operationId: generateStreamEventsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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 events were
        generated an `external handler`. Handler ID must belong to a dynamic handler.
      operationId: saveEvent
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/wait_raw_event_saving'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"
            url = f"{baseUri}/handlers"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            # Create dynamic handler
            payload = {
                "description": "dynamic_handler",
                "handler_type": 1,
            }
            dynamicHandlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            # Save event with custom payload
            payload = {
                "face_attributes": {
                    "basic_attributes": {
                        "age": 29,
                        "gender": 1,
                        "ethnicities": {
                            "predominant_ethnicity": "asian",
                            "estimations": {
                                "african_american": 1.92238889737406e-12,
                                "asian": 0.954671621322632,
                                "caucasian": 0.045328326523304,
                                "indian": 7.65100649502415e-10
                            }
                        }
                    },
                },
                "user_data": "event user data"
            }
            eventUrl = f"{url}/{dynamicHandlerId}/events/raw"

            response = requests.post(eventUrl, json=payload, headers=headers)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create dynamic handler
            response = luna3client.createHandler(
                description="dynamic_handler",
                handlerType=1,
                raiseError=True,
            )
            dynamicHandlerId = response.json["handler_id"]

            # Save event with custom payload
            event = {
                "face_attributes": {
                    "basic_attributes": {
                        "age": 29,
                        "gender": 1,
                        "ethnicities": {
                            "predominant_ethnicity": "asian",
                            "estimations": {
                                "african_american": 1.92238889737406e-12,
                                "asian": 0.954671621322632,
                                "caucasian": 0.045328326523304,
                                "indian": 7.65100649502415e-10
                            }
                        }
                    },
                },
                "user_data": "event user data"
            }
            response = luna3client.saveEvent(handlerId=dynamicHandlerId, event=event, raiseError=True)

            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/handlers/fad2b0c4-75de-4507-a270-84665679c8fa/events/raw' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
              "face_attributes": {
                "basic_attributes": {
                  "age": 29,
                  "gender": 1,
                  "ethnicities": {
                    "predominant_ethnicity": "asian",
                    "estimations": {"african_american": 1.92238889737406e-12, "asian": 0.954671621322632, "caucasian": 0.045328326523304, "indian": 7.65100649502415e-10}
                  }
                }
              },
              "user_data": "event user data"
            }'

      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'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Location:
              schema:
                type: string
                format: uri-reference
                example: /6/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'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Location:
              schema:
                type: string
                format: uri-reference
                example: /6/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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_input_data:
                  value:
                    error_code: 11027
                    desc: Bad/incomplete input data
                    detail: "Failed to validate input json. Path: 'source',  message: 'str type expected'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          description: Object not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                handler_not_found:
                  value:
                    error_code: 11033
                    desc: Object not found
                    detail: Handler with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11033"
                face_not_found:
                  value:
                    error_code: 22002
                    desc: Object not found
                    detail: Face with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22002"
                attributes_not_found:
                  value:
                    error_code: 22011
                    desc: Object not found
                    detail: Attributes with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-22011"
                sample_not_found:
                  value:
                    error_code: 11031
                    desc: Object not found
                    detail: Sample with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11031"
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - events
      summary: save event options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/events/statistic:
    post:
      tags:
        - events
      summary: get statistics on events
      description: |
        Get event statistics by target(s) with applied filters.

        Event fields and/or functions (count, min, etc.) can be set as targets for aggregation of events.

        Grouping by frequency or grouping by time intervals is available.
      operationId: getEventStats
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            eventQuery = {
                "targets": [
                    {"column": "city"},
                    {"column": "district"},
                    {"column": "track_id"},
                    {"column": "event_id"},
                    {"column": "gender", "aggregator": "avg"},
                    {"column": "emotion", "aggregator": "max"},
                ],
                "filters": [
                    {
                        "column": "emotion",
                        "operator": "in",
                        "value": [1, 2, 3, 4, 5, 6, 7],
                    },
                ],
                "period": [
                    {"operator": "lte", "value": "now-5m"},
                ],
                "group_by": "dayOfWeek",
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/events/statistic"
            response = requests.post(url, headers=headers, json=eventQuery)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import StatQuery
            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            statQuery = StatQuery().addGroupBy("dayOfWeek")
            statQuery.addTarget(column="city")
            statQuery.addTarget(column="district")
            statQuery.addTarget(column="track_id")
            statQuery.addTarget(column="event_id")
            statQuery.addTarget(column="gender", aggregator="avg")
            statQuery.addTarget(column="emotion", aggregator="max")
            statQuery.addFilter(
                column="emotion", operator="in", value=[1, 2, 3, 4, 5, 6, 7]
            )
            statQuery.addPeriod(operator="lte", value="now-5m")

            response = luna3client.getEventsStats(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                query=statQuery,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/events/statistic' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                        "targets": [
                            {"column": "city"},
                            {"column": "district"},
                            {"column": "track_id"},
                            {"column": "event_id"},
                            {"column": "gender", "aggregator": "avg"},
                            {"column": "emotion", "aggregator": "max"}
                        ],
                        "filters": [
                            {"column": "emotion", "operator": "in", "value": [1, 2, 3, 4, 5, 6, 7]}
                        ],
                        "period": [
                            {"operator": "lte", "value": "now-5m"}
                        ],
                        "group_by": "dayOfWeek"
                    }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/get_event_stats'
            example:
              targets:
                - column: event_id
                  aggregator: count
                - column: age
                  aggregator: group_by
                - column: gender
                  aggregator: group_by
              filters:
                - column: source
                  operator: eq
                  value: Main_hall_camera
              period:
                - operator: gt
                  value: 2020-02-04T00:00:00Z
                - operator: lt
                  value: 2020-02-06T00:00:00Z
              group_by: dayOfWeek
        required: true
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  fields:
                    type: array
                    items:
                      type: string
                    description: |
                      Response has the following structure:
                      - The first element of the list is `Group by time` section if request includes time or frequency grouping;
                      - The next elements are fields with the `group_by` function set;
                      - Other elements are pairs of columns and aggregators for the columns.

                      The fields and functions pairs in the "fields" section are in the same order as in the "stats" section.
                  stats:
                    type: array
                    description: Grouped values array.
                    items:
                      type: array
                      items:
                        description: |
                          Grouped values. Value order is corresponding to order of request targets order.
                        nullable: true
                        anyOf:
                          - type: integer
                          - type: number
                          - type: string
                      minItems: 1

              examples:
                count_dayOfWeek:
                  value:
                    fields:
                      - "Group by time: dayOfWeek"
                      - "gender, aggregator 'group_by'"
                      - "age, aggregator 'group_by'"
                      - "event_id, aggregator 'count'"
                    stats:
                      - - Tuesday
                        - 0
                        - 22
                        - 45
                      - - Tuesday
                        - 0
                        - 27
                        - 23
                      - - Tuesday
                        - 1
                        - 27
                        - 45
                      - - Wednesday
                        - 0
                        - 25
                        - 34
                      - - Wednesday
                        - 1
                        - 33
                        - 345

        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_events_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        422:
          description: Unprocessable.
          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:
                cannot_cast_jsonb:
                  value:
                    error_code: 10020
                    desc: Database error
                    detail: |
                      SQL request execution failed due to incompatible user-defined filters: cannot cast jsonb string to type integer
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-10020"
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - events
      summary: events statistics options
      description: Get options for the resource.
      operationId: geteEventsStatisticsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/events:
    get:
      tags:
        - events
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/get_event_target'
        - $ref: '#/components/parameters/create_time__gte'
        - $ref: '#/components/parameters/create_time__lt'
        - $ref: '#/components/parameters/end_time__gte'
        - $ref: '#/components/parameters/end_time__lt'
        - $ref: '#/components/parameters/sources_nullable'
        - $ref: '#/components/parameters/stream_ids_nullable'
        - $ref: '#/components/parameters/cities_nullable'
        - $ref: '#/components/parameters/areas_nullable'
        - $ref: '#/components/parameters/districts_nullable'
        - $ref: '#/components/parameters/streets_nullable'
        - $ref: '#/components/parameters/house_numbers_nullable'
        - $ref: '#/components/parameters/origin_longitude_nullable'
        - $ref: '#/components/parameters/origin_latitude_nullable'
        - $ref: '#/components/parameters/longitude_delta'
        - $ref: '#/components/parameters/latitude_delta'
        - $ref: '#/components/parameters/top_matching_candidates_label'
        - $ref: '#/components/parameters/top_similar_object_ids'
        - $ref: '#/components/parameters/top_similar_external_ids'
        - $ref: '#/components/parameters/top_similar_object_similarity__gte'
        - $ref: '#/components/parameters/top_similar_object_similarity__lt'
        - $ref: '#/components/parameters/age__lt'
        - $ref: '#/components/parameters/age__gte'
        - $ref: '#/components/parameters/gender_nullable'
        - $ref: '#/components/parameters/emotions_nullable'
        - $ref: '#/components/parameters/masks_nullable'
        - $ref: '#/components/parameters/ethnic_groups_nullable'
        - $ref: '#/components/parameters/liveness_nullable'
        - $ref: '#/components/parameters/deepfake_nullable'
        - $ref: '#/components/parameters/apparent_gender_nullable'
        - $ref: '#/components/parameters/apparent_age__gte'
        - $ref: '#/components/parameters/apparent_age__lt'
        - $ref: '#/components/parameters/headwear_states_nullable'
        - $ref: '#/components/parameters/headwear_colors_nullable'
        - $ref: '#/components/parameters/sleeve_lengths_nullable'
        - $ref: '#/components/parameters/upper_clothing_colors_nullable'
        - $ref: '#/components/parameters/lower_garment_colors_nullable'
        - $ref: '#/components/parameters/lower_garment_types_nullable'
        - $ref: '#/components/parameters/shoes_colors_nullable'
        - $ref: '#/components/parameters/backpack_states_nullable'
        - $ref: '#/components/parameters/face_ids'
        - $ref: '#/components/parameters/event_ids'
        - $ref: '#/components/parameters/event_id__gte_sorting'
        - $ref: '#/components/parameters/event_id__lt_sorting'
        - $ref: '#/components/parameters/handler_ids'
        - $ref: '#/components/parameters/external_ids'
        - $ref: '#/components/parameters/user_data'
        - $ref: '#/components/parameters/tags'
        - $ref: '#/components/parameters/track_ids_nullable'
        - $ref: '#/components/parameters/meta'
        - $ref: '#/components/parameters/order'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'

      summary: get events
      description: |
        Get events that satisfy filters.

        Default filters for events:

          - `create_time__lt` - current date and time
          - `create_time__gte` - current date and time minus month

          > **Default filters are not used if any of the following parameters are defined**:

            - list of event IDs (`event_ids`)
            - lower event ID boundary (`event_id__gte`)
            - upper event ID boundary (`event_id__lt`)
            - lower create time boundary (`create_time__gte`)
            - upper create time boundary (`create_time__lt`)

        The `target` parameter determines field that will be shown for each event. If target is not set, the response will contain all the fields.
      operationId: getEvents
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            params = {
                "age__lt": 90,
                "cities": "New York,Moscow",
                "track_ids": "There_and_Back_Again,Around_the_World",
                "emotions": "3,4,5,6,7",
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/events"

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getEvents(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                ageLt=90,
                cities=["New York", "Moscow"],
                trackIds=["There_and_Back_Again", "Around_the_World"],
                emotions=[3, 4, 5, 6, 7],
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/events?age__lt=90&gender=0&cities=New%20York,Moscow&track_ids=There_and_Back_Again,Around_the_World&emotions=3,4,5,6,7' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/event_list'
              example:
                events:
                  - create_time: "2020-10-11T09:11:41.674Z"
                    end_time: "2020-10-11T09:11:42.674Z"
                    event_id: "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8"
                    handler_id: "791f002e-919c-459d-b766-cba9f4130853"
                    face_id: "e88b8804-fedb-4dc3-8a59-171caf416571"
                    account_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                    external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                    source: "3rd Avenue"
                    stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                    top_match:
                      face_id: "a3cd6fd9-75c2-47aa-b2cc-82d6f9792072"
                      similarity: 0.67
                      label: "good guys"
                      external_id: "external_id_1"
                    match_result:
                      - candidates:
                          - event:
                              event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                              create_time: "2018-08-11T09:11:41.674Z"
                              external_id: null
                              user_data: "user data"
                              handler_id: null
                              source: "cam_1"
                              stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                            similarity: 0.63
                        label: "good guy"
                    face_detections:
                      - sample_id: "a3e8716f-70dc-42ad-8428-7a552e800a37"
                        detection:
                          rect:
                            height: 240
                            width: 209
                            x: 170
                            y: 198
                        detect_time: "2020-10-11T09:11:41.674Z"
                        detect_ts: 123.456
                        image_origin: null
                    body_detections:
                      - sample_id: "a3e8716f-70dc-42ad-8428-7a552e800a37"
                        detect_time: "2020-10-11T09:11:41.674Z"
                        detect_ts: 123.456
                        image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                    attach_result: [ "24d405ce-bc56-4bf7-98e1-bdc962b4cf34", "6d037c33-31ec-4d73-b3b3-ec80b09446c2" ]
                    gender: 1
                    age: 27
                    emotion: 5
                    mask: 1
                    ethnic_group: 3
                    tags: [ "good_event" ]
                    user_data: "people are strange"
                    location:
                      city: "New York"
                      area: "Manhattan"
                      district: null
                      street: "West 48th street"
                      house_number: "220"
                      geo_position:
                        latitude: -73.9906401596
                        longitude: 40.7627248564
                    track_id: "e3ed4e18-2983-418d-879a-825e4517fc6c"
                    liveness: 1
                    deepfake: 1
                    body_basic_attributes:
                      apparent_age: 25
                      apparent_gender: 0
                    upper_body:
                      headwear:
                        state: 0
                        apparent_color: undefined
                      sleeve:
                        length: short
                      upper_clothing:
                        colors: [ white, black ]
                    lower_body:
                      lower_garment:
                        type: trousers
                        colors: [ white, black ]
                      shoes:
                        apparent_color: black
                    accessories:
                      backpack:
                        state: 0
                    meta:
                      foo: "bar"
                  - account_id: "e3ed4e18-2983-418d-879a-825e4517fc6c"
                    create_time: "2021-06-18T21:27:47.500116+03:00"
                    end_time: "2021-06-18T21:27:47.500116+03:00"
                    event_id: "2a7b475f-047a-442f-903f-eb0f632a5f25"
                    external_id: "5d169198-7999-41bc-8233-6f2e752c2b1a"
                    handler_id: "c79134a3-6395-432d-90a1-e877588a9c8f"
                    source: "Zhang_Ziyi"
                    face_id: "665bb0b9-c3d9-400b-86ab-31375e55405a"
                    gender: 0
                    age: 27
                    emotion: 4
                    mask: 3
                    ethnic_group: 3
                    user_data: "Zhang_Ziyi"
                    track_id: "42104c78-8983-4ab8-a2ac-24653a7ce66d"
                    attach_result: [ "35c01353-a71b-4f55-844d-2b4a001f4c5f" ]
                    tags: [ "Rihanna", "Top_model" ]
                    face_detections:
                      - sample_id: "67487758-fa42-4913-81e1-3750a4a45657"
                        detect_time: "2021-06-18T21:27:47.500116+03:00"
                        detect_ts: 123.456
                        image_origin: null
                        detection:
                          rect:
                            x: 228
                            y: 200
                            width: 413
                            height: 522
                    body_detections: null
                    location:
                      city: "New York"
                      area: "Manhattan"
                      district: "unknown"
                      street: null
                      house_number: null
                      geo_position:
                        latitude: -73.9906401596
                        longitude: 40.7627248564
                    match_result:
                      - label: "11f14560-25c6-4727-b096-7e52a973e350"
                        candidates:
                          - similarity: 0.1134187654
                            face:
                              face_id: "af836e01-7f0a-467d-9f91-e69909066f44"
                              user_data: "02e2565a-bd20-46bb-89f4-f7656a8eb0b7"
                              create_time: "2021-06-18T21:27:41.549079+03:00"
                              external_id: "3f8c9b4e-0d96-4617-8698-94b4c7932c0b"
                      - label: "ac75a600-8bf9-4a02-8bc1-daa8eeb0b41e"
                        candidates:
                          - similarity: 0.0251344983
                            face:
                              face_id: "9a27acea-54ec-4f54-8491-12ffa74cc51a"
                              user_data: "851520ac-28d4-445c-8ecd-ced96a949545"
                              create_time: "2021-06-18T21:27:42.374622+03:00"
                              external_id: "77db6ad5-2eac-46eb-9574-52b4cbdeb80c"
                    top_match:
                      face_id: "af836e01-7f0a-467d-9f91-e69909066f44"
                      label: "11f14560-25c6-4727-b096-7e52a973e350"
                      similarity: 0.1134187654
                      external_id: "external_id_1"
                    liveness: 1
                    deepfake: 1
                    body_basic_attributes:
                      apparent_age: 25
                      apparent_gender: 0
                    upper_body:
                      headwear:
                        state: 0
                        apparent_color: undefined
                      sleeve:
                        length: short
                      upper_clothing:
                        colors: [ white, black ]
                    lower_body:
                      lower_garment:
                        type: trousers
                        colors: [ white, black ]
                      shoes:
                        apparent_color: black
                    accessories:
                      backpack:
                        state: 0
                    meta: null
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_events_error'
        408:
          $ref: '#/components/responses/request_timeout'
        422:
          description: Unprocessable.
          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:
                cannot_cast_jsonb:
                  value:
                    error_code: 10020
                    desc: Database error
                    detail: "SQL request execution failed due to incompatible user-defined filters: cannot cast jsonb string to type integer"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-10020"
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - events
      summary: events options
      description: Get options for the resource.
      operationId: geteEventsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/events/{event_id}:
    parameters:
      - in: path
        name: event_id
        schema:
          $ref: '#/components/schemas/uuid'
        required: true
        description: Event ID.
    get:
      tags:
        - events
      summary: get event
      description: |
        Get event by ID.

        The `target` parameter determines field that will be shown for specified event. If target is not set, the response will contain all the fields.
      operationId: getEvent
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/get_single_event_target'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/handlers"
            payload = {
                "description": "non_dynamic_handler",
                "policies": {},
                "handler_type": 0,
            }
            handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
                "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
            }
            url = f"{baseUri}/handlers/{handlerId}/events"

            eventId = requests.post(
                url,
                headers=headers,
                data=image,
            ).json()["events"][0]["event_id"]

            # We are waiting for the event to be created
            time.sleep(5)

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/events/{eventId}"

            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                Policies,
                BinaryImage,
            )
            from luna3.lunavl.httpclient import LunaHttpClient
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="test_handler",
                policies=Policies(),
                raiseError=True,
            ).json["handler_id"]

            eventId = luna3client.emitEvents(
                handlerId=handlerId,
                inputData=[
                    BinaryImage("image.jpg"),
                ],
                raiseError=True,
            ).json["events"][0]["event_id"]

            # We are waiting for the event to be created
            time.sleep(5)

            response = luna3client.getEvent(
                eventId=eventId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/events/fdd015be-f4b5-47dc-bfea-385e507b7b62' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/event'
              example:
                create_time: "2020-10-11T09:11:41.674Z"
                end_time: "2020-10-11T09:11:41.674Z"
                event_id: "bd6df8ea-1df2-449d-b8e3-d1d40b215dc8"
                handler_id: "791f002e-919c-459d-b766-cba9f4130853"
                face_id: "e88b8804-fedb-4dc3-8a59-171caf416571"
                account_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                source: "3rd Avenue"
                stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                top_match:
                  face_id: "a3cd6fd9-75c2-47aa-b2cc-82d6f9792072"
                  similarity: 0.67
                  label: "good guys"
                  external_id: "external_id_1"
                match_result:
                  - candidates:
                      - event:
                          event_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                          create_time: "2018-08-11T09:11:41.674Z"
                          external_id: null
                          user_data: "user data"
                          handler_id: null
                          stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                          source: "cam_1"
                        similarity: 0.63
                    label: "good guy"
                face_detections:
                  - sample_id: "a3e8716f-70dc-42ad-8428-7a552e800a37"
                    detection:
                      rect:
                        height: 240
                        width: 209
                        x: 170
                        y: 198
                    detect_time: "2020-10-11T09:11:41.674Z"
                    detect_ts: 123.456
                    image_origin: null
                body_detections:
                  - sample_id: "a3e8716f-70dc-42ad-8428-7a552e800a37"
                    detect_time: "2020-10-11T09:11:41.674Z"
                    detect_ts: 123.456
                    image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                attach_result: [ "24d405ce-bc56-4bf7-98e1-bdc962b4cf34", "6d037c33-31ec-4d73-b3b3-ec80b09446c2" ]
                gender: 1
                age: 27
                emotion: 5
                mask: 1
                ethnic_group: 3
                tags: [ "good_event" ]
                user_data: "people are strange"
                location:
                  city: "New York"
                  area: "Manhattan"
                  district: null
                  street: "West 48th street"
                  house_number: "220"
                  geo_position:
                    latitude: -73.9906401596
                    longitude: 40.7627248564
                track_id: "e3ed4e18-2983-418d-879a-825e4517fc6c"
                body_basic_attributes:
                  apparent_age: 25
                  apparent_gender: 0
                upper_body:
                  headwear:
                    state: 0
                    apparent_color: undefined
                  sleeve:
                    length: short
                  upper_clothing:
                    colors: [ white, black ]
                lower_body:
                  lower_garment:
                    type: trousers
                    colors: [ white, black ]
                  shoes:
                    apparent_color: black
                accessories:
                  backpack:
                    state: 0
                meta:
                  foo: "bar"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_events_error'
        404:
          description: Event not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error_code: 23001
                desc: Object not found
                detail: Event with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-23001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    head:
      tags:
        - events
      summary: check if event exists
      description: Check if event with `event_id` exists.
      operationId: checkEvent
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/get_single_event_target'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/handlers"
            payload = {
                "description": "non_dynamic_handler",
                "policies": {},
                "handler_type": 0,
            }
            handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            # emit event
            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
                "Luna-Event-Time": "2020-10-10T09:11:41.674Z",
            }
            url = f"{baseUri}/handlers/{handlerId}/events"

            eventId = requests.post(
                url,
                headers=headers,
                data=image,
            ).json()["events"][0]["event_id"]

            # We are waiting for the event to be created
            time.sleep(5)

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/events/{eventId}"

            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                Policies,
                BinaryImage,
            )
            from luna3.lunavl.httpclient import LunaHttpClient
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            handlerId = luna3client.createHandler(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                description="test_handler",
                policies=Policies(),
                raiseError=True,
            ).json["handler_id"]

            eventId = luna3client.emitEvents(
                handlerId=handlerId,
                inputData=[
                    BinaryImage("image.jpg"),
                ],
                raiseError=True,
            ).json["events"][0]["event_id"]

            # We are waiting for the event to be created
            time.sleep(5)

            response = luna3client.checkEvent(
                eventId=eventId,
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --head 'http://127.0.0.1:5000/6/events/fdd015be-f4b5-47dc-bfea-385e507b7b62' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Event not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'

    options:
      tags:
        - events
      summary: event options
      description: Get options for the resource.
      operationId: geteEventOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/clustering:
    post:
      tags:
        - task processing
      summary: clustering task
      description: |
        Create a clustering task.

        The Filters section specifies which faces (or events) should be added to the cluster. The filters are combined with logical AND.

        Available filters depend on the object type: events or faces.

        You can receive a report about the finished clustering task using the reporter task.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

      operationId: createClusteringTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            payload = {
                "description": "clustering faces",
                "content": {
                    "objects_type": "faces",
                    "filters": {
                        "face_ids": [faceId],
                        "external_ids": ["14159261415926"],
                        "create_time__gte": "2018-08-11T09:11:41.674Z",
                        "list_id": listId
                    },
                    "descriptor": {"type": "face"},
                    "threshold": 0.5
                }
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/clustering"
            response = requests.post(url, headers=headers, json=payload)
            taskId = response.json()["task_id"]

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            faceFilters = FaceFilters(
                externalIds=[
                    "14159261415926",
                ],
                listId=listId,
                faceIds=[
                    faceId,
                ],
                userData="clustering faces",
                createTimeGte="2018-08-11T09:11:41.674Z",
            )

            response = luna3client.createClusteringTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                threshold=0.5,
                filters=faceFilters,
                raiseError=True,
            )

            taskId = response.json["task_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/clustering' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "description": "clustering faces",
                "content": {
                    "objects_type": "faces",
                    "filters": {
                        "face_ids": ["95113f42-849d-4240-8493-00f125ae29e5"],
                        "external_ids": ["14159261415926"],
                        "create_time__gte": "2018-08-11T09:11:41.674Z",
                        "list_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e"
                    },
                    "descriptor": {"type": "face"},
                    "threshold": 0.5
                 }
            }'


      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/clustering_task'
        required: true
      responses:
        202:
          description: Accepted.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 17
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: clustering options
      description: Get options for the resource.
      operationId: getClusteringOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/reporter:
    post:
      tags:
        - task processing
      summary: reporter task
      description: |
        Create a task report in CSV format.

        Now the report is only created for clustering tasks.

        The report contains additional information about clustering objects (faces or events). You can specify additional information that will be added to the report.
        The first and the second columns in the report always correspond to a cluster number and an object ID.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results. The result is returned in ZIP archive, which contains a CSV file. If you set the `save_images` parameter, then the ZIP archive will also contain a folder with images.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

      operationId: createReporterTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            # create list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            payload = {
                "description": "clustering faces",
                "content": {
                    "objects_type": "faces",
                    "filters": {
                        "list_id": listId,
                    },
                },
            }
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/clustering"
            taskId = requests.post(url, headers=headers, json=payload).json()[
                "task_id"
            ]

            # wait for tasks to complete
            time.sleep(5)

            # create report
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "description": "report task one",
                "content": {
                    "filters": {"task_id": taskId},
                    "columns": ["user_data", "create_time", "lists", "external_id"],
                    "csv_delimiter": "$",
                },
            }
            url = f"{baseUri}/tasks/reporter"
            response = requests.post(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            taskId = luna3client.createClusteringTask(
                filters=FaceFilters(listId=listId), raiseError=True
            ).json["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            response = luna3client.createReportTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                columns=["user_data", "create_time", "lists", "external_id"],
                description="report task one",
                csvDelimiter="$",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/reporter' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"description": "report task one", "content": {"filters": {"task_id": 138008095858}, "columns": ["user_data", "create_time", "lists", "external_id"], "csv_delimiter": "$"}}'

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

      responses:
        202:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 17
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '147' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
                bad_task_type:
                  value:
                    error_code: 28013
                    desc: Bad/incomplete input data
                    detail: Tasks with type '0' does not support a build report
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28013"
                bad_task_status:
                  value:
                    error_code: 28015
                    desc: Bad/incomplete input data
                    detail: Tasks with type '0' does not support a build report
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28015"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'

        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: reporter options
      description: Get options for the resource.
      operationId: getReporterOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/exporter:
    post:
      tags:
        - task processing
      summary: exporter task
      description: |
        Collect event and/or face data and export them from LP to a CSV file. The file rows represent requested objects. Corresponding samples (if they were requested) are also returned.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results. The result is returned in ZIP archive, which contains a CSV file. If you set the `save_images` parameter, then the ZIP archive will also contain a folder with images.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

      operationId: createExporterTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            payload = {
                "description": "exporting faces from list",
                "content": {
                    "objects_type": "faces",
                    "filters": {
                        "list_id": listId,
                    },
                },
            }
            url = f"{baseUri}/tasks/exporter"
            response = requests.post(url, headers=headers, json=payload)
            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]

            response = luna3client.createExporterTask(
                columns=["user_data", "create_time", "lists", "external_id"],
                description="report task one",
                csvDelimiter="$",
                filters=FaceFilters(listId=listId)
            )
            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/exporter' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"description": "exporter task", "content": {"objects_type": "faces", "columns": ["user_data", "create_time", "lists", "external_id"], "csv_delimiter": "$"}}'

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

      responses:
        202:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 31
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '147' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: exporter options
      description: Get options for the resource.
      operationId: getExporterOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/linker:
    post:
      tags:
        - task processing
      summary: linker task
      description: |
        Create a linker task.

        The task enables you to attach faces to the specified list according to the filters.

        You can use faces or events as objects for the task. When events are used, new face is created for each of the events.

        A list is required for the task processing:
        - If you specified a list, the Tasks service checks its existence and displays an error if the list is not found.
        - If you set new list creation using *create_list = 1*, new list is created.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

        If luna-image-store is disabled no subtask/task result will be stored.

      operationId: createLinkerTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            payload = {
                "description": "linker task one",
                "content": {
                    "create_list": 1,
                    "user_data": "new data",
                    "objects_type": "faces",
                    "filters": {
                        "face_ids": [faceId],
                        "external_ids": ["14159261415926"],
                        "user_data": "clustering faces",
                        "create_time__gte": "2018-08-11T09:11:41.674Z",
                        "list_id": listId,
                    },
                },
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/linker"
            response = requests.post(url, headers=headers, json=payload)
            taskId = response.json()["task_id"]

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            faceFilters = FaceFilters(
                externalIds=[
                    "14159261415926",
                ],
                listId=listId,
                faceIds=[
                    faceId,
                ],
                userData="clustering faces",
                createTimeGte="2018-08-11T09:11:41.674Z",
            )

            response = luna3client.createLinkerTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                listUserData="new list",
                createList=1,
                filters=faceFilters,
                raiseError=True,
            )

            taskId = response.json["task_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/linker' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "description": "linker task one",
                "content": {
                    "create_list": 1,
                    "user_data": "new data",
                    "objects_type": "faces",
                    "filters": {
                        "face_ids": ["95113f42-849d-4240-8493-00f125ae29e5"],
                        "external_ids": ["14159261415926"],
                        "user_data": "clustering faces",
                        "create_time__gte": "2018-08-11T09:11:41.674Z",
                        "list_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e"
                    }
                }
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/linker_task'
        required: true

      responses:
        202:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 29
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: linker options
      description: Get options for the resource.
      operationId: getTaskLinkerOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/gc:
    post:
      tags:
        - task processing
      summary: garbage collection task
      description: |
        Create a garbage collection task.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

        > **WARNING**: If you perform the task for faces with the `remove_samples` flag disabled, then the only way to delete samples
        is to execute the ["remove face/body sample"](operation/deleteSample) resource.
        
        If luna-image-store is disabled no subtask/task result will be stored. 

      operationId: createGCTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            payload = {
                "description": "gc task one",
                "content": {
                    "target": "events",
                    "filters": {
                        "create_time__lt": "2018-08-11T09:11:41.674Z",
                    },
                    "store_results": True,
                    "remove_samples": False,
                },
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            response = requests.post(url, headers=headers, json=payload)
            taskId = response.json()["task_id"]

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.createGcTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                target="events",
                createTimeLt="2018-08-11T09:11:41.674Z",
                description="gc task one",
                storeResults=True,
                removeSamples=False,
                raiseError=True,
            )

            taskId = response.json["task_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/gc' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"description": "gc task one", "content": {"target": "events", "filters": {"create_time__lt": "2018-08-11T09:11:41.674Z"}, "store_results": true, "remove_samples": false}}'

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

      responses:
        202:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 25
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: gc options
      description: Get options for the resource.
      operationId: getGCOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/cross_match:
    post:
      tags:
        - task processing
      summary: cross-matching task
      description: |
        Create a cross-matching task.

        The cross-matching task enables you to compare references (faces, attributes or events) with candidates (faces, attributes or events) according to the specified filters.

        All the references are matched with all the candidates.

        You can limit the number of candidates returned in matching results and set the minimum acceptable similarity threshold.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

      operationId: createCrossMatchTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            # create face
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            # create report
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            payload = {
                "description": "matching visitors with the list of VIP customers",
                "content": {
                    "filters": {
                        "reference_type": "faces",
                        "candidate_type": "events",
                        "reference_filters": {
                            "external_ids": [
                                "14159261415926",
                            ],
                            "create_time__gte": "2020-02-12T09:11:41.674Z",
                            "face_ids": [
                                faceId,
                            ],
                            "user_data": "faces",
                        },
                        "candidate_filters": {
                            "gender": 1,
                            "emotions": [3, 4, 5, 6, 7],
                            "face_ids": [
                                faceId,
                            ],
                            "user_data": "events",
                            "track_ids": ["There_and_Back_Again"],
                            "create_time__gte": "2018-08-11T09:11:41.674Z",
                        },
                        "descriptor": {
                            "type": "face"
                        }
                    },
                    "threshold": 0.5,
                    "limit": 3,
                },
            }
            url = f"{baseUri}/tasks/cross_match"
            response = requests.post(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters
            from luna3.python_matcher.match_objects import EventFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            faceFilters = FaceFilters(
                externalIds=[
                    "14159261415926",
                ],
                faceIds=[
                    faceId,
                ],
                userData="faces",
                createTimeGte="2018-08-11T09:11:41.674Z",
            )

            eventFilters = EventFilters(
                gender=1,
                emotions=[3, 4, 5, 6, 7],
                faceIds=[
                    faceId,
                ],
                userData="events",
                trackIds=["There_and_Back_Again"],
                createTimeGte="2018-08-11T09:11:41.674Z",
            )

            response = luna3client.createCrossMatchTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                referenceFilters=faceFilters,
                candidateFilters=eventFilters,
                descriptorTypeFilter="face",
                threshold=0.5,
                limit=3,
                description="matching visitors with the list of VIP customers",
                raiseError=True,
            )

            taskId = response.json["task_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/cross_match' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"description": "matching visitors with the list of VIP customers",
             "content": {
                "filters": {
                  "reference_type": "faces",
                  "candidate_type": "events",
                  "reference_filters": {"external_ids": ["14159261415926"], "create_time__gte": "2020-02-12T09:11:41.674Z", "face_ids": ["95113f42-849d-4240-8493-00f125ae29e5"], "user_data": "faces"},
                  "candidate_filters": {"gender": 1, "emotions": [3, 4, 5, 6, 7], "face_ids": ["95113f42-849d-4240-8493-00f125ae29e5"], "user_data": "events", "track_ids": ["There_and_Back_Again"], "create_time__gte": "2018-08-11T09:11:41.674Z"},
                  "descriptor": {"type": "face"}
                },
                "threshold": 0.5,
                "limit": 3
                }
             }'

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

      responses:
        202:
          description: Accepted.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 15
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_json_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: cross match options
      description: Get options for the resource.
      operationId: getCrossMatchOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/roc:
    post:
      tags:
        - task processing
      summary: ROC-curve calculating task
      description: |
        Create a ROC-curve calculating task.

        ROC (or Receiver Operating Characteristic) is a performance measurement for the classification problem at various threshold settings. The ROC-curve is plotted with TPR (True Positive Rate) against the FPR (False Positive Rate).

        TPR is a true positive match pair count divided by a count of total expected positive match pairs, and FPR is a false positive match pair count divided by a count of total expected negative match pairs. Each point (FPR, TPR) of the ROC-cure corresponds to a certain similarity threshold.

        The model performance is determined by looking at the area under the ROC-curve (or AUC), the ROC-curve and the secondary main diagonal intersection point, where type I and type II error rates are equal. The model performance is also determined by getting into the top-N probability, i.e. probability of getting a positive match pair into the top-N for any match result group sorted by similarity.

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

        Objects to be processed must belong to the user account making the request.

      operationId: createROCTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            # create face
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]
            faceId2 = requests.post(url, headers=headers).json()["face_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            payload = {
                "description": "matching famous people with customers",
                "content": {
                    "markup": [
                        {"face_id": faceId, "label": 12},
                        {"face_id": faceId2, "label": 12},
                    ],
                    "threshold_hit_top": 0.95,
                    "limit": 100,
                    "key_FPRs": [0.000001, 0.001],
                },
            }

            url = f"{baseUri}/tasks/roc"
            response = requests.post(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            faceId = luna3client.createFace(raiseError=True).json["face_id"]
            faceId2 = luna3client.createFace(raiseError=True).json["face_id"]

            response = luna3client.createROCTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                markup=[
                    {"face_id": faceId, "label": 12},
                    {"face_id": faceId2, "label": 12},
                ],
                description="matching famous people with customers",
                thresholdHitTop=0.95,
                limit=100,
                keyFPRs=[0.000001, 0.001],
                raiseError=True,
            )

            taskId = response.json["task_id"]

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/roc' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "description": "matching famous people with customers",
                "content":
                {"markup": [
                    {"face_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e", "label": 12},
                    {"face_id": "8d5f7c8a-6312-457a-9d82-a4b25418124e", "label": 12}],
                    "threshold_hit_top": 0.95, "limit": 100, "key_FPRs": [1e-06, 0.001]
                    }
            }'

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

      responses:
        202:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
              example:
                task_id: 14
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '147' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
                bad_task_type:
                  value:
                    error_code: 28013
                    desc: Bad/incomplete input data
                    detail: Tasks with type '0' does not support a build report
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28013"
                bad_task_status:
                  value:
                    error_code: 28015
                    desc: Bad/incomplete input data
                    detail: Tasks with type '0' does not support a build report
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28015"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: roc options
      description: Get options for the resource.
      operationId: getRocOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/estimator:
    post:
      tags:
        - task processing

      summary: estimator task
      description: |
        Create an estimator task.


        Task allows to process images using established policies. Policies can be specified in the request or use
        saved ones by passing the handler ID.

        The resource can accept three types of sources with images for processing:

        - ZIP archive
        - S3-like storage
        - Network disk
        - FTP server
        - Samba

        Use the GET request on resource ["/6/tasks/{task_id}/result"](#operation/getTaskResult) to receive the task results.

        If there are no results of the created task and error "Object not found" is returned,
        use the GET request on resource ["/6/tasks/errors/{error_id}"](#operation/getTaskError) to receive the task errors.

         > **WARNING**: Check handler `storage_policy` before a task start, `notification_policy` and `event_policy`
        enable by default.

        Objects to be processed must belong to the user account making the request.

        If luna-image-store is disabled no subtask/task result will be stored.

      operationId: createEstimatorTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/applicationJsonContent'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create handler for processing images from archive
            url = f"{baseUri}/handlers"
            policies = {
                "detect_policy": {
                    "estimate_emotions": 1,
                    "estimate_mask": 1,
                },
                "extract_policy": {
                    "extract_basic_attributes": 1,
                    "extract_face_descriptor": 1,
                },
                "storage_policy": {
                    "face_policy": {
                        "store_face": 1,
                        "link_to_lists_policy": [
                            {"list_id": listId}
                        ]
                    },
                    "event_policy": {
                        "store_event": 0
                    },
                    "notification_policy": {
                        "send_notification" : 0
                    }
                }
            }
            payload = {
                "description": "handler for zip",
                "policies": policies,
                "handler_type": 0,
            }
            handlerId = requests.post(url, json=payload, headers=headers).json()["handler_id"]

            payload = {
                "description": "estimation faces from an archive to a list",
                "content": {
                    "handler": {"handler_id": handlerId},
                    "source": {
                       "source_type": "zip",
                       "reference": {
                          "url": "http://127.0.0.1:5000/archive"
                        },
                       "image_type": 0,
                       "authorization": {
                           "password": "12345"
                       }
                    }
                },
            }
            url = f"{baseUri}/tasks/estimator"
            response = requests.post(url, headers=headers, json=payload)
            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.common.http_objs import (
                Policies,
                DetectPolicy,
                ExtractPolicy,
                StoragePolicy,
                EventPolicy,
                NotificationPolicy,
                FacePolicy,
                LinkToListPolicy,
                EstimatorHandler,
            )
            from luna3.tasks.http_objs import EstimatorZipSource

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            policies = Policies(
                detectPolicy=DetectPolicy(estimateEmotions=1, estimateMask=1),
                extractPolicy=ExtractPolicy(
                    extractBasicAttributes=1,
                    extractFaceDescriptor=1,
                    fdScoreThreshold=0.0,
                ),
                storagePolicy=StoragePolicy(
                    eventPolicy=EventPolicy(storeEvent=0),
                    notificationPolicy=NotificationPolicy(sendNotification=0),
                    facePolicy=FacePolicy(storeFace=1, linkToListsPolicy=[LinkToListPolicy(listId=listId)])
                )
            )

            response = luna3client.createEstimatorTask(
                handler=EstimatorHandler(policies, "luna3 estimator task example"),
                source=EstimatorZipSource(url="http://127.0.0.1:5000/archive")
            )
            print(response.statusCode)
            print(response.json)

        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/estimator' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621111' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"description": "estimator task", "content": {
                         "handler": {"policies": {}, "description": "estimator task example"},
                         "source": {"source_type": "zip", "reference": {"url": "http://127.0.0.1:5000/archive"}}}}'

      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/estimator_task'
            examples:
              estimate_from_zip_archive:
                value:
                  description: "estimator task with zip archive"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: zip
                      reference:
                        url: http://example.com/123.zip
                        prefix: folder_in_archive/some_prefix
                        postfix: .jpg
                      recursive: true
                      authorization:
                        password: 123456
                      image_type: 1
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
              estimate_from_local_s3_bucket:
                value:
                  description: "estimator task with local s3 bucket"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: s3
                      reference:
                        endpoint: http://localhost:7480
                        bucket_name: portraits
                        prefix: folder1/folder2
                      authorization:
                        public_access_key: user
                        secret_access_key: password
                      image_type: 1
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
              estimate_from_remote_s3_bucket:
                value:
                  description: "estimator task with remote s3 bucket"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: s3
                      reference:
                        endpoint: https://bucket-name.s3.region.amazonaws.com/
                        bucket_name: portraits
                        prefix: folder1/folder2
                      authorization:
                        public_access_key: user
                        secret_access_key: password
                      image_type: 1
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
              estimate_from_s3_arn:
                value:
                  description: "estimator task with s3 bucket using arn"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: s3
                      reference:
                        bucket_name: arn:aws:s3:eu-central-1:000000000000:accesspoint/bucket-with-images
                        prefix: DCIM_
                      authorization:
                        public_access_key: user
                        secret_access_key: password
                      image_type: 1
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
              estimate_from_network_disk:
                value:
                  description: "estimator task with network disk"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: network_disk
                      reference:
                        path: /mnt/nfs_volume/pictures
                        prefix: portraits
                        postfix: .jpg
                      recursive: true
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
              estimate_from_ftp:
                value:
                  description: "estimator task with ftp server"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: ftp
                      authorization:
                        user: admin
                        password: secret-password
                      reference:
                        host: 10.0.0.1
                        port: 2121
                        path: image-storage/
                        prefix: portraits
                        postfix: .jpg
                        max_sessions: 20
                      recursive: true
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
              estimate_from_samba:
                value:
                  description: "estimator task with samba"
                  content:
                    handler:
                      handler_id: "c42ad7cb-9078-4be4-8457-4d3c744477df"
                    source:
                      source_type: samba
                      authorization:
                        user: admin
                        password: secret-password
                      reference:
                        host: 10.0.0.1
                        port: 2121
                        path: image-storage/
                        prefix: portraits
                        postfix: .jpg
                      recursive: true
                  notification_policy:
                    enable: 1
                    task_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
                    subtask_callbacks:
                      - type: "http"
                        authorization:
                          type: "basic"
                          login: "string"
                          password: "string"
                        url: "../dictionary"
                        params:
                          timeout: 60
                          content_type: "application/json"
                        enable: 1
        required: true

      responses:
        202:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                  - task_id
        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_input_json:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                invalid_handler:
                  value:
                    error_code: 12031
                    desc: Bad/incomplete input data
                    detail: 'Handler 8c335656-3145-4c0d-9e99-fa9d6843ab95 is dynamic. Dynamic handler not supported'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12031"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: estimator options
      description: Get options for the resource.
      operationId: getEstimatorOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/lambda:
    post:
      tags:
      - task processing

      summary: lambda task
      description: | 
                   Create new lambda task.
      operationId: createLambdaTask

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      - $ref: '#/components/parameters/luna_account_id'

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

      responses:
        202:
          description: OK
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    $ref: '#/components/schemas/task_id'
                required:
                - task_id
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 12022
                    desc: Bad/incomplete input data
                    detail: 'Failed to validate input json. Path: '''',  message: ''Additional properties are not allowed (''userdata'' was unexpected)'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task processing
      summary: lambda task options
      description: Get options for the resource.
      operationId: getTaskLambdaOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks:
    get:
      tags:
        - task info
      summary: get tasks
      description: Get tasks according to the filters.
      operationId: getTasks
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/create_time__lt'
        - $ref: '#/components/parameters/create_time__gte'
        - $ref: '#/components/parameters/end_time__lt'
        - $ref: '#/components/parameters/end_time__gte'
        - $ref: '#/components/parameters/task_ids'
        - $ref: '#/components/parameters/task_type'
        - $ref: '#/components/parameters/task_status'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/schedule_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            params = {
                "task_id": taskId,
                "task_type": 4,
                "task_status": 5,
                "create_time__gte": "2018-08-11T09:11:41.674Z",
                "page": 1,
            }

            url = f"{baseUri}/tasks"
            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            response = luna3client.getTasks(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskIds=[
                    taskId,
                ],
                createTimeGte="2018-08-11T09:11:41.674Z",
                taskType=4,
                taskStatus=5,
                page=1,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks?task_id=138008095858&task_type=4&task_status=5&create_time__gte=2018-08-11T09:11:41.674Z&page=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tasks_reply'
              example:
                tasks:
                  - task_id: 27
                    account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                    create_time: "2018-08-11T09:11:41.674Z"
                    end_time: null
                    last_update_time: "2018-08-11T09:11:41.674Z"
                    task_type: 6
                    task_status: 1
                    result_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                    count_task_parts_done: 10
                    count_task_parts_all: 100
                    content:
                      filters:
                        account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                        reference_type: "events"
                        candidate_type: "faces"
                        reference_filters:
                          gender: 1
                          sources: [ "Main_hall_camera" ]
                        candidate_filters:
                          attribute_ids: [ "83914110-cba3-46da-8dbe-e6e7a7aa2466", "9027e290-db5a-43b0-9454-848ad377d428" ]
                      threshold: 0.5
                      limit: 3
                    description: "task description"
                    schedule_id: 13
                    notification_policy:
                      enable: 1
                      task_callbacks:
                        - type: "http"
                          authorization:
                            type: "basic"
                            login: "string"
                            password: "string"
                          url: "../dictionary"
                          params:
                            timeout: 60
                            content_type: "application/json"
                          enable: 1
                      subtask_callbacks:
                        - type: "http"
                          authorization:
                            type: "basic"
                            login: "string"
                            password: "string"
                          url: "../dictionary"
                          params:
                            timeout: 60
                            content_type: "application/json"
                          enable: 1
                  - task_id: 13
                    create_time: "2018-10-11T09:11:41.755Z"
                    account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                    end_time: "2018-10-11T10:15:41.700Z"
                    last_update_time: "2018-10-11T09:11:41.755Z"
                    task_type: 2
                    task_status: 5
                    result_id: "3d69b8c3-8465-4eca-8a27-c5a30cd83e3d"
                    count_task_parts_done: 10
                    count_task_parts_all: 10
                    content:
                      filters:
                        account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                      objects_type: "events"
                      threshold: 0.61
                      params:
                        use_track_info: 1
                      descriptor:
                        type: "face"
                    description: "task description"
                    schedule_id: 13
                    notification_policy:
                      enable: 1
                      task_callbacks:
                        - type: "http"
                          authorization:
                            type: "basic"
                            login: "string"
                            password: "string"
                          url: "../dictionary"
                          params:
                            timeout: 60
                            content_type: "application/json"
                          enable: 1
                      subtask_callbacks:
                        - type: "http"
                          authorization:
                            type: "basic"
                            login: "string"
                            password: "string"
                          url: "../dictionary"
                          params:
                            timeout: 60
                            content_type: "application/json"
                          enable: 1
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task info
      summary: tasks options
      description: Get options for the resource.
      operationId: getTasksOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/count:
    get:
      tags:
        - task info
      summary: get tasks count
      description: Count tasks according to the filters.
      operationId: getTasksCount
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/create_time__lt'
        - $ref: '#/components/parameters/create_time__gte'
        - $ref: '#/components/parameters/end_time__lt'
        - $ref: '#/components/parameters/end_time__gte'
        - $ref: '#/components/parameters/task_ids'
        - $ref: '#/components/parameters/task_type'
        - $ref: '#/components/parameters/task_status'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/schedule_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            params = {
                "task_id": taskId,
                "task_type": 4,
                "task_status": 5,
                "create_time__gte": "2018-08-11T09:11:41.674Z",
                "page": 1,
            }

            url = f"{baseUri}/tasks/count"
            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            response = luna3client.getTasksCount(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskIds=[
                    taskId,
                ],
                createTimeGte="2018-08-11T09:11:41.674Z",
                taskType=4,
                taskStatus=0,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/count?task_id=138008095858&task_type=4&task_status=5&create_time__gte=2018-08-11T09:11:41.674Z&page=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/taskCount'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task info
      summary: tasks count options
      description: Get options for the resource.
      operationId: getTasksCountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/{task_id}:
    parameters:
    - $ref: '#/components/parameters/path_task_id'

    get:
      tags:
        - task info
      summary: get task
      description: Get task by ID.
      operationId: getTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/tasks/{taskId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            response = luna3client.getTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/138008095858' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/task_reply'
              example:
                task_id: 13
                account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                create_time: "2018-08-11T09:11:41.674Z"
                end_time: "2018-08-11T10:11:41.674Z"
                last_update_time: "2018-08-11T10:11:41.674Z"
                task_type: 1
                task_status: 5
                result_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                count_task_parts_done: 10
                count_task_parts_all: 10
                content:
                  filters:
                    account_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                  objects_type: "faces"
                  user_data: "some info"
                  list_id: "8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a"
                  create_list: 1
                notification_policy:
                  enable: 1
                  task_callbacks:
                    - type: "http"
                      authorization:
                        type: "basic"
                        login: "string"
                        password: "string"
                      url: "../dictionary"
                      params:
                        timeout: 60
                        content_type: "application/json"
                      enable: 1
                  subtask_callbacks:
                    - type: "http"
                      authorization:
                        type: "basic"
                        login: "string"
                        password: "string"
                      url: "../dictionary"
                      params:
                        timeout: 60
                        content_type: "application/json"
                      enable: 1
                description: "task description"

        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 11037
                    desc: Bad/incomplete input data
                    detail: 'Luna-Account-Id header is not UUID, format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11037"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Task not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    patch:
      tags:
        - task info
      summary: cancel task
      description: Cancel task by ID.
      operationId: cancelTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/tasks/{taskId}"
            response = requests.patch(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            response = luna3client.cancelTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request PATCH 'http://127.0.0.1:5000/6/tasks/138008095858' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        202:
          description: Canceling.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Task not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
        - task info
      summary: delete task
      description: Delete a task and the task results by the task ID.
      operationId: deleteTask
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/tasks/{taskId}"
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            response = luna3client.deleteTask(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/tasks/138008095858' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        204:
          description: Deleted.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                task_can_not_canceled:
                  value:
                    error_code: 28019
                    desc: Bad/incomplete input data
                    detail: Task '146' with status 5 can not canceled
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28019"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: Task not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task info
      summary: task options
      description: Get options for the resource.
      operationId: getTaskOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/{task_id}/notification_policy:
    parameters:
    - $ref: '#/components/parameters/path_task_id'

    get:
      tags:
      - tasks notification policy

      summary: get task notification policy
      description: Get task notification policy by task ID.
      operationId: getTaskNotificationPolicy

      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'

      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            
            url = f"{baseUri}/tasks/{taskId}/notification_policy"
            response = requests.get(
                url,
                headers=headers,
            )
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            
            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]
            
            response = luna3client.getTaskNotificationPolicy(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
            )
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/138008095858/notification_policy' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      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/task_notification_policy_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 'account_id'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: task 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'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    put:
      tags:
      - tasks notification policy

      summary: replace task notification policy
      description: Replace task notification policy by task ID.
      operationId: putTaskNotificationPolicy

      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'

      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]
            
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            
            url = f"{baseUri}/tasks/{taskId}/notification_policy"
            payload = {
                "enable": 1,
                "task_callbacks": [
                    {
                        "type": "http",
                        "authorization": {
                            "type": "basic",
                            "login": "login",
                            "password": "password"
                        },
                        "url": "http://127.0.0.1:8000",
                        "params": {
                            "timeout": 60,
                            "content_type": "application/json",
                        },
                        "enable": 1
                    }
                ],
                "subtask_callbacks": [
                    {
                        "type": "http",
                        "authorization": {
                            "type": "basic",
                            "login": "login",
                            "password": "password"
                        },
                        "url": "http://127.0.0.1:8000",
                        "params": {
                            "timeout": 60,
                            "content_type": "application/json",
                        },
                        "enable": 1
                    }
                ]
            }
            response = requests.put(
                url,
                headers=headers,
                json=payload,
            )
            
            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.tasks.http_objs import TaskNotificationPolicy, TaskCallback
            
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            
            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]
            
            response = luna3client.replaceTaskNotificationPolicy(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
                notificationPolicy=TaskNotificationPolicy(
                    enable=1,
                    taskCallbacks=[
                        TaskCallback(
                            callbackType="http",
                            url="http://127.0.0.1:8000",
                        )
                    ],
                    subtaskCallbacks=[
                        TaskCallback(
                            callbackType="http",
                            url="http://127.0.0.1:8000",
                        )
                    ]
                )
            )
            
            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request PUT 'http://127.0.0.1:5000/6/tasks/1/notification_policy' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data ' {
                 "enable": 1,
                 "task_callbacks": [
                     {
                         "type": "http",
                         "authorization": {
                             "type": "basic",
                             "login": "login",
                             "password": "password"
                         },
                         "url": "http://127.0.0.1:8000",
                         "params": {
                             "timeout": 60,
                             "content_type": "application/json"
                         },
                         "enable": 1
                     }
                 ],
                "subtask_callbacks": [
                     {
                         "type": "http",
                         "authorization": {
                             "type": "basic",
                             "login": "login",
                             "password": "password"
                         },
                         "url": "http://127.0.0.1:8000",
                         "params": {
                             "timeout": 60,
                             "content_type": "application/json"
                         },
                         "enable": 1
                     }
                 ]
            }'

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

      responses:
        204:
          description: Done
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
                task_can_not_canceled:
                  value:
                    error_code: 28019
                    desc: Bad/incomplete input data
                    detail: Task '146' with status 5 can not canceled
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28019
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        404:
          description: task 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'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
      - tasks notification policy
      summary: tasks notification policy options
      description: Get options for the resource.
      operationId: getTaskNotificationPolicyOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/{task_id}/result:
    parameters:
    - $ref: '#/components/parameters/path_task_id'

    get:
      tags:
        - task info
      summary: get task result
      description: |
        Get task result by the task ID.

        In addition to the result of the task, the occurred errors can be returned in the response.
      operationId: getTaskResult
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/tasks/{taskId}/result"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # create some task
            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            response = luna3client.getTaskResult(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/138008095858/result' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              schema:
                type: string
                enum:
                  - application/json
                  - application/zip
              required: true
              description: Content type of body.
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Disposition:
              $ref: '#/components/headers/content_disposition'
            Transfer-Encoding:
              $ref: '#/components/headers/transfer_encoding'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/task_results'
              examples:
                gc_task_result:
                  summary: gc task result
                  value:
                    result: [{"event_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e", "samples": ["ceaef36e-944f-4b80-a110-96b7d82b8b58"]}]
                    errors: []
                clustering_task_result:
                  summary: clustering task result
                  value:
                    result:
                      clusters: [['53c7870d-915d-4241-a765-f85550905dd6'], ['c9c745bc-a9ef-4fc6-bbbb-28d8f02b42cf'], ['ceaef36e-944f-4b80-a110-96b7d82b8b58'], ['556885ec-c1db-447d-ab45-21c83d546bf3', 'f3a379b8-56e6-4a98-a662-8834385a0977']]
                      total_objects: 5
                      total_clusters: 4
                    errors: []
                linker_task_result:
                  summary: linker task result
                  value:
                    result: {"list_id": "b668c4a5-2191-476e-a261-3b4f9ce2e25e", "face_ids": ["ceaef36e-944f-4b80-a110-96b7d82b8b58"]}
                    errors: []
                cross_match_task_result:
                  summary: cross match task result
                  value:
                    result:
                      - reference_id: "e99d42df-6859-4ab7-98d4-dafd18f47f30"
                        candidates:
                          - candidate_id: "93de0ea1-0d21-4b67-8f3f-d871c159b740"
                            similarity: 0.62344
                          - candidate_id: "54860fc6-c726-4521-9c7f-3fa354983e02"
                            similarity: 0.548252
                      - reference_id: "345af6e3-625b-4f09-a54c-3be4c834780d"
                        candidates:
                          - candidate_id: "6ade1494-1138-49ac-bfd3-29e9f5027240"
                            similarity: 0.9543
                          - candidate_id: "e0e3c474-9099-4fad-ac61-d892cd6688bf"
                            similarity: 0.7123213
                    errors: []
                ROC_task_result:
                  summary: ROC task result
                  value:
                    result:
                      roc:
                        - FPR: 0.1
                          TPR: 0.95
                          similarity: 0.9
                        - FPR: 0.15
                          TPR: 0.96
                          similarity: 0.8
                      hit_top_probability:
                        top-1: 0.995
                        top-2: 0.997
                        top-3: 0.999
                        top-4: 0.999
                        top-5: 0.999
                      auc: 0.99
                      type_I_and_II_error_rates_equal_point:
                        FPR: 0.15
                        TPR: 0.85
                        similarity: 0.8
                      key_points:
                        - FPR: 0.000001
                          TPR: 0.95
                          similarity: 0.9
                        - FPR: 0.001
                          TPR: 0.96
                          similarity: 0.8
                    errors: []
                clustering_task_result_with_errors:
                  summary: clustering task result with errors
                  value:
                    result:
                      clusters: [ [ '53c7870d-915d-4241-a765-f85550905dd6' ], [ 'c9c745bc-a9ef-4fc6-bbbb-28d8f02b42cf' ], [ 'ceaef36e-944f-4b80-a110-96b7d82b8b58' ] ]
                      total_objects: 3
                      total_clusters: 2
                    errors:
                      - error_id: 8
                        task_id: 41
                        subtask_id: 41
                        error_code: 28010
                        description: "Objects not found"
                        detail: "Objects for clustering not found (empty set)"
                        additional_info: null
                        error_time: "2019-05-29T10:53:42.417396+03:00"
                        link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010"
                      - error_id: 9
                        task_id: 41
                        subtask_id: 41
                        error_code: 13003
                        description: "Object not found"
                        detail: "List with id 'a75ddc76-e37e-45f5-9a7a-93e4001208fb' not found"
                        additional_info: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                        error_time: "2020-05-09T04:10:35.279253+03:00"
                        link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
                estimator_task_result_with_errors:
                  summary: estimator task result with errors
                  value:
                    result:
                      - filename: "picture_name.jpg"
                        result:
                          events:
                            - face_attributes:
                                attribute_id: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                                basic_attributes:
                                  age: 50
                                  gender: 0
                                  ethnicities:
                                    estimations:
                                      asian: 0.7
                                      indian: 0.1
                                      caucasian: 0.2
                                      african_american: 0.3
                                    predominant_ethnicity: "asian"
                                score: 0
                                samples:
                                  - "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                                filter:
                                  is_filtered: true
                                  filter_reasons:
                                    - filter_name: "score_threshold"
                                      object_value: 0
                                      threshold_value: 0
                                url: "string"
                              body_attributes:
                                score: 0
                                samples:
                                  - "f2d470e7-03c1-4cb2-84b5-ea480f00b1f2"
                              meta:
                                foo: "bar"
                              aggregate_estimations:
                                face:
                                  attributes:
                                    liveness:
                                      prediction: "spoof"
                                      estimations:
                                        score: 0.93
                                        quality: 0.95
                                    deepfake:
                                      prediction: "fake"
                                      score: 0.93
                                    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:
                                      predominant_mask: "occluded"
                                      estimations:
                                        medical_mask: 0.020060448
                                        missing: 0.3235525191
                                        occluded: 0.6563870311
                                      face_occlusion:
                                        predominant_occlusion: correct
                                        estimations:
                                          full: 0.019
                                          clear: 0.02
                                          correct: 0.6108324766
                                          partially: 0.310
                                          mouth: 0.0209
                                          chin: 0.019097
                                body:
                                  attributes:
                                    basic_attributes:
                                      apparent_age: 25
                                      apparent_gender: 0
                                    upper_body:
                                      headwear:
                                        state: 0
                                        apparent_color: undefined
                                      sleeve:
                                        length: short
                                      upper_clothing:
                                        colors: [ white, black ]
                                    lower_body:
                                      lower_garment:
                                        type: trousers
                                        colors: [ white, black ]
                                      shoes:
                                        apparent_color: black
                                    accessories:
                                      backpack:
                                        state: 0
                              source: "string"
                              stream_id: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                              tags: [ "tag1", "tag2" ]
                              external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                              user_data: "100-00-12"
                              face:
                                face_id: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                                event_id: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                                user_data: ""
                                external_id: ""
                                avatar: ""
                                lists:
                                  - "557d54ec-29ad-4f3c-93b4-c9092ef12515"
                                url: "string"
                              event_id: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                              url: "string"
                              matches:
                                - label: "string"
                                  candidates:
                                    - face:
                                        face_id: "426542d6-5509-4e5b-8a01-e2abd5c0a8c6"
                                        external_id: "2xQ2gprbMUePw1s9gw9fvA=="
                                        user_data: "fox1991"
                                        create_time: "2018-08-11T09:11:41.674Z"
                                        lists: [ ]
                                        avatar: "/6/samples/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
                                        event_id: "f9687459-986b-406d-9c1f-0d6289be5256"
                                      similarity: 0.5
                              location:
                                city: "string"
                                area: "string"
                                district: "string"
                                street: "string"
                                house_number: "string"
                                geo_position:
                                  longitude: -180
                                  latitude: -90
                              detections:
                                - filename: "string"
                                  samples:
                                    body: null
                                    face: null
                                  detect_time: "2018-08-11T09:11:41.674Z"
                                  detect_ts: 123.456
                                  image_origin: "string"
                              track_id: "string"
                          filtered_detections:
                            face_detections:
                              - filter_reasons:
                                  - filter_name: "pitch_threshold"
                                    object_value: 0
                                    threshold_value: 0
                                detection:
                                  filename: "string"
                                  sample:
                                    detection: { }
                        errors:
                          - error_code: 1
                            detail: "Internal server error"
                            desc: "Internal server error"
                            link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-1"
                    errors:
                      - error_id: 10
                        task_id: 123
                        subtask_id: 5
                        error_code: 0
                        description: "Faces not found"
                        detail: "One or more faces not found, including face with id '8f4f0070-c464-460b-bf78-fac225df72e9'"
                        link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                        additional_info: "8f4f0070-c464-460b-bf78-fac225df72e9"
                        error_time: "2021-07-28T01:23:21.537604+03:00"

            application/zip:
              schema:
                $ref: '#/components/schemas/task_results_zip'
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_lis'
        404:
          description: Object not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
                task_result_not_found:
                  value:
                    error_code: 28017
                    desc: Object not found
                    detail: Result of the task '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28017"
                task_does_not_have_result_yet:
                  value:
                    error_code: 28018
                    desc: Object not found
                    detail: task '146' does not have result yet
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28018"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task info
      summary: task result options
      description: Get options for the resource.
      operationId: getTaskResultOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/{task_id}/subtasks:
    parameters:
    - $ref: '#/components/parameters/path_task_id'

    get:
      tags:
        - task info
      summary: get subtasks
      description: Get subtasks of a task by ID.
      operationId: getSubTasks
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/gc"
            payload = {"content": {"target": "events"}}
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/tasks/{taskId}/subtasks"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            taskId = luna3client.createGcTask(target="events", raiseError=True).json["task_id"]

            response = luna3client.getTaskSubTasks(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/138008095858/subtasks' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubTasks'
              example:
                subtasks:
                  - subtask_id: 39
                    task_id: 39
                    result_id: "d4dd7ffc-b822-4ed1-88ab-dcce36ae6739"
                    create_time: "2020-06-10T01:09:53.973246+03:00"
                    end_time: "2020-06-10T01:09:54.014438+03:00"
                    subtask_status: 4
                    content:
                      target: "events"
                      filters:
                        account_id: "448f50d1-19cd-4c77-9c2f-f6358b2dd385"
                  - subtask_id: 1
                    task_id: 1
                    result_id: null
                    create_time: "2021-06-18T22:02:00.435144+03:00"
                    end_time: "2021-06-18T22:02:00.488094+03:00"
                    subtask_status: 3
                    content:
                      filters:
                        list_id: "d94726c8-55c1-4acb-9ee3-7c40b69e1120"
                        account_id: "448f50d1-19cd-4c77-9c2f-f6358b2dd385"
                      objects_type: "faces"
                      descriptor:
                        type: "face"
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Task not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task info
      summary: subtasks options
      description: Get options for the resource.
      operationId: getSubTasksOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/{task_id}/errors:
    parameters:
    - $ref: '#/components/parameters/path_task_id'

    get:
      tags:
        - task errors
      summary: get task errors
      description: Get errors of a task by the task ID.
      operationId: getErrors
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time
            from uuid import uuid4

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            payload = {
                "description": "matching famous people with customers",
                "content": {
                    "markup": [
                        {"face_id": str(uuid4()), "label": 1},
                        {"face_id": str(uuid4()), "label": 2},
                    ],
                },
            }

            url = f"{baseUri}/tasks/roc"
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            url = f"{baseUri}/tasks/{taskId}/errors"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from uuid import uuid4
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            badMarkup = []
            for label, face in enumerate([str(uuid4()) for _ in range(2)]):
                badMarkup.append({"face_id": face, "label": label})
            taskId = luna3client.createROCTask(
                markup=badMarkup, description="bad task", raiseError=True
            ).json["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            response = luna3client.getTaskErrors(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                taskId=taskId,
                page=1,
                pageSize=100,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/138008095858/errors' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrors'
              example:
                errors:
                  - error_id: 5808750
                    task_id: 14980
                    subtask_id: 69825
                    error_code: 28010
                    description: "Objects not found"
                    detail: "Objects for clustering not found (empty set)"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010"
                    additional_info: null
                    error_time: "2019-04-29T10:53:42.417396+03:00"
                  - error_id: 9
                    task_id: 41
                    subtask_id: 41
                    error_code: 13003
                    description: "Object not found"
                    detail: "Image with id 'a75ddc76-e37e-45f5-9a7a-93e4001208fb' not found"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
                    additional_info: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                    error_time: "2020-05-09T04:10:35.279253+03:00"
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Object not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
                task_error_not_found:
                  value:
                    error_code: 28002
                    desc: Object not found
                    detail: Task error with id '1' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28002"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task errors
      summary: task errors options
      description: Get options for the resource.
      operationId: getTaskErrorsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/errors:
    get:
      tags:
        - task errors
      summary: get errors
      description: Get errors according to the filters.
      operationId: getTasksErrors
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
        - $ref: '#/components/parameters/task_ids'
        - $ref: '#/components/parameters/error_code'
        - $ref: '#/components/parameters/error_ids'
        - $ref: '#/components/parameters/error_time__lt'
        - $ref: '#/components/parameters/error_time__gte'
        - $ref: '#/components/parameters/task_type'
        - $ref: '#/components/parameters/status_code'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time
            from uuid import uuid4

            baseUri = "http://127.0.0.1:5000/6"

            # create bad task
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "description": "matching famous people with customers",
                "content": {
                    "markup": [
                        {"face_id": str(uuid4()), "label": 1},
                        {"face_id": str(uuid4()), "label": 2},
                    ],
                },
            }
            url = f"{baseUri}/tasks/roc"
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            # get tasks error id list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/{taskId}/errors"
            response = requests.get(url, headers=headers)
            errorIds = [
                str(error["error_id"]) for error in response.json()["errors"]
            ]

            # get error according to the filters
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "errors": [
                    {
                        "error_id": ",".join(errorIds),
                        "task_id": taskId,
                        "error_time__gte": "2018-08-11T09:11:41.674Z",
                    }
                ]
            }

            url = f"{baseUri}/tasks/errors"
            response = requests.get(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from uuid import uuid4
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            badMarkup = []
            for label, face in enumerate([str(uuid4()) for _ in range(2)]):
                badMarkup.append({"face_id": face, "label": label})
            taskId = luna3client.createROCTask(
                markup=badMarkup, description="bad task", raiseError=True
            ).json["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            errorIds = [
                str(error["error_id"])
                for error in luna3client.getTaskErrors(taskId=taskId).json["errors"]
            ]

            response = luna3client.getErrors(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                errorTimeGte="2018-08-11T09:11:41.674Z",
                taskIds=[
                    taskId,
                ],
                errorIds=errorIds,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/errors' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{"errors": [{"error_id": "1089,1090", "task_id": 138008095858, "error_time__gte": "2018-08-11T09:11:41.674Z"}]}'

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskErrors'
              example:
                errors:
                  - error_id: 5808750
                    task_id: 14980
                    subtask_id: 69825
                    error_code: 28010
                    description: "Objects not found"
                    detail: "Objects for clustering not found (empty set)"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010"
                    additional_info: null
                    error_time: "2019-04-29T10:53:42.417396+03:00"
                  - error_id: 9
                    task_id: 41
                    subtask_id: 41
                    error_code: 13003
                    description: "Object not found"
                    detail: "Image with id 'a75ddc76-e37e-45f5-9a7a-93e4001208fb' not found"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-13003"
                    additional_info: "f2d470e7-03c1-4cb2-84b5-ea480f00b1f0"
                    error_time: "2020-05-09T04:10:35.279253+03:00"
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Object not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                task_not_found:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
                task_error_not_found:
                  value:
                    error_code: 28002
                    desc: Object not found
                    detail: Task error with id '1' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28002"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - task errors
      summary: errors options
      description: Get options for the resource.
      operationId: getErrorsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/errors/count:
    get:
      tags:
        - task errors
      summary: get errors count
      description: Count errors according to the filters.
      operationId: getTasksErrorsCount
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/error_time__lt'
        - $ref: '#/components/parameters/error_time__gte'
        - $ref: '#/components/parameters/task_type'
        - $ref: '#/components/parameters/status_code'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time
            from uuid import uuid4

            baseUri = "http://127.0.0.1:5000/6"

            # create bad task
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "description": "matching famous people with customers",
                "content": {
                    "markup": [
                        {"face_id": str(uuid4()), "label": 1},
                        {"face_id": str(uuid4()), "label": 2},
                    ],
                },
            }
            url = f"{baseUri}/tasks/roc"
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            # get tasks error id list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/{taskId}/errors"
            response = requests.get(url, headers=headers)
            errorIds = [
                str(error["error_id"]) for error in response.json()["errors"]
            ]

            # get error count
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "errors": [
                    {
                        "error_id": ",".join(errorIds),
                        "task_id": taskId,
                        "error_time__gte": "2018-08-11T09:11:41.674Z",
                    }
                ]
            }

            url = f"{baseUri}/tasks/errors/count"
            response = requests.get(url, headers=headers, json=payload)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from uuid import uuid4
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            badMarkup = []
            for label, face in enumerate([str(uuid4()) for _ in range(2)]):
                badMarkup.append({"face_id": face, "label": label})
            taskId = luna3client.createROCTask(
                markup=badMarkup, description="bad task", raiseError=True
            ).json["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            errorIds = [
                str(error["error_id"])
                for error in luna3client.getTaskErrors(taskId=taskId).json["errors"]
            ]

            response = luna3client.getErrorsCount(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                errorIds=errorIds,
                taskIds=[
                    taskId,
                ],
                errorTimeGte="2018-08-11T09:11:41.674Z",
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/errors/count' \
             --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
             --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
             --header 'Content-Type: application/json' \
             --data '{"errors": [{"error_id": "1092,1091", "task_id": 1753, "error_time__gte": "2018-08-11T09:11:41.674Z"}]}'

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorCount'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - task errors
      summary: task errors count options
      description: Get options for the resource.
      operationId: getTasksErrorsCountOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/errors/{error_id}:
    parameters:
      - in: path
        name: error_id
        schema:
          type: integer
          minimum: 1
        required: true
        description: Error ID.

    get:
      tags:
        - task errors
      summary: get error
      description: Get error by ID.
      operationId: getTaskError
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/error_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import time
            from uuid import uuid4

            baseUri = "http://127.0.0.1:5000/6"

            # create bad task
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            payload = {
                "description": "matching famous people with customers",
                "content": {
                    "markup": [
                        {"face_id": str(uuid4()), "label": 1},
                        {"face_id": str(uuid4()), "label": 2},
                    ],
                },
            }
            url = f"{baseUri}/tasks/roc"
            taskId = requests.post(url, headers=headers, json=payload).json()["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            # get tasks error id list
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/{taskId}/errors"
            response = requests.get(url, headers=headers)
            errorId = [
                str(error["error_id"]) for error in response.json()["errors"]
            ][0]

            url = f"{baseUri}/tasks/errors/{errorId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from uuid import uuid4
            import time

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            badMarkup = []
            for label, face in enumerate([str(uuid4()) for _ in range(2)]):
                badMarkup.append({"face_id": face, "label": label})
            taskId = luna3client.createROCTask(
                markup=badMarkup, description="bad task", raiseError=True
            ).json["task_id"]

            # wait for tasks to complete
            time.sleep(5)

            errorId = [
                error["error_id"]
                for error in luna3client.getTaskErrors(taskId=taskId).json["errors"]
            ][0]

            response = luna3client.getError(
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                errorId=errorId,
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/errors/11114' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskError'
              example:
                error_id: 5808750
                task_id: 14980
                subtask_id: 69825
                error_code: 28010
                description: "Objects not found"
                detail: "Objects for clustering not found (empty set)"
                additional_info: null
                error_time: "2019-04-29T10:53:42.417396+03:00"
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28010"
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Task not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query_param:
                  value:
                    error_code: 28001
                    desc: Object not found
                    detail: Task with id '146' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - task errors
      summary: error options
      description: Get options for the resource.
      operationId: getTasksErrorsOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/schedules:
    post:
      tags:
      - task schedules

      summary: create tasks schedule
      description: |
        Create a new task schedule.

        Execution of scheduled tasks will be regulated according to the trigger and optionally starts one task 
        immediately (see *start_immediately* parameter in *behavior* section).

        No task from the schedule will be executed if the previous task has not yet been completed.
        
        Permissions for task objects.

      operationId: createSchedule
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/applicationJsonContent'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
        
            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            payload = {
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 0,
                        "objects_type": "faces",
                        "list_id": listId,
                        "filters": {
                            "face_ids": [faceId],
                        },
                    },
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": False, "create_stopped": False}
                
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/schedules"
            response = requests.post(url, headers=headers, json=payload)
            scheduleId = response.json()["schedule_id"]
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            contentKwargs = dict(
                filters=FaceFilters(listId=listId, faceIds=[faceId]),
                listId=listId,
            )
            response = luna3client.createSchedule(
                taskType=1,
                contentKwargs=contentKwargs,
                cron="5 4 * * *",
                cronTz="utc",
                startImmediately=False,
                createStopped=False,
            )
            scheduleId = response.json["schedule_id"]           
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/tasks/schedules' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 1,
                        "objects_type": "faces",
                        "filters": {
                            "create_time__gte": "2018-08-11T09:11:41.674Z"
                        }
                    }
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": false, "create_stopped": false}
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schedule'
            examples:
              gc_task:
                summary: gc task. remove events older than 30 days
                value:
                  {
                      "task": {
                        "notification_policy": {
                          "enable": 1,
                          "task_callbacks": [
                            {
                              "type": "http",
                              "authorization": {
                                "type": "basic",
                                "login": "string",
                                "password": "string"
                              },
                              "url": "../dictionary",
                              "params": {
                                "timeout": 60,
                                "content_type": "application/json",
                                "headers": { }
                              },
                              "enable": 1
                            }
                          ],
                          "subtask_callbacks": [
                            {
                              "type": "http",
                              "authorization": {
                                "type": "basic",
                                "login": "string",
                                "password": "string"
                              },
                              "url": "../dictionary",
                              "params": {
                                "timeout": 60,
                                "content_type": "application/json",
                                "headers": { }
                              },
                              "enable": 1,
                            }
                          ]
                        },
                          "task_type": 4,
                          "content": {
                              "target": "events",
                              "filters": {
                                  "create_time__lt": "now-30d"
                              },
                              "remove_samples": true,
                              "remove_image_origins": true
                          }
                      },
                      "trigger": {"cron": "30 5 * * *", "cron_timezone": "utc"},
                      "behaviour": {"start_immediately": false, "create_stopped": false}
                  }
              linker_task:
                summary: linker task
                value:
                  {
                      "task": {
                        "notification_policy": {
                          "enable": 1,
                          "task_callbacks": [
                            {
                              "type": "http",
                              "authorization": {
                                "type": "basic",
                                "login": "string",
                                "password": "string"
                              },
                              "url": "../dictionary",
                              "params": {
                                "timeout": 60,
                                "content_type": "application/json",
                                "headers": { }
                              },
                              "enable": 1
                            }
                          ],
                          "subtask_callbacks": [
                            {
                              "type": "http",
                              "authorization": {
                                "type": "basic",
                                "login": "string",
                                "password": "string"
                              },
                              "url": "../dictionary",
                              "params": {
                                "timeout": 60,
                                "content_type": "application/json",
                                "headers": { }
                              },
                              "enable": 1,
                            }
                          ]
                        },
                          "task_type": 1,
                          "content": {
                              "create_list": 1,
                              "user_data": "list of good persons",
                              "objects_type": "faces",
                              "filters": {
                                  "create_time__gte": "2021-08-11T09:11:41.674Z",
                                  "face_ids": [
                                      "79203b7e-456a-4731-bc00-a25a3b264246"
                                  ],
                                  "external_ids": [
                                      "14159261415926"
                                  ],
                                  "user_data": "info",
                                  "face_id__gte": "a0ec5fa8-1801-4956-b357-d89550146b4c"
                              }
                          }
                      },
                      "trigger": {
                          "cron": "45 2 * * 5",
                          "cron_timezone": "utc"
                      },
                      "behaviour": {
                          "start_immediately": false,
                          "create_stopped": false
                      }
                  }
              estimator_task:
                summary: estimator task
                value:
                  {
                      "task": {
                        "notification_policy": {
                          "enable": 1,
                          "task_callbacks": [
                            {
                              "type": "http",
                              "authorization": {
                                "type": "basic",
                                "login": "string",
                                "password": "string"
                              },
                              "url": "../dictionary",
                              "params": {
                                "timeout": 60,
                                "content_type": "application/json",
                                "headers": { }
                              },
                              "enable": 1
                            }
                          ],
                          "subtask_callbacks": [
                            {
                              "type": "http",
                              "authorization": {
                                "type": "basic",
                                "login": "string",
                                "password": "string"
                              },
                              "url": "../dictionary",
                              "params": {
                                "timeout": 60,
                                "content_type": "application/json",
                                "headers": { }
                              },
                              "enable": 1,
                            }
                          ]
                        },
                          "task_type": 9,
                          "content": {
                              "handler": {
                                  "handler_id": "c42ad7cb-9078-4be4-8457-4d3c744477df"
                              },
                              "source": {
                                  "source_type": "network_disk",
                                  "reference": {
                                      "path": "/mnt/nfs_volume/pictures",
                                      "prefix": "portraits",
                                      "postfix": ".jpg"
                                  },
                                  "recursive": true
                              }
                          }
                      },
                      "trigger": {
                          "cron": "0 9 1,15 * 1",
                          "cron_timezone": "utc"
                      },
                      "behaviour": {
                          "start_immediately": false,
                          "create_stopped": false
                      }
                  }
        required: true

      responses:
        201:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                type: object
                properties:
                  schedule_id:
                    $ref: '#/components/schemas/schedule_id'
                required:
                - schedule_id
        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:
                account_id_not_found:
                  value:
                    error_code: 11066
                    desc: Bad/incomplete input data
                    detail: Luna-Account-Id header not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11066"
                bad_account_id:
                  value:
                    error_code: 11037
                    desc: Bad/incomplete input data
                    detail: "Luna-Account-Id header is not UUID, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11037"
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
      - task schedules

      summary: get tasks schedules
      description: Get tasks schedules with filters.
      operationId: getTasksSchedules
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/page_size'
      - $ref: '#/components/parameters/task_type_schedulable'
      - $ref: '#/components/parameters/create_time__lt'
      - $ref: '#/components/parameters/create_time__gte'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                    "create_time__lt": "2018-08-11T09:11:41.674Z", 
                    "create_time_gte": "2050-08-11T09:11:41.674Z",
                    "task_type": 1,
            }
            url = f"{baseUri}/tasks/schedules"
            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            response = luna3client.getSchedules(
                createTimeLt="2018-08-11T09:11:41.674Z",
                createTimeGte="2050-08-11T09:11:41.674Z",
                taskType=1
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/schedules' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                    "create_time__lt": "2050-08-11T09:11:41.674Z", 
                    "create_time_gte": "2018-08-11T09:11:41.674Z",
                    "task_type": 1,
            }'
      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/schedules_reply'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - task schedules
      summary: schedules options
      description: Get options for the resource.
      operationId: getSchedulesOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/tasks/schedules/{schedule_id}:
    parameters:
      - $ref: '#/components/parameters/schedule_id_path'

    get:
      tags:
      - task schedules

      summary: get tasks schedule
      description: Get tasks schedule by ID.
      operationId: getTasksSchedule
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            payload = {
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 1,
                        "objects_type": "faces",
                        "filters": {
                            "create_time__gte": "2018-08-11T09:11:41.674Z"
                        },
                    },
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": False, "create_stopped": False}
                
            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/schedules"
            response = requests.post(url, headers=headers, json=payload)
            scheduleId = response.json()["schedule_id"]
            
            url = f"{baseUri}/tasks/schedules/{scheduleId}"
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            contentKwargs = dict(
                filters=FaceFilters(createTimeGte="2018-08-11T09:11:41.674Z"), createList=1
            )
            response = luna3client.createSchedule(
                taskType=1,
                contentKwargs=contentKwargs,
                cron="5 4 * * *",
                cronTz="utc",
                startImmediately=False,
                createStopped=False,
            )
            scheduleId = response.json["schedule_id"] 
            response = luna3client.getSchedule(
                scheduleId=scheduleId
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/tasks/schedules/12345' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json'
      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/schedule_reply'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: object 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'
              examples:
                object_not_found:
                  value:
                    error_code: 28040
                    desc: Object not found
                    detail: Schedule with id '12345' not found'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28040
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    put:
      tags:
      - task schedules

      summary: replace tasks schedule
      description: |
        Replace tasks schedule:
        
        - if any task created by old schedule is running, it will be cancelled
        
        - schedule parameters will be replaced with the new ones
        
        - tasks will be executed according to the new schedule
      operationId: putTasksSchedule
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            payload = {
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 0,
                        "objects_type": "faces",
                        "list_id": listId,
                        "filters": {
                            "face_ids": [faceId],
                        },
                    },
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": False, "create_stopped": False}

            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/schedules"
            response = requests.post(url, headers=headers, json=payload)
            scheduleId = response.json()["schedule_id"]
            
            # Put schedule
            payload.update({"trigger": {"cron": "0 * * * *", "cron_timezone": "utc"}})
            response = requests.put(url + f"/{scheduleId}", headers=headers, json=payload)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            faceFilters = FaceFilters(
                listId=listId,
                faceIds=[
                    faceId,
                ],
            )
            contentKwargs = dict(
                filters=FaceFilters(listId=listId, faceIds=[faceId]),
                listId=listId,
            )
            response = luna3client.createSchedule(
                taskType=1,
                contentKwargs=contentKwargs,
                cron="5 4 * * *",
                cronTz="utc",
                startImmediately=False,
                createStopped=False,
                raiseError=True,
            )
            scheduleId = response.json["schedule_id"]
            
            # Put schedule
            cron = "0 * * * *"
            response = luna3client.putSchedule(
                scheduleId=scheduleId,
                taskType=1,
                contentKwargs=contentKwargs,
                cron="5 4 * * *",
                cronTz="utc",
                startImmediately=False,
                createStopped=False,
            )
            
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request PUT 'http://127.0.0.1:5000/6/tasks/schedules/12345' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 1,
                        "objects_type": "faces",
                        "filters": {
                            "create_time__gte": "2018-08-11T09:11:41.674Z"
                        }
                    }
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": false, "create_stopped": false}
            }'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schedule'
        required: true

      responses:
        200:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
          content:
            application/json:
              schema:
                type: object
                properties:
                  schedule_id:
                    $ref: '#/components/schemas/schedule_id'
                required:
                  - schedule_id
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Object 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'
              examples:
                object_not_found:
                  value:
                    error_code: 28040
                    desc: Object not found
                    detail: Schedule with id '12345' not found'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28040
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    patch:
      tags:
      - task schedules

      summary: patch tasks schedule
      description: Pause/start tasks schedule.
      operationId: patchTasksSchedule
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      - $ref: '#/components/parameters/schedule_patch'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            payload = {
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 0,
                        "objects_type": "faces",
                        "list_id": listId,
                        "filters": {
                            "face_ids": [faceId],
                        },
                    },
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": False, "create_stopped": False}

            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/schedules"
            response = requests.post(url, headers=headers, json=payload)
            scheduleId = response.json()["schedule_id"]

            # Patch schedule
            params = {"action": "pause"}
            response = requests.patch(url + f"/{scheduleId}", headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            faceFilters = FaceFilters(
                listId=listId,
                faceIds=[
                    faceId,
                ],
            )
            contentKwargs = dict(
                filters=FaceFilters(listId=listId, faceIds=[faceId]),
                listId=listId,
            )
            response = luna3client.createSchedule(
                taskType=1,
                contentKwargs=contentKwargs,
                cron="5 4 * * *",
                cronTz="utc",
                startImmediately=False,
                createStopped=False,
                raiseError=True,
            )
            scheduleId = response.json["schedule_id"]

            # Patch schedule
            response = luna3client.patchSchedule(
                scheduleId=scheduleId,
                action="pause"
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request PATCH 'http://127.0.0.1:5000/6/tasks/schedules/12345?action=pause' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json'
      responses:
        204:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: object 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'
              examples:
                object_not_found:
                  value:
                    error_code: 28040
                    desc: Object not found
                    detail: Schedule with id '12345' not found'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28040
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
      - task schedules

      summary: delete tasks schedule
      description: Delete tasks schedule.
      operationId: deleteTasksSchedule
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }

            # create list
            url = f"{baseUri}/lists"
            listId = requests.post(url, headers=headers).json()["list_id"]

            # create face
            url = f"{baseUri}/faces"
            faceId = requests.post(url, headers=headers).json()["face_id"]

            payload = {
                "task": {
                    "task_type": 1,
                    "content": {
                        "create_list": 0,
                        "objects_type": "faces",
                        "list_id": listId,
                        "filters": {
                            "face_ids": [faceId],
                        },
                    },
                },
                "trigger": {"cron": "5 4 * * *", "cron_timezone": "utc"},
                "behaviour": {"start_immediately": False, "create_stopped": False}

            }

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/tasks/schedules"
            response = requests.post(url, headers=headers, json=payload)
            scheduleId = response.json()["schedule_id"]

            # Delete schedule
            payload = {"action": "pause"}
            response = requests.delete(url + f"/{scheduleId}", headers=headers, json=payload)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import FaceFilters

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            listId = luna3client.createList(raiseError=True).json["list_id"]
            faceId = luna3client.createFace(raiseError=True).json["face_id"]

            faceFilters = FaceFilters(
                listId=listId,
                faceIds=[
                    faceId,
                ],
            )
            contentKwargs = dict(
                filters=FaceFilters(listId=listId, faceIds=[faceId]),
                listId=listId,
            )
            response = luna3client.createSchedule(
                taskType=1,
                contentKwargs=contentKwargs,
                cron="5 4 * * *",
                cronTz="utc",
                startImmediately=False,
                createStopped=False,
                raiseError=True,
            )
            scheduleId = response.json["schedule_id"]

            # Delete schedule
            response = luna3client.deleteSchedule(
                scheduleId=scheduleId,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/tasks/schedules/12345' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json'
      responses:
        204:
          description: OK
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        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'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
        403:
          $ref: '#/components/responses/forbidden_tasks_error'
        404:
          description: Object 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'
              examples:
                object_not_found:
                  value:
                    error_code: 28040
                    desc: Object not found
                    detail: Schedule with id '12345' not found'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-28040
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - task schedules
      summary: schedule options
      description: Get options for the resource.
      operationId: getScheduleOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/verifiers:
    post:
      tags:
        - verifiers
      summary: create verifier
      description: |
        Create a verifier.

        The verifier determines a list of rules for
        processing and verification of input images.

        You can set:

          - verification_threshold
          - detect_policy
          - extract_policy
          - storage_policy for attributes and face samples.

        The created handler can be used in "raw verification" and "perform verification" requests.

      operationId: createVerifier
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            response = requests.post(url, json=payload, headers=headers)
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            response = luna3client.createVerifier(description="new verifier", policies=policies)
            verifierId = response.json["verifier_id"]

            print(response.statusCode)
            print(verifierId)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/verifiers' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }'
      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  verifier_id:
                    $ref: '#/components/schemas/uuid'
                  url:
                    type: string
                    format: uri-reference
                  external_url:
                    $ref: '#/components/schemas/external_url'
                required:
                  - verifier_id
                  - url
                  - external_url
              example:
                verifier_id: b5d6fd45-fcca-453d-ac05-3e594054b813
                url: /6/verifiers/b5d6fd45-fcca-453d-ac05-3e594054b813
                external_url: http://127.0.0.1:5000/6/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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                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'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
        - verifiers
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/description'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/page_size'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            requests.post(url, json=payload, headers=headers)

            # get verifiers
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True)

            # get verifiers
            response = luna3client.getVerifiers()

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/verifiers' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      summary: get verifiers
      description: Get verifiers by filters.
      operationId: getVerifiers
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/verifier_response'
              example:
                - verifier_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                  account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                  description: "simple verifier"
                  policies:
                    verification_threshold: 0.99
                    detect_policy:
                      multiface_policy: 0
                      estimate_head_pose: 0
                      estimate_emotions: 0
                      estimate_mask: 0
                      estimate_quality: 0
                      estimate_gaze: 0
                      estimate_eyes_attributes: 0
                      estimate_mouth_attributes: 0
                      detect_landmarks68: 0
                      extract_exif: 0
                      yaw_threshold: 180
                      roll_threshold: 180
                      pitch_threshold: 180
                      mask_states: [ 1 ]
                      estimate_liveness:
                        estimate: 1
                        quality_threshold: 0.7
                        liveness_threshold: 0.7
                      liveness_states: [ 1 ]
                      estimate_deepfake:
                        estimate: 1
                        real_threshold: 0.7
                        mode: 2
                      deepfake_states: [ 1 ]
                      face_quality:
                        estimate: 1
                        filter: 0
                        checks:
                          image_format:
                            estimate: 1
                            threshold: ["JPEG", "JPEG2000", "PNG"]
                          illumination_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          specularity_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          blurriness_quality:
                            estimate: 1
                            threshold:
                              min: 0.61
                              max: 1.0
                          dark_quality:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          light_quality:
                            estimate: 1
                            threshold:
                              min: 0.57
                              max: 0.9
                          head_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_roll:
                            estimate: 1
                            threshold:
                              min: -8
                              max: 8
                          gaze_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          gaze_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          mouth_smiling:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_occluded:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_open:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          glasses:
                            estimate: 1
                            threshold: ["no_glasses", "eyeglasses"]
                          left_eye:
                            estimate: 1
                            threshold: ["open"]
                          right_eye:
                            estimate: 1
                            threshold: ["open"]
                          head_horizontal_center:
                            estimate: 1
                            threshold:
                              min: 0.45
                              max: 0.55
                          head_vertical_center:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 0.5
                          head_width:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 0.75
                          head_height:
                            estimate: 1
                            threshold:
                              min: 0.6
                              max: 0.9
                          eye_distance:
                            estimate: 1
                            threshold:
                              min: 90
                              max: 1920
                          image_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          image_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1080
                          aspect_ratio:
                            estimate: 1
                            threshold:
                              min: 0.74
                              max: 0.8
                          face_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          face_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          indent_left:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_right:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_upper:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_lower:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          image_size:
                            estimate: 1
                            threshold:
                              min: 5120
                              max: 2097152
                          eyebrows_state:
                            estimate: 1
                            threshold: [ "neutral" ]
                          smile_properties:
                            estimate: 1
                            threshold: [ "none" ]
                          headwear_type:
                            estimate: 1
                            threshold: [ "none" ]
                          natural_light:
                            estimate: 1
                            threshold: 1
                          radial_distortion:
                            estimate: 1
                            threshold: 0
                          red_eyes:
                            estimate: 1
                            threshold: 0
                          face_color_type:
                            estimate: 1
                            threshold: [ "color" ]
                          illumination_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          dynamic_range:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          background_lightness:
                            estimate: 1
                            threshold:
                              min: 0.2
                              max: 1.0
                          background_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                    extract_policy:
                      extract_basic_attributes: 1
                      fd_score_threshold: 0.7
                    storage_policy:
                      attribute_policy:
                        store_attribute: 0
                      face_sample_policy:
                        store_sample: 0
                  create_time: "2019-08-24T14:15:22Z"
                  last_update_time: "2019-08-24T14:15:22Z"
                  version: 111
                - verifier_id: "a48609f8-860f-412d-abab-9abfdb517e67"
                  account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                  create_time: "2021-06-18T22:05:06.324756+03:00"
                  last_update_time: "2021-06-18T22:05:06.324756+03:00"
                  description: "AAAac93c7fe-cda1-44b3-bcac-2421e3cb5924BBB"
                  policies:
                    detect_policy:
                      multiface_policy: 1
                      estimate_head_pose: 0
                      estimate_emotions: 0
                      estimate_mask: 0
                      estimate_quality: 0
                      estimate_gaze: 0
                      estimate_eyes_attributes: 0
                      estimate_mouth_attributes: 0
                      detect_landmarks68: 0
                      extract_exif: 0
                      pitch_threshold: null
                      roll_threshold: null
                      yaw_threshold: null
                      mask_states: null
                      estimate_liveness:
                        estimate: 0
                        quality_threshold: 0.7
                        liveness_threshold: 0.7
                      liveness_states: null
                      estimate_deepfake:
                        estimate: 1
                        real_threshold: 0.7
                        mode: 2
                      deepfake_states: [ 1 ]
                      face_quality:
                        estimate: 1
                        filter: 0
                        checks:
                          image_format:
                            estimate: 1
                            threshold: ["JPEG", "JPEG2000", "PNG"]
                          illumination_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          specularity_quality:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 1.0
                          blurriness_quality:
                            estimate: 1
                            threshold:
                              min: 0.61
                              max: 1.0
                          dark_quality:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          light_quality:
                            estimate: 1
                            threshold:
                              min: 0.57
                              max: 0.9
                          head_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          head_roll:
                            estimate: 1
                            threshold:
                              min: -8
                              max: 8
                          gaze_yaw:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          gaze_pitch:
                            estimate: 1
                            threshold:
                              min: -5
                              max: 5
                          mouth_smiling:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_occluded:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          mouth_open:
                            estimate: 1
                            threshold:
                              min: 0.0
                              max: 0.5
                          glasses:
                            estimate: 1
                            threshold: ["no_glasses", "eyeglasses"]
                          left_eye:
                            estimate: 1
                            threshold: ["open"]
                          right_eye:
                            estimate: 1
                            threshold: ["open"]
                          head_horizontal_center:
                            estimate: 1
                            threshold:
                              min: 0.45
                              max: 0.55
                          head_vertical_center:
                            estimate: 1
                            threshold:
                              min: 0.3
                              max: 0.5
                          head_width:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 0.75
                          head_height:
                            estimate: 1
                            threshold:
                              min: 0.6
                              max: 0.9
                          eye_distance:
                            estimate: 1
                            threshold:
                              min: 90
                              max: 1920
                          image_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          image_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1080
                          aspect_ratio:
                            estimate: 1
                            threshold:
                              min: 0.74
                              max: 0.8
                          face_width:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          face_height:
                            estimate: 1
                            threshold:
                              min: 180
                              max: 1920
                          indent_left:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_right:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_upper:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          indent_lower:
                            estimate: 1
                            threshold:
                              min: 20
                              max: 1920
                          image_size:
                            estimate: 1
                            threshold:
                              min: 5120
                              max: 2097152
                          eyebrows_state:
                            estimate: 1
                            threshold: [ "neutral" ]
                          smile_properties:
                            estimate: 1
                            threshold: [ "none" ]
                          headwear_type:
                            estimate: 1
                            threshold: [ "none" ]
                          natural_light:
                            estimate: 1
                            threshold: 1
                          radial_distortion:
                            estimate: 1
                            threshold: 0
                          red_eyes:
                            estimate: 1
                            threshold: 0
                          face_color_type:
                            estimate: 1
                            threshold: [ "color" ]
                          illumination_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          dynamic_range:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                          background_lightness:
                            estimate: 1
                            threshold:
                              min: 0.2
                              max: 1.0
                          background_uniformity:
                            estimate: 1
                            threshold:
                              min: 0.5
                              max: 1.0
                    extract_policy:
                      extract_basic_attributes: 0
                      fd_score_threshold: 0.0
                    storage_policy:
                      attribute_policy:
                        store_attribute: 0
                      face_sample_policy:
                        store_sample: 0
                    verification_threshold: 0.9
                  version: 0
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - verifiers
      summary: verifiers options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

  /6/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: |
        This request performs verification of input descriptors.

        "Similarity" and "verification status" are returned for each candidate.

        "Verification status" is "True" if the received similarity is greater than the
        verification_threshold (specified in the verifier handler). Hence, the reference and the candidate are considered
        the same person.

        You should specify descriptors as references and candidates for this request.

      operationId: rawVerification
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/json_or_msgpack_content'
        - $ref: '#/components/parameters/luna_request_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import base64

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            response = requests.post(url, json=payload, headers=headers)
            verifierId = response.json()["verifier_id"]

            url = f"{url}/{verifierId}/raw"

            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            payload = {
                "references": [
                    {
                        "data": {"descriptor": descriptor, "version": 56},
                        "id": "reference_id",
                        "type": "raw_descriptor"
                    }
                ],
                "candidates": [
                    {
                        "data": {"descriptor": descriptor, "version": 56},
                        "id": "candidate_id",
                        "type": "raw_descriptor"
                    }
                ]
            }

            # verify raw with descriptor
            response = requests.post(url, json=payload, headers=headers)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)
            from luna3.lunavl.httpclient import LunaHttpClient
            from luna3.python_matcher.match_objects import RawDescriptorReference, RawDescriptor

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            verifierId = luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True).json["verifier_id"]

            with open("descriptor56", "rb") as file:
                descriptor = file.read()

            candidate = RawDescriptorReference(referenceId="candidate_id", descriptor=RawDescriptor(version=56, descriptor=descriptor))

            reference = RawDescriptorReference(referenceId="reference_id", descriptor=RawDescriptor(version=56, descriptor=descriptor))

            # verify raw with descriptor
            response = luna3client.verifyRaw(candidates=[candidate], references=[reference], verifierId=verifierId)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/verifiers/100ad8c3-7374-4d69-8ebf-23bcf9a97ccc/raw' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "references": [
                    {
                        "data": {"descriptor": "eJCHgXqOcYiPfXp4cnWCgnN4d2+Bgod4bXJ1en94g295e4iLgnxydHZwj4F3eIxygJB3iIqKh4BxeHhzh36KiImIgY2JdnyEfXh4hYyChoGGeGx5iXh4e4V5gISLjX2LhIOBf3B/i42KenmBhG93eX6Lg314e4SAfIuKd4uGfoWCgoN+iYB+gYGHiYWJfX+DhIt7g4Z6iXx8fntzg3l8gHSEfIZ4hX6JfoeFfoaFh36Ae4B5g4ODgJCHj3WCdISEgoh+inx+eYKFe4SFhXSEgoWIgn57eIF/eYF8hHuFg3p6dYKDf4F8gICCioOFeYaJgYR+gH1+g4V/g313g3mFfYJ9fHt2e4N/g3+Ae4OAgX97fYaHf3yAfHeCf4OAf4CAf4R7hn+EeX6EeoKGgn96gIOFg4CBg4OEe32EgX+BeoB/gH6Af4B/gX59fX2Ag399gH57g39/e4aAgH6BgX2DfX+Bf32Bg3qAfX9/hH15gHp+fn+ChIKBgH+BgoB+gX1/fn+Bg4CCf4CBfn58gH6CgX+BgIGCf31+gX1+f3+AfoCAe4OCfoF/foOBeoGDgYGAfIGBf4GBf4N7f3+Cgn6Af35/gYF/gH2BgIR/fn9/gIJ/f3uBfoN/gX6BgICAf39+gH6BgH5/gYOBfoGBgX98g4KBgoCAgH+Ae4B8f4B9fn0=", "version": 56},
                        "id": "reference_id",
                        "type": "raw_descriptor"
                    }
                ],
                "candidates": [
                    {
                        "data": {"descriptor": "eJCHgXqOcYiPfXp4cnWCgnN4d2+Bgod4bXJ1en94g295e4iLgnxydHZwj4F3eIxygJB3iIqKh4BxeHhzh36KiImIgY2JdnyEfXh4hYyChoGGeGx5iXh4e4V5gISLjX2LhIOBf3B/i42KenmBhG93eX6Lg314e4SAfIuKd4uGfoWCgoN+iYB+gYGHiYWJfX+DhIt7g4Z6iXx8fntzg3l8gHSEfIZ4hX6JfoeFfoaFh36Ae4B5g4ODgJCHj3WCdISEgoh+inx+eYKFe4SFhXSEgoWIgn57eIF/eYF8hHuFg3p6dYKDf4F8gICCioOFeYaJgYR+gH1+g4V/g313g3mFfYJ9fHt2e4N/g3+Ae4OAgX97fYaHf3yAfHeCf4OAf4CAf4R7hn+EeX6EeoKGgn96gIOFg4CBg4OEe32EgX+BeoB/gH6Af4B/gX59fX2Ag399gH57g39/e4aAgH6BgX2DfX+Bf32Bg3qAfX9/hH15gHp+fn+ChIKBgH+BgoB+gX1/fn+Bg4CCf4CBfn58gH6CgX+BgIGCf31+gX1+f3+AfoCAe4OCfoF/foOBeoGDgYGAfIGBf4GBf4N7f3+Cgn6Af35/gYF/gH2BgIR/fn9/gIJ/f3uBfoN/gX6BgICAf39+gH6BgH5/gYOBfoGBgX98g4KBgoCAgH+Ae4B8f4B9fn0=", "version": 56},
                        "id": "candidate_id",
                        "type": "raw_descriptor"
                    }
                ]
            }'

      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/raw_verification_response'
              example:
                matches:
                  - reference_id: "123456s"
                    matches:
                      - candidate_id: "31415926"
                        similarity: 0.5
                        status: true
                  - reference_id: "raw-1"
                    matches:
                      - candidate_id: "candidate"
                        similarity: 0.0210287365
                        status: false
                      - candidate_id: "sdk"
                        similarity: 0.0210287365
                        status: false
                      - candidate_id: "xpk"
                        similarity: 0.0210287365
                        status: false

        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                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'"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12022"
                bad_base64_for_one_descriptor:
                  value:
                    error_code: 18001
                    desc: Bad/incomplete input data
                    detail: Failed convert data from base64 to bytes
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-18001"
                wrong_descriptors_length:
                  value:
                    error_code: 12034
                    desc: Bad/incomplete input data
                    detail: Descriptor has incorrect length 200
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12034"
                bad_xpk_file:
                  value:
                    error_code: 12035
                    desc: Bad/incomplete input data
                    detail: Failed to parse xpk file
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12035"
                bad_sdk_descriptor:
                  value:
                    error_code: 12038
                    desc: Bad/incomplete input data
                    detail: SDK descriptor is not valid
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12038"
                xpk_does_not_contain_descriptor:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: XPK file does not contain descriptor
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
                unknown_descriptor_version:
                  value:
                    error_code: 12037
                    desc: Bad/incomplete input data
                    detail: Descriptor version 37 are not registered in the system
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12037"
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/verifier_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - verifiers
      summary: raw verification options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

  /6/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: faces IDs, events IDs, external IDs.

        "Similarity" and "verification status" are returned for each candidate.

        "Verification status" is "True" if the received similarity is greater than the
        verification_threshold (specified in the verifier handler). Hence, the reference and the candidate are considered
        the same person.

        The input images are processed according to the specified policies and the received information is returned in the response.

        Objects to be processed must belong to the user account making the request.

        Notes for incoming data:
          - face or body *bounding boxes* passed with face or body warped image will be ignored.

      operationId: postVerifier
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/face_ids'
        - $ref: '#/components/parameters/event_ids'
        - $ref: '#/components/parameters/attribute_ids'
        - $ref: '#/components/parameters/external_ids'
        - $ref: '#/components/parameters/raw_or_face_image_type'
        - $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
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import base64
            import json

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # create sample
            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
                "Content-Type": "image/jpeg",
            }

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            url = f"{baseUri}/detector"
            sampleId = requests.post(url, data=image, headers=headers).json()["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            # create attribute
            with open("descriptor56", "rb") as file:
                descriptor = base64.b64encode(file.read()).decode()

            headers = {
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            params = {
                "ttl": 600,
            }
            payload = {
                "basic_attributes": {
                    "age": 29,
                    "gender": 0,
                    "ethnicity": 3,
                },
                "basic_attributes_samples": [
                    sampleId,
                ],
                "face_descriptor_samples": [
                    sampleId,
                ],
                "face_descriptors": [
                    {"descriptor": descriptor, "version": 56},
                ],
            }
            url = f"{baseUri}/attributes"
            attributeId = requests.post(
                url, json=payload, headers=headers, params=params
            ).json()["attribute_id"]

            # create face
            payload = {
                "external_id": "2xQ2gprbMUePw1s9gw9fvA==",
                "attribute": {"attribute_id": attributeId},
            }
            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/faces"
            faceId = requests.post(
                url,
                headers=headers,
                json=payload,
            ).json()["face_id"]

            # create verifier
            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            response = requests.post(url, json=payload, headers=headers)
            verifierId = response.json()["verifier_id"]

            url = f"{url}/{verifierId}/verifications"

            with open("image.jpg", "rb") as image_file:
                image = image_file.read()

            faceBoundingBoxes = [{"filename": "image.jpg", "face_bounding_boxes": [{"x": 0, "y": 0, "width": 1000, "height": 1000}]}]

            files = {
                "image": ("image.jpg", image, "image/jpeg"),
                "face_bounding_boxes": ("face_bounding_boxes", json.dumps(faceBoundingBoxes), "application/json")
            }

            params = {"face_ids": [faceId]}

            # verify
            response = requests.post(url, files=files, params=params, headers=headers)

            print(response.status_code)
            print(response.json())

        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy,
                BinaryImage)
            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # create sample
            sampleId = luna3client.detectFaces(
                inputData=BinaryImage("image.jpg"),
                raiseError=True,
            ).json["images"][0]["detections"]["samples"][0]["face"]["sample_id"]

            attributeId = luna3client.extractAttrFromSample(
                sampleIds=[
                    sampleId,
                ],
                raiseError=True,
            ).json[0]["attribute_id"]

            # create face
            faceId = luna3client.createFace(
                attributeId=attributeId,
                raiseError=True,
            ).json["face_id"]

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            verifierId = luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True).json["verifier_id"]

            # verify
            response = luna3client.verifyData(verifierId=verifierId, faceIds=[faceId], inputData=BinaryImage(path="image.jpg"))

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request POST 'http://127.0.0.1:5000/6/verifiers/100ad8c3-7374-4d69-8ebf-23bcf9a97ccc/verifications?face_ids=95113f42-849d-4240-8493-00f125ae29e5' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: multipart/form-data' \
            --form 'image=@image.jpg'

      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verifier_id_verification_response'
              example:
                images:
                  - error:
                      error_code: 0
                      detail: "Success"
                      desc: "Success"
                      link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                    status: 1
                    filename: "penelope.jpeg"
                    exif:
                      make: Apple
                      model: iPhone 11
                      gps:
                        latitude: 55.0, 45.0, 18.29
                        longitude: 37.0, 39.0, 16.32
                      software: 13.6.1
                      orientation: 6
                    detections:
                      face_detections:
                        - verifications:
                            - similarity: 0.5
                              status: true
                              face:
                                face_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                          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"
                            score: 0
                            url: "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
                            samples: [ "a3e8716f-70dc-42ad-8428-7a552e800a37" ]
                          sample:
                            face:
                              rect:
                                height: 240
                                width: 209
                                x: 170
                                y: 198
                              sample_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                              url: "/6/samples/faces/a16c8b6c-2818-4bae-9fd5-65acc8d4bb5c"
                              attributes:
                                mouth_attributes:
                                  occluded: 0.0
                                  opened: 0.1
                                  score: 0.999999165534973
                                  smile: 0.2
                                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"
                                head_pose:
                                  pitch: 18.6827487945557
                                  roll: -10.3542232513428
                                  yaw: 15.4102487564087
                                gaze:
                                  pitch: 9.26744079589844
                                  yaw: -19.4657287597656
                              quality:
                                light: 0.87
                                dark: 0.13
                                illumination: 0.1
                                specularity: 0.1
                                blurriness: 0.2
                              landmarks5: [ [ 72, 72 ], [ 240, 240 ], [ 154, 154 ], [ 119, 119 ], [ 259, 259 ] ]
                              landmarks68: [
                                [ 8, 8 ], [ 14, 14 ], [ 28, 28 ], [ 48, 48 ], [ 72, 72 ], [ 102, 102 ], [ 134, 134 ], [ 168, 168 ], [ 213, 213 ], [ 262, 262 ],
                                [ 306, 306 ], [ 345, 345 ], [ 376, 376 ], [ 392, 392 ], [ 397, 397 ], [ 399, 399 ], [ 394, 394 ], [ 2, 2 ], [ 22, 22 ], [ 50, 50 ],
                                [ 79, 79 ], [ 106, 106 ], [ 165, 165 ], [ 199, 199 ], [ 236, 236 ], [ 278, 278 ], [ 317, 317 ], [ 137, 137 ], [ 136, 136 ],
                                [ 136, 136 ], [ 136, 136 ], [ 119, 119 ], [ 135, 135 ], [ 154, 154 ], [ 174, 174 ], [ 193, 193 ], [ 40, 40 ], [ 57, 57 ],
                                [ 83, 83 ], [ 108, 108 ], [ 84, 84 ], [ 58, 58 ], [ 203, 203 ], [ 222, 222 ], [ 249, 249 ], [ 277, 277 ], [ 258, 258 ], [ 229, 229 ],
                                [ 119, 119 ], [ 130, 130 ], [ 149, 149 ], [ 167, 167 ], [ 185, 185 ], [ 222, 222 ], [ 259, 259 ], [ 232, 232 ], [ 200, 200 ],
                                [ 177, 177 ], [ 155, 155 ], [ 134, 134 ], [ 127, 127 ], [ 152, 152 ], [ 170, 170 ], [ 190, 190 ], [ 250, 250 ], [ 193, 193 ],
                                [ 172, 172 ], [ 152, 152 ]
                              ]
                              face_quality:
                                status: 0
                                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.0
                                    result: 1
                                  - name: "specularity_quality"
                                    object_value: 0.7662366628646851
                                    threshold_value:
                                      min: 0.3
                                      max: 1.0
                                    result: 1
                                  - name: "blurriness_quality"
                                    object_value: 0.9429352283477783
                                    threshold_value:
                                      min: 0.61
                                      max: 1.0
                                    result: 1
                                  - name: "dark_quality"
                                    object_value: 0.9020983576774597
                                    threshold_value:
                                      min: 0.5
                                      max: 1.0
                                    result: 1
                                  - name: "light_quality"
                                    object_value: 0.7881984114646912
                                    threshold_value:
                                      min: 0.57
                                      max: 1.0
                                    result: 1
                                  - name: "head_yaw"
                                    object_value: 2.818983316421509
                                    threshold_value:
                                      min: -5
                                      max: 5
                                    result: 1
                                  - name: "head_pitch"
                                    object_value: 3.816443920135498
                                    threshold_value:
                                      min: -5
                                      max: 5
                                    result: 1
                                  - name: "head_roll"
                                    object_value: 5.434040069580078
                                    threshold_value:
                                      min: -8
                                      max: 8
                                    result: 1
                                  - name: "gaze_yaw"
                                    object_value: -3.773012399673462
                                    threshold_value:
                                      min: -5
                                      max: 5
                                    result: 1
                                  - name: "gaze_pitch"
                                    object_value: 0.7140519022941589
                                    threshold_value:
                                      min: -5
                                      max: 5
                                    result: 1
                                  - name: "mouth_smiling"
                                    object_value: 0.000290759839117527
                                    threshold_value:
                                      min: 0
                                      max: 0.5
                                    result: 1
                                  - name: "mouth_occluded"
                                    object_value: 0.00009619363845558837
                                    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
                                    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.6305162000656128
                                    threshold_value:
                                      min: 0.5
                                      max: 1.0
                                    result: 1
                                  - name: "dynamic_range"
                                    object_value: 0.5305162000656128
                                    threshold_value:
                                      min: 0.5
                                      max: 1.0
                                    result: 1
                      filtered_detections:
                        face_detections:
                          - filter_reasons:
                              - filter_name: "pitch_threshold"
                                object_value: 0
                                threshold_value: 0
                            detection:
                              filename: "1.jpg"
                              sample:
                                detection:
                                  attributes:
                                    mouth_attributes:
                                      occluded: 0.0
                                      opened: 0.2
                                      score: 0.999999165534973
                                      smile: 0.1
                                    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"
                                    head_pose:
                                      pitch: 18.6827487945557
                                      roll: -10.3542232513428
                                      yaw: 15.4102487564087
                                    gaze:
                                      pitch: 9.26744079589844
                                      yaw: -19.4657287597656
                                  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
                                  landmarks5: [ [ 72, 72 ], [ 240, 240 ], [ 154, 154 ], [ 119, 119 ], [ 259, 259 ] ]
                                  landmarks68: [
                                    [ 8, 8 ], [ 14, 14 ], [ 28, 28 ], [ 48, 48 ], [ 72, 72 ], [ 102, 102 ], [ 134, 134 ], [ 168, 168 ], [ 213, 213 ], [ 262, 262 ],
                                    [ 306, 306 ], [ 345, 345 ], [ 376, 376 ], [ 392, 392 ], [ 397, 397 ], [ 399, 399 ], [ 394, 394 ], [ 2, 2 ], [ 22, 22 ], [ 50, 50 ],
                                    [ 79, 79 ], [ 106, 106 ], [ 165, 165 ], [ 199, 199 ], [ 236, 236 ], [ 278, 278 ], [ 317, 317 ], [ 137, 137 ], [ 136, 136 ],
                                    [ 136, 136 ], [ 136, 136 ], [ 119, 119 ], [ 135, 135 ], [ 154, 154 ], [ 174, 174 ], [ 193, 193 ], [ 40, 40 ], [ 57, 57 ],
                                    [ 83, 83 ], [ 108, 108 ], [ 84, 84 ], [ 58, 58 ], [ 203, 203 ], [ 222, 222 ], [ 249, 249 ], [ 277, 277 ], [ 258, 258 ], [ 229, 229 ],
                                    [ 119, 119 ], [ 130, 130 ], [ 149, 149 ], [ 167, 167 ], [ 185, 185 ], [ 222, 222 ], [ 259, 259 ], [ 232, 232 ], [ 200, 200 ],
                                    [ 177, 177 ], [ 155, 155 ], [ 134, 134 ], [ 127, 127 ], [ 152, 152 ], [ 170, 170 ], [ 190, 190 ], [ 250, 250 ], [ 193, 193 ],
                                    [ 172, 172 ], [ 152, 152 ]
                                  ]
                                  face_quality:
                                    status: 0
                                    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: 0.4
                                        result: 1
                                      - name: "specularity_quality"
                                        object_value: 0.7662366628646851
                                        threshold_value:
                                          min: 0.3
                                          max: 1.0
                                        result: 1
                                      - name: "blurriness_quality"
                                        object_value: 0.9429352283477783
                                        threshold_value:
                                          min: 0.61
                                          max: 1.0
                                        result: 1
                                      - name: "dark_quality"
                                        object_value: 0.9020983576774597
                                        threshold_value:
                                          min: 0.5
                                          max: 1.0
                                        result: 1
                                      - name: "light_quality"
                                        object_value: 0.7881984114646912
                                        threshold_value:
                                          min: 0.57
                                          max: 1.0
                                        result: 1
                                      - name: "head_yaw"
                                        object_value: 2.818983316421509
                                        threshold_value:
                                          min: -5
                                          max: 5
                                        result: 1
                                      - name: "head_pitch"
                                        object_value: 3.816443920135498
                                        threshold_value:
                                          min: -5
                                          max: 5
                                        result: 1
                                      - name: "head_roll"
                                        object_value: 5.434040069580078
                                        threshold_value:
                                          min: -8
                                          max: 8
                                        result: 1
                                      - name: "gaze_yaw"
                                        object_value: -3.773012399673462
                                        threshold_value:
                                          min: -5
                                          max: 5
                                        result: 1
                                      - name: "gaze_pitch"
                                        object_value: 0.7140519022941589
                                        threshold_value:
                                          min: -5
                                          max: 5
                                        result: 1
                                      - name: "mouth_smiling"
                                        object_value: 0.000290759839117527
                                        threshold_value:
                                          min: 0
                                          max: 0.5
                                        result: 1
                                      - name: "mouth_occluded"
                                        object_value: 0.00009619363845558837
                                        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.7305162000656128
                                        threshold_value:
                                          min: 0.5
                                          max: 1.0
                                        result: 1
                                      - name: "dynamic_range"
                                        object_value: 0.6305162000656128
                                        threshold_value:
                                          min: 0.5
                                          max: 1.0
                                        result: 1
                  - error:
                      error_code: 0
                      desc: "Success"
                      detail: "Success"
                      link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-0"
                    status: 1
                    filename: "raw image"
                    detections:
                      face_detections:
                        - sample:
                            face:
                              url: null,
                              sample_id: null
                              rect:
                                x: 70
                                y: 40
                                width: 135
                                height: 181
                          verifications:
                            - similarity: 1.0
                              status: true
                              face:
                                face_id: "d05dd4eb-05e2-4962-9a91-7a665a2b3d67"
                            - similarity: 0.9951737645
                              status: true
                              face:
                                face_id: "ed654332-f8ab-4030-b9bf-654d6790f865"
                            - similarity: 0.9934924273
                              status: true
                              face:
                                face_id: "14abd41f-6fe6-445d-b9eb-95d010c42ca9"
                            - similarity: 0.9912151812
                              status: true
                              face:
                                face_id: "c3618a84-e854-40a3-a12b-8c817652f941"
                            - similarity: 0.9894505146
                              status: true
                              face:
                                face_id: "280e3988-c26a-4cbd-beeb-4dfa9c6e211c"
                          face_attributes:
                            samples: [ ]
                            attribute_id: null
                            url: null
                            score: 0.9952012300491333
                      filtered_detections:
                        face_detections: [ ]
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
                no_candidates:
                  value:
                    error_code: 34006
                    desc: Bad/incomplete input data
                    detail: No candidates specified
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-34006"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Forbidden.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                auth_required:
                  value:
                    error_code: 12010
                    desc: Bad/incomplete input data
                    detail: "This resource needs 'Authorization' authorization headers"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12010"
                license_problem:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                liveness:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                deepfake:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Deepfake feature disabled"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055"
                lis_is_disabled:
                  value:
                    error_code: 11070
                    desc: Forbidden
                    detail: Luna Image Store service is disabled
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"
                handlers_is_disabled:
                  value:
                    error_code: 11071
                    desc: Forbidden
                    detail: Luna Image Store service is disabled
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11070"
        404:
          $ref: '#/components/responses/verifier_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - verifiers
      summary: verification options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

  /6/verifiers/count:
    get:
      tags:
        - verifiers
      summary: count verifiers
      description: Count verifiers that satisfy the filters.
      operationId: countVerifiers
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/description'
        - $ref: '#/components/parameters/luna_request_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            requests.post(url, json=payload, headers=headers)

            url = f"{url}/count"

            # get verifiers count
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True)

            # get verifiers count
            response = luna3client.getVerifiersCount()

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/verifiers/count' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verifiers_count'
        400:
          description: Bad request.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - verifiers
      summary: count verifiers options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

  /6/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
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            response = requests.post(url, json=payload, headers=headers)
            verifierId = response.json()["verifier_id"]

            url = f"{url}/{verifierId}"

            # get verifier
            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            verifierId = luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True).json["verifier_id"]

            # get verifier
            response = luna3client.getVerifier(verifierId=verifierId)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/verifiers/100ad8c3-7374-4d69-8ebf-23bcf9a97ccc' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verifier_response'
              example:
                verifier_id: "b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                account_id: "0468ca85-f6ca-4841-b30c-5ccc26b6f397"
                description: "simple verifier"
                policies:
                  verification_threshold: 0.99
                  detect_policy:
                    multiface_policy: 0
                    estimate_head_pose: 0
                    estimate_emotions: 0
                    estimate_mask: 0
                    estimate_quality: 0
                    estimate_gaze: 0
                    estimate_eyes_attributes: 0
                    estimate_mouth_attributes: 0
                    detect_landmarks68: 0
                    extract_exif: 0
                    yaw_threshold: 180
                    roll_threshold: 180
                    pitch_threshold: 180
                    mask_states: [ 1 ]
                    estimate_liveness:
                      estimate: 1
                      quality_threshold: 0.7
                      liveness_threshold: 0.7
                    liveness_states: [ 1 ]
                    estimate_deepfake:
                      estimate: 1
                      real_threshold: 0.7
                      mode: 2
                    deepfake_states: [ 1 ]
                    face_quality:
                      estimate: 1
                      filter: 0
                      checks:
                        image_format:
                          estimate: 1
                          threshold: ["JPEG", "JPEG2000", "PNG"]
                        illumination_quality:
                          estimate: 1
                          threshold:
                            min: 0.3
                            max: 1.0
                        specularity_quality:
                          estimate: 1
                          threshold:
                            min: 0.3
                            max: 1.0
                        blurriness_quality:
                          estimate: 1
                          threshold:
                            min: 0.61
                            max: 1.0
                        dark_quality:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        light_quality:
                          estimate: 1
                          threshold:
                            min: 0.57
                            max: 0.9
                        head_yaw:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        head_pitch:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        head_roll:
                          estimate: 1
                          threshold:
                            min: -8
                            max: 8
                        gaze_yaw:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        gaze_pitch:
                          estimate: 1
                          threshold:
                            min: -5
                            max: 5
                        mouth_smiling:
                          estimate: 1
                          threshold:
                            min: 0.0
                            max: 0.5
                        mouth_occluded:
                          estimate: 1
                          threshold:
                            min: 0.0
                            max: 0.5
                        mouth_open:
                          estimate: 1
                          threshold:
                            min: 0.0
                            max: 0.5
                        glasses:
                          estimate: 1
                          threshold: ["no_glasses", "eyeglasses"]
                        left_eye:
                          estimate: 1
                          threshold: ["open"]
                        right_eye:
                          estimate: 1
                          threshold: ["open"]
                        head_horizontal_center:
                          estimate: 1
                          threshold:
                            min: 0.45
                            max: 0.55
                        head_vertical_center:
                          estimate: 1
                          threshold:
                            min: 0.3
                            max: 0.5
                        head_width:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 0.75
                        head_height:
                          estimate: 1
                          threshold:
                            min: 0.6
                            max: 0.9
                        eye_distance:
                          estimate: 1
                          threshold:
                            min: 90
                            max: 1920
                        image_width:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1920
                        image_height:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1080
                        aspect_ratio:
                          estimate: 1
                          threshold:
                            min: 0.74
                            max: 0.8
                        face_width:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1920
                        face_height:
                          estimate: 1
                          threshold:
                            min: 180
                            max: 1920
                        indent_left:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        indent_right:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        indent_upper:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        indent_lower:
                          estimate: 1
                          threshold:
                            min: 20
                            max: 1920
                        image_size:
                          estimate: 1
                          threshold:
                            min: 5120
                            max: 2097152
                        eyebrows_state:
                          estimate: 1
                          threshold: [ "neutral" ]
                        smile_properties:
                          estimate: 1
                          threshold: [ "none" ]
                        headwear_type:
                          estimate: 1
                          threshold: [ "none" ]
                        natural_light:
                          estimate: 1
                          threshold: 1
                        radial_distortion:
                          estimate: 1
                          threshold: 0
                        red_eyes:
                          estimate: 1
                          threshold: 0
                        face_color_type:
                          estimate: 1
                          threshold: [ "color" ]
                        illumination_uniformity:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        dynamic_range:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        background_lightness:
                          estimate: 1
                          threshold:
                            min: 0.2
                            max: 1.0
                        background_uniformity:
                          estimate: 1
                          threshold:
                            min: 0.5
                            max: 1.0
                        shoulders_position:
                          estimate: 1
                          threshold:
                            - parallel
                  extract_policy:
                    extract_basic_attributes: 1
                    fd_score_threshold: 0.7
                  storage_policy:
                    attribute_policy:
                      store_attribute: 0
                    face_sample_policy:
                      store_sample: 0
                create_time: "2019-08-24T14:15:22Z"
                last_update_time: "2019-08-24T14:15:22Z"
                version: 111
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/verifier_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    put:
      tags:
        - verifiers
      summary: replace verifier
      description: |
        Update the verifier. You can not update a part of verifier, so you should specify all the fields for your handler.
      operationId: putVerifier
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/applicationJsonContent'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            response = requests.post(url, json=payload, headers=headers)
            verifierId = response.json()["verifier_id"]

            url = f"{url}/{verifierId}"

            newPayload = payload
            newPayload["policies"]["verification_threshold"] = 0.7

            # replace verifier
            response = requests.put(url, json=newPayload, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            verifierId = luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True).json["verifier_id"]

            newPolicies = policies
            newPolicies.verificationThreshold = 0.7

            # replace verifier
            response = luna3client.putVerifier(verifierId=verifierId, policies=newPolicies)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request PUT 'http://127.0.0.1:5000/6/verifiers/100ad8c3-7374-4d69-8ebf-23bcf9a97ccc' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=' \
            --header 'Content-Type: application/json' \
            --data '{
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }'

      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    description: Verifier current version (increases on update).
                    type: integer
                    minimum: 1
                required:
                  - version
              example:
                version: 111
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                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.'']}}'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12027"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/verifier_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    head:
      tags:
        - verifiers
      summary: check if verifier exists
      description: Check if verifier with `verifier_id` exists.
      operationId: checkVerifier
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            response = requests.post(url, json=payload, headers=headers)
            verifierId = response.json()["verifier_id"]

            url = f"{url}/{verifierId}"

            # check verifier
            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            verifierId = luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True).json["verifier_id"]

            # check verifier
            response = luna3client.checkVerifier(verifierId=verifierId)

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --head 'http://127.0.0.1:5000/6/verifiers/100ad8c3-7374-4d69-8ebf-23bcf9a97ccc' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      responses:
        200:
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          description: OK.
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        401:
          $ref: '#/components/responses/authorization_error_without_body'
        403:
          $ref: '#/components/responses/forbidden_error_without_body'
        404:
          description: Verifier not found.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
        408:
          $ref: '#/components/responses/request_timeout_without_body'
        500:
          $ref: '#/components/responses/internal_server_error_without_body'
        503:
          $ref: '#/components/responses/response_timeout_without_body'
        504:
          $ref: '#/components/responses/server_timeout_error_without_body'

    delete:
      tags:
        - verifiers
      summary: remove verifier
      description: Remove verifier by ID.
      operationId: removeVerifier
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}

            url = f"{baseUri}/verifiers"

            payload = {
                "description": "new verifier",
                "policies": {
                    "verification_threshold": 0.5,
                    "detect_policy": {
                        "estimate_mask": 1
                    },
                    "extract_policy": {
                        "extract_basic_attributes": 1
                    },
                    "storage_policy": {
                        "attribute_policy": {
                            "store_attribute": 1
                        },
                        "face_sample_policy": {
                            "store_sample": 1
                        }
                    }
                }
            }

            # create verifier
            response = requests.post(url, json=payload, headers=headers)
            verifierId = response.json()["verifier_id"]

            url = f"{url}/{verifierId}"

            # delete verifier
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import (
                VerifierPolicies,
                VerifierDetectPolicy,
                VerifierExtractPolicy,
                VerifierStoragePolicy,
                VerifierFaceSamplePolicy,
                VerifierAttributePolicy)

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            policies = VerifierPolicies(
                verificationThreshold=0.5,
                detectPolicy=VerifierDetectPolicy(estimateEmotions=1),
                extractPolicy=VerifierExtractPolicy(extractBasicAttributes=1),
                storagePolicy=VerifierStoragePolicy(
                    faceSamplePolicy=VerifierFaceSamplePolicy(storeSample=1),
                    attributePolicy=VerifierAttributePolicy(storeAttribute=1)
                )
            )

            # create verifier
            verifierId = luna3client.createVerifier(description="new verifier", policies=policies, raiseError=True).json["verifier_id"]

            # delete verifier
            response = luna3client.deleteVerifier(verifierId=verifierId)

            print(response.statusCode)
        - lang: bash
          source: |
            curl --location --request DELETE 'http://127.0.0.1:5000/6/verifiers/100ad8c3-7374-4d69-8ebf-23bcf9a97ccc' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='

      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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error_with_handlers'
        404:
          $ref: '#/components/responses/verifier_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
    options:
      tags:
        - verifiers
      summary: verifier options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

  /6/ws:
    get:
      tags:
        - ws
      summary: ws handshake
      description: |
        Ws handshake.
        > ### Attention!
        > **Subscription to events occurs via [WebSocket](https://en.wikipedia.org/wiki/WebSocket).**
        > Messages sent by ws you can view in callback section.
        > Connection supports [autoping](https://tools.ietf.org/html/rfc6455#section-5.5.2).
      operationId: wsHandshake
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/sources'
        - $ref: '#/components/parameters/stream_ids'
        - $ref: '#/components/parameters/matching_candidates_labels'
        - $ref: '#/components/parameters/object_similarity__gte'
        - $ref: '#/components/parameters/object_similarity__lt'
        - $ref: '#/components/parameters/age__lt'
        - $ref: '#/components/parameters/age__gte'
        - $ref: '#/components/parameters/gender'
        - $ref: '#/components/parameters/ethnic_groups'
        - $ref: '#/components/parameters/liveness'
        - $ref: '#/components/parameters/deepfake'
        - $ref: '#/components/parameters/tags'
        - $ref: '#/components/parameters/user_data'
        - $ref: '#/components/parameters/geo_position'
        - $ref: '#/components/parameters/cities'
        - $ref: '#/components/parameters/areas'
        - $ref: '#/components/parameters/districts'
        - $ref: '#/components/parameters/streets'
        - $ref: '#/components/parameters/house_numbers'
        - $ref: '#/components/parameters/handler_ids'
        - $ref: '#/components/parameters/masks'
        - $ref: '#/components/parameters/emotions'
        - $ref: '#/components/parameters/apparent_gender'
        - $ref: '#/components/parameters/apparent_age__gte'
        - $ref: '#/components/parameters/apparent_age__lt'
        - $ref: '#/components/parameters/headwear_states'
        - $ref: '#/components/parameters/headwear_colors'
        - $ref: '#/components/parameters/sleeve_lengths'
        - $ref: '#/components/parameters/upper_clothing_colors'
        - $ref: '#/components/parameters/lower_garment_colors'
        - $ref: '#/components/parameters/lower_garment_types'
        - $ref: '#/components/parameters/shoes_colors'
        - $ref: '#/components/parameters/backpack_states'

      responses:
        101:
          description: Success handshake.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/message_from_ws'
              example:
                event:
                  face_attributes:
                    attribute_id: "557d54ec-29ad-4f3c-93b4-c9092ef12515"
                    basic_attributes:
                      age: 31
                      gender: 1
                      ethnicities:
                        estimations:
                          asian: 3.581344942826803e-10
                          indian: 9.219499295942679e-12
                          caucasian: 8.45913916691643e-09
                          african_american: 1.0
                        predominant_ethnicity: "african_american"
                    score: 0.9883918166160583
                    url: "/6/attributes/24d405ce-bc56-4bf7-98e1-bdc962b4cf34"
                    samples: [ "33bc3d2c-3c07-40af-8ee8-9c03e036b0ae" ]
                  body_attributes:
                    score: 1.0
                    samples: [ "4d5766a3-2e39-4909-88c0-ac9f07c426eb" ]
                  source: "3rd Avenue"
                  stream_id: "a778c4a5-2191-476e-a261-3b4f9ce2e25e"
                  tags: ["tag1", "tag2"]
                  event_id: "527fca61-d452-4dd2-ad97-63c5f95c02b1"
                  url: "/6/events/527fca61-d452-4dd2-ad97-63c5f95c02b1"
                  matches: [{
                    label: good guys,
                    candidates: [{
                          face:{
                            face_id: 426542d6-5509-4e5b-8a01-e2abd5c0a8c6,
                            external_id: 2xQ2gprbMUePw1s9gw9fvA==,
                            account_id: 904e635f-3a47-4832-b4d6-d2d72ba78451,
                            user_data: fox1991,
                            create_time: "2021-08-18T02:43:37.196724+03:00",
                            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
                        }]}]
                  external_id: "external id"
                  user_data: "some event"
                  location:
                    city: Moscow
                    area: CAO
                    district: Mitino
                    street: Schepkina
                    house_number: 1/2str3
                    geo_position: {
                      longitude: 36.616,
                      latitude: 55.752
                    }
                  detections:
                    - filename: "penelope.jpeg"
                      samples:
                        face:
                          sample_id: "33bc3d2c-3c07-40af-8ee8-9c03e036b0ae"
                          detection:
                            attributes:
                              liveness:
                                  prediction: "spoof"
                                  estimations:
                                    quality: 0.7361597418785095
                                    score: 0.600364089012146
                              deepfake:
                                prediction: "fake"
                                score: 0.600364089012146
                              mouth_attributes:
                                    score: 0.3884400725
                                    occluded: 0.000000014
                                    smile: 0.6115599275
                                    opened: 0.121500025
                              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
                              emotions:
                                  predominant_emotion: neutral
                                  estimations:
                                    anger: 0.00894705578684807
                                    disgust: 0.00000965219624049496
                                    fear: 0.00121302821207792
                                    happiness: 0.00129503419157118
                                    neutral: 0.986027479171753
                                    sadness: 0.00187553185969591
                                    surprise: 0.000632198702078313
                              mask:
                                  predominant_mask: occluded
                                  estimations:
                                    medical_mask: 0.020060448
                                    missing: 0.3235525191
                                    occluded: 0.6563870311
                                  face_occlusion:
                                    predominant_occlusion: correct
                                    estimations:
                                      full: 0.019
                                      clear: 0.02
                                      correct: 0.6108324766
                                      partially: 0.310
                                      mouth: 0.0209
                                      chin: 0.019097
                              head_pose:
                                    pitch: 12.7464532852
                                    roll: -2.9892115593
                                    yaw: 17.7173442841
                              gaze:
                                    yaw: -5.9912848473
                                    pitch: -10.2646684647
                            quality:
                              blurriness: 0.9769582748000001
                              dark: 0.9542820454000001
                              illumination: 0.8248310089
                              specularity: 0.8472354412
                              light: 0.8179533482
                            rect:
                              x: 255
                              y: 101
                              width: 137
                              height: 183
                            landmarks5: [ [ 43,66 ],[ 106, 63 ],[ 89,105 ],[ 54,133 ], [ 116,128 ] ]
                            landmarks68: [ [ 8, 8 ], [ 14, 14 ], [ 28, 28 ], [ 48, 48 ], [ 72, 72 ], [ 102, 102 ], [ 134, 134 ], [ 168, 168 ], [ 213, 213 ], [ 262, 262 ],
                                      [ 306, 306 ], [ 345, 345 ], [ 376, 376 ], [ 392, 392 ], [ 397, 397 ], [ 399, 399 ], [ 394, 394 ], [ 2, 2 ], [ 22, 22 ], [ 50, 50 ],
                                      [ 79, 79 ], [ 106, 106 ], [ 165, 165 ], [ 199, 199 ], [ 236, 236 ], [ 278, 278 ], [ 317, 317 ], [ 137, 137 ], [ 136, 136 ],
                                      [ 136, 136 ], [ 136, 136 ], [ 119, 119 ], [ 135, 135 ], [ 154, 154 ], [ 174, 174 ], [ 193, 193 ], [ 40, 40 ], [ 57, 57 ],
                                      [ 83, 83 ], [ 108, 108 ], [ 84, 84 ], [ 58, 58 ], [ 203, 203 ], [ 222, 222 ], [ 249, 249 ], [ 277, 277 ], [ 258, 258 ], [ 229, 229 ],
                                      [ 119, 119 ], [ 130, 130 ], [ 149, 149 ], [ 167, 167 ], [ 185, 185 ], [ 222, 222 ], [ 259, 259 ], [ 232, 232 ], [ 200, 200 ],
                                      [ 177, 177 ], [ 155, 155 ], [ 134, 134 ], [ 127, 127 ], [ 152, 152 ], [ 170, 170 ], [ 190, 190 ], [ 250, 250 ], [ 193, 193 ],
                                      [ 172, 172 ], [ 152, 152 ] ]
                            face_quality:
                              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
                                    max: 5
                                  result: 1
                                - name: head_pitch
                                  object_value: 3.816443920135498
                                  threshold_value:
                                    min: -5
                                    max: 5
                                  result: 1
                                - name: head_roll
                                  object_value: 5.434040069580078
                                  threshold_value:
                                    min: -8
                                    max: 8
                                  result: 1
                                - name: gaze_yaw
                                  object_value: -3.773012399673462
                                  threshold_value:
                                    min: -5
                                    max: 5
                                  result: 1
                                - name: gaze_pitch
                                  object_value: 0.7140519022941589
                                  threshold_value:
                                    min: -5
                                    max: 5
                                  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:
                                  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
                                  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.7305162000656128
                                  threshold_value:
                                    min: 0.5
                                    max: 1
                                  result: 1
                                - name: dynamic_range
                                  object_value: 0.6605162000656128
                                  threshold_value:
                                    min: 0.5
                                    max: 1
                                  result: 1
                                - name: background_uniformity
                                  object_value: 0.8874394297599792
                                  threshold_value:
                                    min: 0.5
                                    max: 1
                                  result: 1
                                - name: background_lightness
                                  object_value: 0.5780888795852661
                                  threshold_value:
                                    min: 0.5
                                    max: 1
                                  result: 1

                          url: "/6/samples/faces/33bc3d2c-3c07-40af-8ee8-9c03e036b0ae"
                        body:
                          sample_id: "4d5766a3-2e39-4909-88c0-ac9f07c426eb"
                          detection:
                            rect:
                              x: 52
                              y: 65
                              width: 748
                              height: 895
                            attributes:
                              basic_attributes:
                                apparent_age: 25
                                apparent_gender: 0
                              upper_body:
                                headwear:
                                  state: 0
                                  apparent_color: undefined
                                sleeve:
                                  length: short
                                upper_clothing:
                                  colors: [ white, black ]
                              lower_body:
                                lower_garment:
                                  type: trousers
                                  colors: [ white, black ]
                                shoes:
                                  apparent_color: black
                              accessories:
                                backpack:
                                  state: 0
                          url: "/6/samples/bodies/4d5766a3-2e39-4909-88c0-ac9f07c426eb"
                      detect_time: "2021-06-18T02:44:58.653485+03:00"
                      detect_ts: 123.456
                      image_origin: "/6/images/b668c4a5-2191-476e-a261-3b4f9ce2e25e"
                  meta:
                    foo: "bar"
                  aggregate_estimations:
                    face:
                      attributes:
                        liveness:
                          prediction: "spoof"
                          estimations:
                            quality: 0.7361597418785095
                            score: 0.600364089012146
                        deepfake:
                          prediction: "fake"
                          score: 0.600364089012146
                        mask:
                          estimations:
                            medical_mask: 0.020060448
                            missing: 0.3235525191
                            occluded: 0.6563870311
                          predominant_mask: "occluded"
                          face_occlusion:
                            predominant_occlusion: correct
                            estimations:
                              full: 0.019
                              clear: 0.02
                              correct: 0.6108324766
                              partially: 0.310
                              mouth: 0.0209
                              chin: 0.019097
                        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"
                    body:
                      attributes:
                        basic_attributes:
                          apparent_age: 25
                          apparent_gender: 0
                        upper_body:
                          headwear:
                            state: 0
                            apparent_color: undefined
                          sleeve:
                            length: short
                          upper_clothing:
                            colors: [ white, black ]
                        lower_body:
                          lower_garment:
                            type: trousers
                            colors: [ white, black ]
                          shoes:
                            apparent_color: black
                        accessories:
                          backpack:
                            state: 0
                  track_id: "useful_track_id_number_1"
                  face:
                    external_id: "external id"
                    face_id: "a9629ef8-148f-4630-8584-dcf52caf8374"
                    url: "/6/faces/a9629ef8-148f-4630-8584-dcf52caf8374"
                    lists: ["429b0e78-4616-426a-b57f-02baa72d638d", '6d037c33-31ec-4d73-b3b3-ec80b09446c2']
                    user_data: "top face"
                    avatar: "/6/samples/33bc3d2c-3c07-40af-8ee8-9c03e036b0ae"
                    event_id: "527fca61-d452-4dd2-ad97-63c5f95c02b1"
                handler_id: "88c5dd7e-693b-4386-92bc-0c31a150a7d0"
                event-create-time: "2021-06-18T02:44:58.653485+03:00"
                event-end-time: "2021-06-18T02:44:58.653485+03:00"
                Luna-Request-id: "1623984298,375c6d96-09c7-4db3-91cc-f13e66288aa9"
        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:
                oneOf:
                  - $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'estimate_quality'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          $ref: '#/components/responses/forbidden_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
      x-codeSamples:
        - lang: python
          label: sync with luna3
          source: |
            from luna3.lunavl.httpclient import LunaHttpClient
            
            EXPECTED_EVENT_COUNT = 1
            
            client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna")
            with client.wsConnect() as ws:
                for _ in range(EXPECTED_EVENT_COUNT):
                    WS_RESP = ws.recv()
                    print(WS_RESP)
        - lang: python
          label: async with luna3
          source: |
            import asyncio
            from luna3.lunavl.httpclient import LunaHttpClient

            EXPECTED_EVENT_COUNT = 1
            WS_RESP = None

            async def main():
                global WS_RESP
                client = LunaHttpClient(origin='http://127.0.0.1:5000', api=6, login="luna@visionlabs.ru", password="luna")
                async with client.wsConnect(asyncRequest=True) as ws:
                    count = 0
                    async for resp in ws:
                        count += 1
                        WS_RESP = resp.data
                        print(WS_RESP)
                        if count >= EXPECTED_EVENT_COUNT:
                            await ws.close()

            asyncio.run(main())

        - lang: python
          label: async with websockets library
          source: |
            import asyncio
            import websockets

            EXPECTED_EVENT_COUNT = 1
            WS_RESP = None

            async def main():
                global WS_RESP
                uri = "ws://127.0.0.1:5000/6/ws"
                headers = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
                async with websockets.connect(uri, extra_headers=headers) as websocket:
                    for _ in range(EXPECTED_EVENT_COUNT):
                        WS_RESP = await websocket.recv()
                        print(WS_RESP)

            asyncio.run(main())

        - lang: bash
          label: using curl
          source: |
            curl -i -N -m 1 \
              -H "Connection: Upgrade" \
              -H "Upgrade: websocket" \
              -H "Sec-WebSocket-Version: 13" \
              -H "Sec-WebSocket-Key: YWFhYWFhYWFhYWFhYWFhYQ==" \
              -H "Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" \
              http://127.0.0.1:5000/6/ws
    options:
      tags:
        - ws
      summary: ws handshake options
      description: Get options for the resource.
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/login:
    post:
      tags:
        - login
      summary: set login cookie
      description: Set login cookie.

      operationId: setLoginCookie
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'

      responses:
        204:
          description: Created
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Content-Type:
              $ref: '#/components/headers/octet_stream_content_type'
            Set-Cookie:
              $ref: '#/components/headers/set_cookie_required'
        401:
          $ref: '#/components/responses/authorization_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      security:
        - BearerAuth: []
      tags:
        - login

      summary: clear login cookie
      description: Clear login cookie.
      operationId: deleteLoginCookie

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

      responses:
        204:
          description: No Content
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Content-Type:
              $ref: '#/components/headers/octet_stream_content_type'
            Set-Cookie:
              $ref: '#/components/headers/set_cookie'
        401:
          $ref: '#/components/responses/authorization_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - login
      summary: login cookie options
      description: Get options for the resource.
      operationId: getLoginCookieOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/liveness:
    post:
      tags: [ liveness ]
      summary: predict liveness
      description: |

        Predict liveness probability in input images.

        The response contains the probability that there is a real person in the image, and it is not a presentation attack.

        "meta" and "x_meta" sections of the request are used for backward compatibility and are deprecated now.

        The incoming images should correspond the requirements of the utilized Liveness version. See "Administrator’s manual" for details.

        *Liveness estimation is not supported for samples (warped images).*

      operationId: predictLiveness
      security:
        - BasicAuth: []
        - BearerAuth: []
        - LunaAccountIdAuth: []
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
        - $ref: '#/components/parameters/multiple_images_content_type'
        - $ref: '#/components/parameters/aggregate_liveness'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests
            import json

            baseUri = "http://127.0.0.1:5000/6"

            with open("liveness.jpg", "rb") as image_file:
                files = {
                    "meta": (
                        "meta",
                        json.dumps({"OS": "IOS"}),
                        "application/json",
                    ),
                    "image": (
                        "liveness.jpg",
                        image_file.read(),
                        "image/jpeg",
                    ),
                }

            auth = {"Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE="}
            url = f"{baseUri}/liveness"
            response = requests.post(url, files=files, headers=auth)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.common.http_objs import BinaryImage
            from luna3.lunavl.httpclient import (
                BaseLunaHttpClient,
                LunaHttpClient,
            )

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.predictLiveness(
                images=[BinaryImage("liveness.jpg")],
                raiseError=True,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl -H "Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=" \
            --form "image=@liveness.jpg;type=image/jpeg" \
            --form "meta={\"OS\":\"DESKTOP\"};type=application/json" \
            http://127.0.0.1:5000/6/liveness

      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              description: Filename in the header of the subpart (`content-disposition` header) MUST be supplied.
              properties:
                meta:
                  $ref: '#/components/schemas/LivenessMeta'
                x_meta:
                  type: object
                  description: The JSON string with any additional information.
                  deprecated: true
                image:
                  $ref: '#/components/schemas/image_list_for_multipart'
              required: [ image ]
          application/json:
            schema:
              type: object
              properties:
                meta:
                  $ref: '#/components/schemas/LivenessMeta'
                x_meta:
                  type: object
                  description: The JSON string with any additional information.
                  deprecated: true
                urls:
                  $ref: '#/components/schemas/ListOfUrlsWithImages'
              required: [ urls ]
          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
        required: true
      responses:
        200:
          description: Success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/liveness_response'
        400:
          description: Bad request.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                bad_query:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'devices'
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012
                bad_content_type:
                  value:
                    error_code: 12017
                    desc: Bad/incomplete input data
                    detail: Bad content type
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017
                bad_content_type_download_image:
                  value:
                    error_code: 11028
                    desc: Bad/incomplete input data
                    detail: 'Bad content type of image ''https://www.google.ru'''
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11028
                bad_content_type_multipart:
                  value:
                    error_code: 11029
                    desc: Bad/incomplete input data
                    detail: Bad content type of image in multipart body
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11029
                failed_load_image:
                  value:
                    error_code: 11027
                    desc: External request failed
                    detail: 'Failed  to download image by url ''https://www.gooogle.ru'''
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11027
                bad_multipart_body:
                  value:
                    error_code: 11049
                    desc: Bad/incomplete input data
                    detail: "Bad multipart body: body must contains at least one image"
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11049
        401:
          $ref: '#/components/responses/authorization_error'
        403:
          description: Forbidden.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                license_problem:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: License expired"
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055
                liveness:
                  value:
                    error_code: 11055
                    desc: Forbidden
                    detail: "License problem: Liveness feature disabled"
                    link: https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11055
        408:
          $ref: '#/components/responses/request_timeout'
        413:
          $ref: '#/components/responses/payload_to_large'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags: [ liveness ]
      summary: liveness options
      description: Get options for the resource.
      operationId: getLivenessOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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* 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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          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"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12024"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - documents
      summary: get openapi documentation options
      description: Get options for the resource.
      operationId: getSpecOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            text/html:
              schema:
                type: string
                description: HTML format documentation.
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - documents
      summary: get development documentation options
      description: Get options for the resource.
      operationId: getDevOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
                "Authorization": "Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE=",
            }
            url = f"{baseUri}/config"

            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getConfig()

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/config' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYUB2aXNpb25sYWJzLnJ1Omx1bmE='
      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.
                additionalProperties: true
              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
        408:
          $ref: '#/components/responses/request_timeout'
        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"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12024"
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - config
      summary: get config options
      description: Get options for the resource.
      operationId: getConfigOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/features:
    get:
      tags:
      - features

      summary: get platform features
      description: |
        Get information about platform features:
        
          - relevance of the license (`license`)
          - enabled estimations (`estimations`)
          - enabled modules (`components`)
      operationId: getFeatures

      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            
            import requests
            
            baseUri = "http://127.0.0.1:5000/6"
            
            headers = {
            "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
            }
            url = f"{baseUri}/features"
            
            response = requests.get(url, headers=headers)
            
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            
            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.getFeatures()

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/features' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a'
      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:
                type: object
                properties:
                  license:
                    type: boolean
                    description: Indicates that license is up to date.
                  estimations:
                    description: Estimation features status.
                    type: object
                    properties:
                      people_counter:
                        $ref: '#/components/schemas/feature_status'
                      face_quality:
                        $ref: '#/components/schemas/feature_status'
                      body_attributes:
                        $ref: '#/components/schemas/feature_status'
                      liveness:
                        $ref: '#/components/schemas/feature_status'
                      deepfake:
                        $ref: '#/components/schemas/feature_status'
                    required: [people_counter, face_quality, body_attributes, liveness, deepfake]
                  components:
                    description: Optional modules status.
                    type: object
                    properties:
                      events:
                        $ref: '#/components/schemas/feature_status'
                      tasks:
                        $ref: '#/components/schemas/feature_status'
                      sender:
                        $ref: '#/components/schemas/feature_status'
                      image_store:
                        $ref: '#/components/schemas/feature_status'
                      handlers:
                        $ref: '#/components/schemas/feature_status'
                      lambdas:
                        $ref: '#/components/schemas/feature_status'
                    required: [events, tasks, sender, image_store, handlers, lambdas]
                required: [license, estimations, components]
                example:
                  license: True
                  estimations:
                    people_counter: True
                    face_quality: True
                    body_attributes: True
                    liveness: True
                    deepfake: True
                  components:
                    events: True
                    tasks: True
                    sender: True
                    image_store: True
                    handlers: True
                    lambdas: True
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - features

      summary: features options
      description: Get options for the resource.
      operationId: getFeaturesOptions

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/plugins:
    get:
      tags:
        - plugins
      summary: get list of plugins
      description: |
        Get list of service plugins:
      operationId: getPlugins
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
    
            import requests
    
            baseUri = "http://127.0.0.1:5000/6"
    
            headers = {
            "Luna-Request-Id": "1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
            }
            url = f"{baseUri}/plugins"
    
            response = requests.get(url, headers=headers)
    
            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
    
            from luna3.lunavl.httpclient import LunaHttpClient
    
            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
    
            response = luna3client.getPlugins()
    
            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/plugins' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a'
      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/plugins'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
        - plugins

      summary: plugins options
      description: Get options for the resource.
      operationId: getPluginsOptions

      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas:
    post:
      tags:
      - lambda [beta]
      summary: create lambda
      description: Create a new lambda.
      operationId: createLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/application_multipart_content'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep
            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }
            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            namespace = "default"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps(
                            {"lambda_name": lambdaName, "description": "test description"}
                        ), "application/json"),
                    "parameters": (
                        "parameters",
                        json.dumps(
                            {"lambda_type": "standalone"}
                        ), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep
            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str, namespace: str = "default") -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    namespace: k8s namespace
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId, namespace=namespace).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.createLambda(
                archive=getArchive(path="lambda.zip"),
                lambdaName=str(uuid4()),
                description="lambda description",
                lambdaType="standalone",
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request POST 'http://127.0.0.1:5000/6/lambdas' \
            --header 'Luna-Request-Id: 1536751345,00000000-0000-4000-a000-000000000156' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            --header 'Content-Type: multipart/form-data' \
            --form 'archive=@lambda.zip; type=application/zip' \
            --form 'credentials={"lambda_name": "13cfd33e-06fa-4e1f-be95-7d56d3eb64e5", "description": "lambda description"}; type=application/json' \
            --form 'parameters={"lambda_type": "standalone"}; type=application/json'
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/lambda_multipart_content-archive_file'
        required: true
      responses:
        202:
          description: Lambda creation executed successfully.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                format: url
                example: /6/lambdas/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: Location of the lambda.
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lambda_id_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:
                archive_not_contains_file:
                  value:
                    error_code: 12048
                    desc: Bad/incomplete input data
                    detail: 'Archive file does not contain lambda.py'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12048"
                unknown_multipart_name:
                  value:
                    error_code: 12039
                    desc: Bad/incomplete input data
                    detail: 'Unknown multipart name ''account'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12039"
                duplicate_multipart_name:
                  value:
                    error_code: 12040
                    desc: Bad/incomplete input data
                    detail: 'Duplicate multipart name ''lambda_name'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12040"
                bad_multipart_content_type:
                  value:
                    error_code: 12041
                    desc: Bad/incomplete input data
                    detail: 'Multipart with name ''lambda_name'' has bad Content-Type'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12041"
                account_id_not_found:
                  value:
                    error_code: 11066
                    desc: Bad/incomplete input data
                    detail: Luna-Account-Id header not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11066"
                bad_account_id:
                  value:
                    error_code: 11037
                    desc: Bad/incomplete input data
                    detail: "Luna-Account-Id header is not UUID, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11037"
        403:
          $ref: '#/components/responses/forbidden_lambda_error_with_license'
        409:
          description: Unique constraint 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'
        500:
          $ref: '#/components/responses/internal_server_error'

    get:
      tags:
      - lambda [beta]
      summary: get lambdas
      description: Get lambdas according to filters.
      operationId: getLambdas
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      - $ref: '#/components/parameters/create_time__lt'
      - $ref: '#/components/parameters/create_time__gte'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/page_size'
      - $ref: '#/components/parameters/lambda_type'
      - $ref: '#/components/parameters/namespace'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            from datetime import datetime, timedelta
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }
            accountId = "00000000-0000-4000-a000-000000000156"
            lambdaId = str(uuid4())
            lambdaName = str(uuid4())
            timeDelta = timedelta(days=1)
            namespace = "default"
            params = {
                "account_id": accountId,
                "create_time__lt": datetime.utcnow().isoformat("T") + "Z",
                "create_time__gte": (datetime.utcnow() - timeDelta).isoformat("T") + "Z",
                "page": 1,
                "page_size": 100,
                "lambda_type": "standalone",
                "namespace": namespace
            }
            url = f"{baseUri}/lambdas/"

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from datetime import datetime, timedelta

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            accountId = "00000000-0000-4000-a000-000000000156"
            timeDelta = timedelta(days=1)
            response = luna3client.getLambdas(
                accountIdFilter=accountId,
                createTimeLt=datetime.utcnow().isoformat("T") + "Z",
                createTimeGte=(datetime.utcnow() - timeDelta).isoformat("T") + "Z",
                lambdaType="standalone",
                namespace="default"
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request GET 'http://127.0.0.1:5000/6/lambdas' \
            --header 'Luna-Request-Id: 1536751345,00000000-0000-4000-a000-000000000156' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            -d 'account_id=00000000-0000-4000-a000-000000000156' \
            -d 'create_time__lt=2050-08-11T09:11:41.674Z' \
            -d 'create_time__gte=2018-08-11T09:11:41.674Z' \
            -d 'page=1' \
            -d 'page_size=100' \
            -d 'lambda_type=standalone' \
            -d 'namespace=namespace'
      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:
                type: object
                properties:
                  lambdas:
                    type: array
                    items:
                      $ref: '#/components/schemas/lambda'
                    minItems: 0
                required: [lambdas]
        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 'create_time__lt'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/validator:
    post:
      tags:
      - lambda [beta]
      summary: validation lambda
      description: Validate lambda.
      operationId: validationLambda
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/application_multipart_content'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep
            
            import json
            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }
            url = f"{baseUri}/lambdas/validator"

            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "parameters": (
                        "parameters",
                        json.dumps({"lambda_type": "standalone"}),
                        "application/json",
                    )
                }

            response = requests.post(url, headers=headers, files=files)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            response = luna3client.validateLambda(
                archive=getArchive(path="lambda.zip"),
                lambdaType="standalone"
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl  --request POST 'http://127.0.0.1:5000/6/lambdas/validator' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            --form 'archive=@lambda.zip; type=application/zip' \
            --form 'parameters={"lambda_type": "standalone"}; type=application/json'
      requestBody:
        content:
          application/zip:
            schema:
              type: object
              properties:
                archive:
                  type: string
                  format: binary
                  description: |
                    Archive file with zip extension.
                    Content-Type must be "application/zip".
                parameters:
                  type: object
                  description: Parameters for lambda.
                  properties:
                    lambda_type:
                      $ref: '#/components/schemas/lambda_type'
                  required: [ lambda_type ]
              required: [ archive, parameters ]
        required: true
      responses:
        204:
          description: Lambda validation success.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        400:
          description: Validate lambda 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/lambda_validation_error_response'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.

    put:
      tags:
      - lambda [beta]
      summary: put lambda
      description: Update lambda. You cannot update a part of the lambda, so you should specify all the fields for your lambda.
      operationId: putLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/application_multipart_content'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps(
                            {"lambda_name": str(uuid4()), "description": "new lambda description"}
                        ), "application/json"),
                    "parameters": (
                        "parameters",
                        json.dumps(
                            {"lambda_type": "standalone"}
                        ), "application/json"),
                }
            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Put lambda

            files.update(
                {
                  "credentials": (
                        "credentials",
                        json.dumps(
                            {"lambda_name": str(uuid4()), "description": "new lambda description"}
                        ), "application/json") 
                }
            )
            response = requests.put(url + lambdaId, headers=headers, files=files)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda
            
            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Put lambda

            response = luna3client.updateLambda(
                lambdaId=lambdaId,
                archive=getArchive(),
                lambdaName=str(uuid4()),
                description="new lambda description",
                lambdaType="standalone"
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request PUT 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            --header 'Content-Type: multipart/form-data' \
            --form 'archive=@lambda.zip; type=application/zip' \
            --form 'credentials={"lambda_name": "13cfd33e-06fa-4e1f-be95-7d56d3eb6123", "description": "new lambda description"}; type=application/json' \
            --form 'parameters={"lambda_type": "standalone"}; type=application/json'
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/lambda_multipart_content-archive_file'
        required: true
      responses:
        200:
          description: Lambda recreation executed successfully.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                format: url
                example: /6/lambdas/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: Location of the lambda.
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lambda_version_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:
                archive_not_contains_file:
                  value:
                    error_code: 12048
                    desc: Bad/incomplete input data
                    detail: 'Archive file does not contain lambda.py'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12048"
                unknown_multipart_name:
                  value:
                    error_code: 12039
                    desc: Bad/incomplete input data
                    detail: 'Unknown multipart name ''account'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12039"
                duplicate_multipart_name:
                  value:
                    error_code: 12040
                    desc: Bad/incomplete input data
                    detail: 'Duplicate multipart name ''lambda_name'''
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12040"
                bad_multipart_content_type:
                  value:
                    error_code: 12041
                    desc: Bad/incomplete input data
                    detail: 'Multipart with name ''lambda_name'' has bad Content-Type'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12041"
                account_id_not_found:
                  value:
                    error_code: 11066
                    desc: Bad/incomplete input data
                    detail: Luna-Account-Id header not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11066"
                bad_account_id:
                  value:
                    error_code: 11037
                    desc: Bad/incomplete input data
                    detail: "Luna-Account-Id header is not UUID, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11037"
        403:
          $ref: '#/components/responses/forbidden_lambda_error_with_license'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    patch:
      tags:
      - lambda [beta]
      summary: patch lambda
      description: Patch lambda.
      operationId: patchLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/application_json_content'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Patch lambda

            data = {"lambda_name": lambdaName, "description": "new lambda description"}

            response = requests.patch(url + lambdaId, headers=headers, json=data)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Patch lambda

            response = luna3client.patchLambda(
                lambdaId=lambdaId,
                lambdaName=lambdaName,
                description="new lambda description",
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl  --request PATCH 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            --header 'Content-Type: application/json' \
            --data '{"lambda_name": "13cfd33e-06fa-4e1f-be95-7d56d3eb6444", "description": "new lambda description"}'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/lambda_patch'
        required: true
      responses:
        204:
          description: Lambda patched successfully.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            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:
                account_id_not_found:
                  value:
                    error_code: 11066
                    desc: Bad/incomplete input data
                    detail: Luna-Account-Id header not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11066"
                bad_account_id:
                  value:
                    error_code: 11037
                    desc: Bad/incomplete input data
                    detail: "Luna-Account-Id header is not UUID, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11037"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    get:
      tags:
      - lambda [beta]
      summary: get lambda
      description: Get lambda by ID.
      operationId: getLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }
            lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f"
            url = f"{baseUri}/lambdas/{lambdaId}"
            params = {
                "account_id": "00000000-0000-4000-a000-000000000156",
            }

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            accountId = "00000000-0000-4000-a000-000000000156"
            lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f"

            response = luna3client.getLambda(
                accountId=accountId,
                lambdaId=lambdaId,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request GET 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            -d "account_id=00000000-0000-4000-a000-000000000156"
      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/lambda'
        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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    head:
      tags:
      - lambda [beta]
      summary: check lambda existence
      description:  Check existence of the lambda by ID.
      operationId: checkLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }
            lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f"
            url = f"{baseUri}/lambdas/{lambdaId}"

            response = requests.head(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            lambdaId = "64e61920-f5ca-4caf-8f2e-d0217e2e6c0f"

            response = luna3client.checkLambda(
                lambdaId=lambdaId,
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl  --head 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f?account_id=00000000-0000-4000-a000-000000000156' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Content-Type:
              $ref: '#/components/headers/application_json'
        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_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    delete:
      tags:
      - lambda [beta]
      summary: delete lambda
      description: Remove lambda by ID.
      operationId: deleteLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import requests
            import json
            from uuid import uuid4


            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps(
                            {"lambda_name": lambdaName, "description": "lambda description"}
                        ), "application/json"),
                    "parameters": (
                        "parameters",
                        json.dumps(
                            {"lambda_type": "standalone"}
                        ), "application/json"),
                }
            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Delete lambda

            url = f"{baseUri}/lambdas/{lambdaId}"
            
            response = requests.delete(url, headers=headers)

            print(response.status_code)
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )
            # Create lambda
            
            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Delete lambda

            response = luna3client.deleteLambda(
                lambdaId=lambdaId
            )

            print(response.statusCode)
        - lang: bash
          source: |
            curl  --request DELETE 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6333' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      responses:
        204:
          description: Delete success.
          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_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/update:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the plugin.

    post:
      tags:
        - lambda [beta]
      summary: update lambda
      description: Update lambda using latest base image.
      operationId: updateLambda
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps(
                            {"lambda_name": lambdaName, "description": "lambda description"}
                        ), "application/json"),
                    "parameters": (
                        "parameters",
                        json.dumps(
                            {"lambda_type": "standalone"}
                        ), "application/json"),
                }
            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Update lambda

            url = f"{baseUri}/lambdas/{lambdaId}/update"
            response = requests.post(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda
            
            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Update lambda

            response = luna3client.updateLambdaImage(
                lambdaId=lambdaId,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request POST 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/update' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      responses:
        200:
          description: Lambda executed successfully.
          headers:
            Content-Type:
              $ref: '#/components/headers/application_json'
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Location:
              schema:
                type: string
                format: url
                example: /6/lambdas/b5d6fd45-fcca-453d-ac05-3e594054b813
              description: Location of the plugin.
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lambda_version_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:
                account_id_not_found:
                  value:
                    error_code: 11066
                    desc: Bad/incomplete input data
                    detail: Luna-Account-Id header not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11066"
                bad_account_id:
                  value:
                    error_code: 11037
                    desc: Bad/incomplete input data
                    detail: "Luna-Account-Id header is not UUID, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-11037"
        403:
          $ref: '#/components/responses/forbidden_lambda_error_with_license'
        404:
          description: Lambda 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'
              examples:
                plugin_not_found:
                  value:
                    error_code: 42001
                    desc: Object not found
                    detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
                archive_not_found:
                  value:
                    error_code: 42005
                    desc: Lambda archive not found
                    detail: Archive of lambda '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found in S3. Read developer guide for more information
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42005"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/image/status:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.

    get:
      tags:
      - lambda [beta]
      summary: get lambda image creation status
      description: |
        Get lambda image creation status by lambda ID.

        If lambda image creation is in progress, lambda status will be `waiting`.

        After lambda image creation will end, the lambda image creation job will be removed and status will be `not_found`.

        For more information about lambda and lambda images statuses see development manual.

      operationId: getLambdaImageStatus
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Get lambda image creation status

            url = f"{baseUri}/lambdas/{lambdaId}/image/status"

            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Patch lambda

            response = luna3client.getLambdaImageCreationStatus(
                lambdaId=lambdaId
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request GET 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/image/status' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      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/image_creation_status'
        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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/image/logs:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.

    get:
      tags:
      - lambda [beta]
      summary: get lambda image creation logs
      description: |
        Get lambda image creation logs by lambda ID.
        
        During the creation of the lambda image, it is possible to get logs to monitor the progress.
        
        For more information about lambda and lambda images logs see development manual.

      operationId: getLambdaImageCreationLogs
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/tail_lines'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Get lambda image creation logs

            url = f"{baseUri}/lambdas/{lambdaId}/image/logs"
            params = {"tail_lines": 1}

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Get lambda image creation logs

            response = luna3client.getLambdaImageCreationLogs(lambdaId=lambdaId, tailLines=1)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --request GET 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/image/logs' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            -d 'tail_lines=1'
      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/lambda_image_logs'
        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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/status:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.

    get:
      tags:
      - lambda [beta]
      summary: get lambda status
      description: |
        Get lambda status by ID.

        If lambda image creation is in progress, lambda status will be `waiting`.

        For more information about lambda and lambda images statuses see development manual.

      operationId: getLambdaStatus
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Get lambda image creation status

            url = f"{baseUri}/lambdas/{lambdaId}/status"

            response = requests.get(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Patch lambda

            response = luna3client.getLambdaStatus(
                lambdaId=lambdaId,
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request GET 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/status' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      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/lambda_status_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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/logs:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.

    get:
      tags:
      - lambda [beta]
      summary: get lambda logs
      description: |
        Get lambda logs by ID.
        
        After lambda creation has been executed, there is possibility to get lambda logs.
        
        For more information about lambda and lambda images logs see development manual.

      operationId: getLambdaLogs
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/query_account_id'
        - $ref: '#/components/parameters/tail_lines'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")
            
            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)
            
            # Get lambda image creation logs

            url = f"{baseUri}/lambdas/{lambdaId}/logs"
            params = {"tail_lines": 1}

            response = requests.get(url, headers=headers, params=params)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Get lambda logs

            response = luna3client.getLambdaLogs(lambdaId=lambdaId, tailLines=1)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request GET 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/logs' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h' \
            -d 'tail_lines=1'
      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/lambda_logs'
        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
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12017"
                bad_query_param:
                  value:
                    error_code: 12012
                    desc: Bad/incomplete input data
                    detail: Bad query parameters 'account_id'
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12012"
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          description: Lambda 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: 42001
                desc: Object not found
                detail: Lambda with id '7acc35cf-a3b2-4f87-8d8b-5496a2782d37' not found
                link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-42001"
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/docs/spec:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.

    get:
      tags:
      - lambda proxy [beta]
      summary: get lambda openapi documentation
      description: |
        Get lambda 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: getLambdaSpec
      parameters:
        - $ref: '#/components/parameters/query_account_id'
        - $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.
        404:
          $ref: '#/components/responses/lambda_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        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"
                    link: "https://docs.visionlabs.ai/info/luna/troubleshooting/errors-description/code-12024"
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/lambdas/{lambda_id}/proxy:
    parameters:
    - in: path
      name: lambda_id
      schema:
        $ref: '#/components/schemas/uuid'
      required: true
      description: ID of the lambda.
    - in: path
      name: '* (any_parameter)'
      schema:
        $ref: '#/components/schemas/uuid'
      required: false
      description: Any additional path parameter will be use as path parameter to lambda

    post:
      tags:
      - lambda proxy [beta]
      summary: proxy post request to lambda
      description: |
        Proxy POST request to lambda.

        Request and response headers, query parameters and body description 
        [must be provided](#operation/getLambdaSpec) by lambda documentation.

        Described headers will be processed and received independently of lambda behavior.
        In case of `bearer` authorization, the token must include `view` permissions for `lambdas` to process request.
      operationId: proxyLambdaPost
      security:
        - BasicAuth: [ ]
        - BearerAuth: [ ]
        - LunaAccountIdAuth: [ ]
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/luna_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda
            def wait4start(lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                """
                for _ in range(150):
                    reply = requests.get(f"{baseUri}/lambdas/{lambdaId}/status", headers=headers).json()
                    if reply["status"] == "running":
                        break
                    if reply["status"] == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Post proxy request to lambda
            path = "main"
            url = f"{baseUri}/lambdas/{lambdaId}/proxy/{path}"

            response = requests.post(url, headers=headers)

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Post proxy request to lambda

            response = luna3client.proxyLambdaPost(lambdaId=lambdaId, path="main")

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl  --request POST 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/proxy/main' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      responses:
        201:
          description: Success.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        403:
          $ref: '#/components/responses/forbidden_lambda_error_with_license'
        404:
          $ref: '#/components/responses/lambda_or_page_not_found'
        408:
          $ref: '#/components/responses/request_timeout'
        415:
          $ref: '#/components/responses/method_not_allowed'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'

    options:
      tags:
      - lambda proxy [beta]
      summary: proxy options request to lambda
      description: |
        Proxy OPTIONS request to lambda.

        The response to options contains all the possible methods that can be proxyed to a lambda, 
        but does not say which of them are implemented and which are not.
      operationId: proxyLambdaOptions
      parameters:
      - $ref: '#/components/parameters/luna_request_id'
      - $ref: '#/components/parameters/query_account_id'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library
            from time import sleep

            import json
            from uuid import uuid4

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            headers = {
                "Authorization": "Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h",
            }

            # Create lambda

            lambdaName = str(uuid4())
            url = f"{baseUri}/lambdas/"
            with open("lambda.zip", "rb") as archive:
                files = {
                    "archive": ("lambda.zip", archive.read(), "application/zip"),
                    "credentials": (
                        "credentials",
                        json.dumps({"lambda_name": lambdaName, "description": "lambda description"}),
                        "application/json",
                    ),
                    "parameters": ("parameters", json.dumps({"lambda_type": "standalone"}), "application/json"),
                }

            response = requests.post(url, headers=headers, files=files)
            lambdaId = response.json()["lambda_id"]
            wait4start(lambdaId)

            # Put proxy request to lambda
            path = "main"
            url = f"{baseUri}/lambdas/{lambdaId}/proxy/{path}"

            response = requests.options(url, headers=headers)

            print(response.status_code)
            print(response.headers)
        - lang: python
          source: |
            # This example is written using luna3 library
            from time import sleep

            from uuid import uuid4

            from luna3.lunavl.httpclient import LunaHttpClient


            def getArchive(path: str | None = "lambda.zip") -> bytes:
                """
                Get bytes from archive with lambda by path

                Args:
                    path: path to archive

                Returns:
                    archive bytes
                """
                with open(path, "rb") as archive:
                    return archive.read()
            
            
            def wait4start(client: LunaHttpClient, lambdaId: str) -> None:
                """
                Wait for lambda start
            
                Args:
                    lambdaId: lambda id
                    client: luna api client
                """
                for _ in range(150):
                    status = client.getLambdaStatus(lambdaId=lambdaId).json["status"]
                    if status == "running":
                        break
                    if status == "terminated":
                        raise Exception(f"Expected successfully lambda running. Lambda id: {lambdaId}")
                    sleep(1)
                else:
                    raise Exception(f"Lambda execution took more than 150 seconds. Lambda id: {lambdaId}")


            luna3client = LunaHttpClient(
                login="luna_lambda@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # Create lambda

            lambdaName = str(uuid4())
            archive = getArchive(path="lambda.zip")
            response = luna3client.createLambda(
                archive=archive,
                lambdaName=lambdaName,
                description="lambda description",
                lambdaType="standalone",
            )
            lambdaId = response.json["lambda_id"]
            wait4start(luna3client, lambdaId)

            # Put proxy request to lambda

            response = luna3client.proxyLambdaOptions(
                lambdaId=lambdaId, path="main"
            )

            print(response.statusCode)
            print(response.headers)
        - lang: bash
          source: |
            curl  --request OPTIONS 'http://127.0.0.1:5000/6/lambdas/64e61920-f5ca-4caf-8f2e-d0217e2e6c0f/proxy/main' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a' \
            --header 'Authorization: Basic bHVuYV9sYW1iZGFAdmlzaW9ubGFicy5ydTpsdW5h'
      responses:
        200:
          description: Success.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        403:
          $ref: '#/components/responses/forbidden_lambda_error'
        404:
          $ref: '#/components/responses/lambda_or_page_not_found'
        405:
          $ref: '#/components/responses/method_not_allowed'
        408:
          $ref: '#/components/responses/request_timeout'
        415:
          $ref: '#/components/responses/method_not_allowed'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /6/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'
        408:
          $ref: '#/components/responses/request_timeout'
        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'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            baseUri = "http://127.0.0.1:5000/6"

            # make request
            url = f"{baseUri}/healthcheck"
            response = requests.get(url, params={"include_luna_services": 1})

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
                api=6,
            )

            # get health
            response = luna3client.checkHealth(includeLunaServices=1)

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/6/healthcheck?include_luna_services=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a'

    options:
      tags:
        - health
      summary: healthcheck options
      description: Get options for the resource.
      operationId: getHealthcheckOptions
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /metrics:
    get:
      tags:
        - metrics
      summary: get service requests statistics
      description: Get statistics of success and failed requests to the service in prometheus format.
      operationId: metrics
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Content-Type:
              schema:
                type: string
                enum:
                  - text/plain; charset=UTF-8
              required: true
              description: Content type is `text/plain`.
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
          content:
            text/plain:
              schema:
                type: string
                description: Prometheus plain text format.
              example: |
                # HELP request_count_total Counter of requests
                # TYPE request_count_total counter
                request_count_total{path="GET:/healthcheck",status_code="200"} 1.0
                # HELP requests Histogram of request time metrics
                # TYPE requests histogram
                requests_sum{route="GET:/healthcheck",status_code="200"} 0.005269583023618907
                requests_bucket{le="0.0001",route="GET:/healthcheck",status_code="200"} 0.0
                requests_bucket{le="0.00025",route="GET:/healthcheck",status_code="200"} 0.0
                requests_bucket{le="0.0005",route="GET:/healthcheck",status_code="200"} 0.0
                requests_bucket{le="0.001",route="GET:/healthcheck",status_code="200"} 0.0
                requests_bucket{le="0.0025",route="GET:/healthcheck",status_code="200"} 0.0
                requests_bucket{le="0.005",route="GET:/healthcheck",status_code="200"} 0.0
                requests_bucket{le="0.01",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.025",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.05",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.075",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.1",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.25",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.5",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="0.75",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="1.0",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="2.5",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="5.0",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="7.5",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="10.0",route="GET:/healthcheck",status_code="200"} 1.0
                requests_bucket{le="+Inf",route="GET:/healthcheck",status_code="200"} 1.0
                requests_count{route="GET:/healthcheck",status_code="200"} 1.0
        403:
          $ref: '#/components/responses/forbidden_resource_error'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
  /healthcheck:
    get:
      tags:
        - health
      summary: get health (redirect)
      description: Get health of service (redirect).
      operationId: healthcheckRedirect
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
        - $ref: '#/components/parameters/include_luna_services'
      responses:
        200:
          description: OK (redirected).
          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'
        308:
          description: Moved permanently.
          headers:
            Location:
              schema:
                type: string
                enum:
                  - "/6/healthcheck"
              required: true
              description: Redirect to the versioned resource.
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        502:
          description: Unhealthy (redirected).
          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'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'
      x-codeSamples:
        - lang: python
          source: |
            # This example is written using requests library

            import requests

            # make request
            url = f"http://127.0.0.1:5000/healthcheck"
            response = requests.get(url, params={"include_luna_services": 1})

            print(response.status_code)
            print(response.json())
        - lang: python
          source: |
            # This example is NOT written using luna3 library

            from luna3.lunavl.httpclient import LunaHttpClient

            luna3client = LunaHttpClient(
                login="luna@visionlabs.ru",
                password="luna",
                origin="http://127.0.0.1:5000",
            )

            # get health
            response = luna3client.makeRequest(
                method="GET",
                url=f"{luna3client.origin}/healthcheck",
                queryParams={"includeLunaServices": 1},
                lunaRequestId="1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a",
            )

            print(response.statusCode)
            print(response.json)
        - lang: bash
          source: |
            curl --location --request GET 'http://127.0.0.1:5000/healthcheck?include_luna_services=1' \
            --header 'Luna-Request-Id: 1536751345,8b8b5937-2e9c-4e8b-a7a7-5caf86621b5a'

    options:
      tags:
        - health
      summary: healthcheck options (redirect)
      description: Get options for the resource (redirect).
      operationId: getHealthcheckOptionsRedirect
      parameters:
        - $ref: '#/components/parameters/luna_request_id'
      responses:
        200:
          description: OK.
          headers:
            Luna-Request-Id:
              $ref: '#/components/headers/luna_request_id'
            Allow:
              $ref: '#/components/headers/allow_methods'
            Access-Control-Allow-Origin:
              $ref: '#/components/headers/access_control_allow_origin'
            Access-Control-Allow-Headers:
              $ref: '#/components/headers/access_control_allow_headers'
            Access-Control-Allow-Methods:
              $ref: '#/components/headers/access_control_allow_methods'
            Access-Control-Max-Age:
              $ref: '#/components/headers/access_control_max_age'
        408:
          $ref: '#/components/responses/request_timeout'
        500:
          $ref: '#/components/responses/internal_server_error'
        503:
          $ref: '#/components/responses/response_timeout'
        504:
          $ref: '#/components/responses/server_timeout_error'