From e19ad65b07dedfab169ea98f5b666a4f9c471872 Mon Sep 17 00:00:00 2001
From: Erwan Rouchet <rouchet@teklia.com>
Date: Wed, 17 Jul 2019 13:10:52 +0000
Subject: [PATCH] Add region endpoints

---
 arkindex/schema.yml | 259 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 259 insertions(+)

diff --git a/arkindex/schema.yml b/arkindex/schema.yml
index 0db2e06..f6d62de 100644
--- a/arkindex/schema.yml
+++ b/arkindex/schema.yml
@@ -163,6 +163,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -346,6 +347,7 @@ paths:
                       - classifier
                       - recognizer
                       - ner
+                      - dla
                   required:
                   - type
                   - slug
@@ -397,6 +399,7 @@ paths:
                         - classifier
                         - recognizer
                         - ner
+                        - dla
                     required:
                     - type
                     - slug
@@ -456,6 +459,7 @@ paths:
                       - classifier
                       - recognizer
                       - ner
+                      - dla
                   required:
                   - type
                   - slug
@@ -507,6 +511,7 @@ paths:
                         - classifier
                         - recognizer
                         - ner
+                        - dla
                     required:
                     - type
                     - slug
@@ -844,6 +849,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -1735,6 +1741,150 @@ paths:
       security: []
       tags:
       - elements
+  /api/v1/element/{id}/region/:
+    post:
+      description: Create a region on an element
+      operationId: CreateRegion
+      parameters:
+      - description: ''
+        in: path
+        name: id
+        required: true
+        schema:
+          type: string
+      requestBody:
+        content:
+          application/json:
+            schema:
+              properties:
+                analyser:
+                  type: string
+                class_name:
+                  type: string
+                confidence:
+                  type: number
+                polygon:
+                  type: array
+              required:
+              - class_name
+              - confidence
+              - polygon
+              - analyser
+        x-name: body
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                properties:
+                  analyser:
+                    type: string
+                  class_name:
+                    type: string
+                  confidence:
+                    type: number
+                  id:
+                    readOnly: true
+                    type: string
+                  polygon:
+                    type: array
+                required:
+                - class_name
+                - confidence
+                - polygon
+                - analyser
+      tags:
+      - elements
+  /api/v1/element/{id}/regions/:
+    get:
+      description: List all regions on an element
+      operationId: ListElementRegions
+      parameters:
+      - description: ''
+        in: path
+        name: id
+        required: true
+        schema:
+          type: string
+      - description: A page number within the paginated result set.
+        in: query
+        name: page
+        required: false
+        schema:
+          type: integer
+      - description: Number of results to return per page.
+        in: query
+        name: page_size
+        required: false
+        schema:
+          type: integer
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                properties:
+                  confidence:
+                    nullable: true
+                    type: number
+                  id:
+                    type: string
+                  ml_class:
+                    properties:
+                      id:
+                        type: string
+                      name:
+                        type: string
+                    required:
+                    - name
+                    type: object
+                  source:
+                    properties:
+                      id:
+                        type: string
+                      internal:
+                        type: boolean
+                      revision:
+                        type: string
+                      slug:
+                        type: string
+                      type:
+                        enum:
+                        - classifier
+                        - recognizer
+                        - ner
+                        - dla
+                    required:
+                    - type
+                    - slug
+                    - revision
+                    - internal
+                    type: object
+                  zone:
+                    properties:
+                      center:
+                        type: array
+                      id:
+                        type: string
+                      image_url:
+                        type: string
+                      polygon:
+                        type: array
+                      url:
+                        readOnly: true
+                        type: string
+                    required:
+                    - polygon
+                    - center
+                    - image_url
+                    type: object
+                required:
+                - source
+                - ml_class
+                - zone
+      security: []
+      tags:
+      - elements
   /api/v1/element/{id}/transcriptions/:
     get:
       description: List all transcriptions for an element, filtered by type
@@ -1790,6 +1940,7 @@ paths:
                         - classifier
                         - recognizer
                         - ner
+                        - dla
                     required:
                     - type
                     - slug
@@ -2073,6 +2224,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -3812,6 +3964,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -3823,6 +3976,7 @@ paths:
                         - classifier
                         - recognizer
                         - ner
+                        - dla
                     required:
                     - type
                     - slug
@@ -3869,6 +4023,7 @@ paths:
                                 - classifier
                                 - recognizer
                                 - ner
+                                - dla
                             required:
                             - type
                             - slug
@@ -3880,6 +4035,7 @@ paths:
                           - classifier
                           - recognizer
                           - ner
+                          - dla
                       required:
                       - type
                       - slug
@@ -3944,6 +4100,7 @@ paths:
                     - classifier
                     - recognizer
                     - ner
+                    - dla
                   version:
                     type: string
                 required:
@@ -4936,6 +5093,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -5038,6 +5196,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -5186,6 +5345,7 @@ paths:
                               - classifier
                               - recognizer
                               - ner
+                              - dla
                           required:
                           - type
                           - slug
@@ -5236,6 +5396,103 @@ paths:
       security: []
       tags:
       - search
+  /api/v1/region/{id}/:
+    get:
+      description: Retrieve detailed information about a region
+      operationId: RetrieveRegion
+      parameters:
+      - description: ''
+        in: path
+        name: id
+        required: true
+        schema:
+          type: string
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                properties:
+                  confidence:
+                    nullable: true
+                    type: number
+                  elements:
+                    items:
+                      properties:
+                        id:
+                          type: string
+                        name:
+                          type: string
+                        type:
+                          enum:
+                          - volume
+                          - register
+                          - act
+                          - page
+                          - surface
+                      required:
+                      - type
+                      - name
+                    type: array
+                  id:
+                    type: string
+                  ml_class:
+                    properties:
+                      id:
+                        type: string
+                      name:
+                        type: string
+                    required:
+                    - name
+                    type: object
+                  source:
+                    properties:
+                      id:
+                        type: string
+                      internal:
+                        type: boolean
+                      revision:
+                        type: string
+                      slug:
+                        type: string
+                      type:
+                        enum:
+                        - classifier
+                        - recognizer
+                        - ner
+                        - dla
+                    required:
+                    - type
+                    - slug
+                    - revision
+                    - internal
+                    type: object
+                  zone:
+                    properties:
+                      center:
+                        type: array
+                      id:
+                        type: string
+                      image_url:
+                        type: string
+                      polygon:
+                        type: array
+                      url:
+                        readOnly: true
+                        type: string
+                    required:
+                    - polygon
+                    - center
+                    - image_url
+                    type: object
+                required:
+                - source
+                - ml_class
+                - zone
+                - elements
+      security: []
+      tags:
+      - elements
   /api/v1/surface/{id}/:
     get:
       description: Retrieve detailed information about a surface
@@ -5291,6 +5548,7 @@ paths:
                                   - classifier
                                   - recognizer
                                   - ner
+                                  - dla
                               required:
                               - type
                               - slug
@@ -5393,6 +5651,7 @@ paths:
                                   - classifier
                                   - recognizer
                                   - ner
+                                  - dla
                               required:
                               - type
                               - slug
-- 
GitLab