---
openapi: 3.1.0
components:
  schemas:
    CameraType:
      type: string
      enum:
      - SA_TNO_V1
      - SA_TNO_V2
      - LIGHT_CAM_V1
      - PRODUCER_APP_V1
      - PADEL_GO_V1
      - PIXELLOT_V1
      - SA_PTZ_V1
      - SPIIDEO_V1
      - STAIGE_V1
      - EXTERNAL
    Date:
      type: string
      format: date
      examples:
      - 2022-03-10
    ObjectId:
      type: string
      format: ObjectId
      description: MongoDB ObjectId represented as a string.
    SortOrder:
      type: string
      enum:
      - Ascending
      - Descending
    Venue:
      type: object
      required:
      - name
      - siteId
      properties:
        id:
          $ref: "#/components/schemas/ObjectId"
          type: string
          description: Internal id
        extId:
          type: string
          description: Your unique id
        name:
          type: string
          pattern: \S
          description: Name of the venue
        groups:
          type: array
          items:
            $ref: "#/components/schemas/VenueGroup"
          description: List of groups that have this venue as their home venue
        created:
          $ref: "#/components/schemas/Date"
          type: string
          readOnly: true
        updated:
          $ref: "#/components/schemas/Date"
          type: string
          readOnly: true
        siteId:
          type: string
    VenueGroup:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
  securitySchemes:
    SecurityScheme:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authentication
paths:
  /venue:
    put:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Venue"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Venue"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Update Venue
      tags:
      - Venue Resource
      security:
      - SecurityScheme:
        - System
        - SuperAdmin
        - Admin
    patch:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Venue"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Venue"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Patch Venue
      tags:
      - Venue Resource
      security:
      - SecurityScheme:
        - System
        - SuperAdmin
        - Admin
    get:
      parameters:
      - name: camera-id
        in: query
        schema:
          type: array
          items:
            type: string
      - name: camera-name
        in: query
        schema:
          type: string
      - name: camera-type
        in: query
        schema:
          $ref: "#/components/schemas/CameraType"
      - name: created
        in: query
        schema:
          $ref: "#/components/schemas/Date"
      - name: external-venue-id
        in: query
        schema:
          type: array
          items:
            type: string
      - name: group-id
        in: query
        schema:
          type: array
          items:
            type: string
      - name: id
        in: query
        schema:
          type: array
          items:
            $ref: "#/components/schemas/ObjectId"
      - name: level1
        in: query
        schema:
          type: string
      - name: level2
        in: query
        schema:
          type: string
      - name: name
        in: query
        schema:
          type: string
      - name: origin
        in: query
        schema:
          type: string
      - name: page-index
        in: query
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: page-size
        in: query
        schema:
          type: integer
          format: int32
          minimum: 0
      - name: site-id
        in: query
        schema:
          type: string
      - name: sort-column
        in: query
        schema:
          type: string
      - name: sort-order
        in: query
        schema:
          $ref: "#/components/schemas/SortOrder"
      - name: updated
        in: query
        schema:
          $ref: "#/components/schemas/Date"
      - name: venue-id
        in: query
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Venue"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Get Venues
      tags:
      - Venue Resource
      security:
      - SecurityScheme:
        - System
        - SuperAdmin
        - Admin
        - Member
        - Viewer
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Venue"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Venue"
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
        "400":
          description: Bad Request
      summary: Create Venue
      tags:
      - Venue Resource
      security:
      - SecurityScheme:
        - System
        - SuperAdmin
        - Admin
  /venue/{venueId}:
    get:
      parameters:
      - name: venueId
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Venue"
      summary: Get Venue By Id
      tags:
      - Venue Resource
    delete:
      parameters:
      - name: venueId
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: boolean
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      summary: Delete Venue
      tags:
      - Venue Resource
      security:
      - SecurityScheme:
        - System
        - SuperAdmin
        - Admin
info:
  title: Venue Service API
  version: 1.0.0-SNAPSHOT
