openapi: 3.0.3
info:
  title: Game server
  version: 1.0.0
components:
  schemas: {}
paths:
  /api/v1/history/link:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                session:
                  type: string
                casino_id:
                  type: string
                sign:
                  type: string
              required:
                - session
                - casino_id
        required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
  /api/v1/machine/list:
    post:
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    casino_id:
                      type: string
                      description: CAS ID from config
                    sign:
                      type: string
                  required:
                    - casino_id
                    - sign
                  additionalProperties: false
                - type: object
                  properties:
                    filter:
                      type: array
                      items:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            eq:
                              type: string
                            neq:
                              type: string
                            regex:
                              type: string
                            gt:
                              type: integer
                            ge:
                              type: integer
                            lt:
                              type: integer
                            le:
                              type: integer
                          additionalProperties: false
                          minProperties: 1
                    sign:
                      type: string
                  required:
                    - filter
                    - sign
                  additionalProperties: false
            examples:
              example1:
                value:
                  casino_id: my_cas
              example2:
                value:
                  filter:
                    - manufacturer:
                        eq: SampleManufacturer
                    - denomination:
                        ge: 5
                        lt: 20
                      serial:
                        regex: ^.*02$
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              enum:
                                - machine
                            serial:
                              type: string
                            status:
                              type: string
                            tags:
                              type: object
                              additionalProperties:
                                oneOf:
                                  - type: string
                                  - type: number
                          required:
                            - type
                            - serial
                            - status
                            - tags
                        - type: object
                          properties:
                            type:
                              enum:
                                - lobby
                            id:
                              type: string
                          required:
                            - type
                            - id
                required:
                  - items
  /api/v1/session/init:
    post:
      description: Create a new session on GameServer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                casino_id:
                  type: string
                  description: CAS ID from config
                game_id:
                  type: string
                  description: Either machine's identifier (serial), or lobby ID from config
                colorscheme:
                  type: string
                  description: Color scheme to be applied to the client appearance
                session:
                  type: string
                  description: Session identifier on CAS side
                user_id:
                  type: string
                  description: CAS user identifier
                currency:
                  type: string
                locale:
                  type: string
                geo:
                  type: string
                denomination:
                  type: integer
                  minimum: 1
                balance:
                  type: integer
                  minimum: 0
                  description: Initial balance from CAS
                return_url:
                  type: string
                  description: An URL for redirecting a user after exiting. Works only links
                    opened in new tab, ignored for iframes
                cashier_url:
                  type: string
                  description: An URL for redirecting to deposit page
                sub_id:
                  type: string
                  description: IDs of sub-clients, in the form of comma-separated list
                buffer:
                  type: string
                  description: Used for integration with stateless systems
                sign:
                  type: string
              required:
                - casino_id
                - game_id
                - session
                - currency
            example:
              casino_id: my_cas
              game_id: FFFFFFF1
              session: a177fc5d-f190-41be-8aaf-45a7022de482
              user_id: my_user
              currency: USD
              locale: en
              denomination: 1000
              balance: 17020
              sign: 681a8e00d075397ac666d347490f19b565b639d25ac31775b157d35d8855d854
        required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: Generated URL
                required:
                  - url
  /api/v1/manage/machines/:
    get:
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machines:
                    type: array
                    items:
                      type: object
                      properties:
                        serial:
                          type: string
                        is_alive:
                          type: boolean
                        status:
                          type: string
                        session:
                          type: object
                          properties:
                            id:
                              type: string
                            user_id:
                              type: string
                            lobby_id:
                              type: string
                            currency:
                              type: string
                            balance:
                              type: integer
                            denomination:
                              type: integer
                            machine_balance:
                              type: integer
                          required:
                            - id
                            - lobby_id
                            - currency
                            - balance
                            - denomination
                            - machine_balance
                        tags:
                          type: object
                      required:
                        - serial
                        - is_alive
                        - status
                required:
                  - machines
                additionalProperties: false
  /api/v1/manage/machines/{serial}:
    get:
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machine:
                    type: object
                    properties:
                      serial:
                        type: string
                      is_alive:
                        type: boolean
                      status:
                        type: string
                      session:
                        type: object
                        properties:
                          id:
                            type: string
                          user_id:
                            type: string
                          lobby_id:
                            type: string
                          currency:
                            type: string
                          balance:
                            type: integer
                          denomination:
                            type: integer
                          machine_balance:
                            type: integer
                        required:
                          - id
                          - lobby_id
                          - currency
                          - balance
                          - denomination
                          - machine_balance
                      tags:
                        type: object
                    required:
                      - serial
                      - is_alive
                      - status
                required:
                  - machine
                additionalProperties: false
  /api/v1/manage/machines/{serial}/command:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              required:
                - command
        required: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                required:
                  - result
  /api/v1/manage/machines/{serial}/reset:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              additionalProperties: false
              nullable: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machine:
                    type: object
                    properties:
                      serial:
                        type: string
                      is_alive:
                        type: boolean
                      status:
                        type: string
                      session:
                        type: object
                        properties:
                          id:
                            type: string
                          user_id:
                            type: string
                          lobby_id:
                            type: string
                          currency:
                            type: string
                          balance:
                            type: integer
                          denomination:
                            type: integer
                          machine_balance:
                            type: integer
                        required:
                          - id
                          - lobby_id
                          - currency
                          - balance
                          - denomination
                          - machine_balance
                      tags:
                        type: object
                    required:
                      - serial
                      - is_alive
                      - status
                required:
                  - machine
                additionalProperties: false
  /api/v1/manage/machines/reset:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              additionalProperties: false
              nullable: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machines:
                    type: array
                    items:
                      type: object
                      properties:
                        serial:
                          type: string
                        is_alive:
                          type: boolean
                        status:
                          type: string
                        session:
                          type: object
                          properties:
                            id:
                              type: string
                            user_id:
                              type: string
                            lobby_id:
                              type: string
                            currency:
                              type: string
                            balance:
                              type: integer
                            denomination:
                              type: integer
                            machine_balance:
                              type: integer
                          required:
                            - id
                            - lobby_id
                            - currency
                            - balance
                            - denomination
                            - machine_balance
                        tags:
                          type: object
                      required:
                        - serial
                        - is_alive
                        - status
                required:
                  - machines
                additionalProperties: false
  /api/v1/manage/machines/{serial}/update:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                serial:
                  type: string
                status:
                  enum:
                    - busy
                    - online
                    - payout
                    - disabled
                    - service
                    - service-payout
                game_start:
                  type: boolean
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      deprecated: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machine:
                    type: object
                    properties:
                      serial:
                        type: string
                      is_alive:
                        type: boolean
                      status:
                        type: string
                      session:
                        type: object
                        properties:
                          id:
                            type: string
                          user_id:
                            type: string
                          lobby_id:
                            type: string
                          currency:
                            type: string
                          balance:
                            type: integer
                          denomination:
                            type: integer
                          machine_balance:
                            type: integer
                        required:
                          - id
                          - lobby_id
                          - currency
                          - balance
                          - denomination
                          - machine_balance
                      tags:
                        type: object
                    required:
                      - serial
                      - is_alive
                      - status
                required:
                  - machine
                additionalProperties: false
  /api/v1/manage/machines/{serial}/service/enter:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              additionalProperties: false
              nullable: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machine:
                    type: object
                    properties:
                      serial:
                        type: string
                      is_alive:
                        type: boolean
                      status:
                        type: string
                      session:
                        type: object
                        properties:
                          id:
                            type: string
                          user_id:
                            type: string
                          lobby_id:
                            type: string
                          currency:
                            type: string
                          balance:
                            type: integer
                          denomination:
                            type: integer
                          machine_balance:
                            type: integer
                        required:
                          - id
                          - lobby_id
                          - currency
                          - balance
                          - denomination
                          - machine_balance
                      tags:
                        type: object
                    required:
                      - serial
                      - is_alive
                      - status
                required:
                  - machine
                additionalProperties: false
  /api/v1/manage/machines/{serial}/service/exit:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              additionalProperties: false
              nullable: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  machine:
                    type: object
                    properties:
                      serial:
                        type: string
                      is_alive:
                        type: boolean
                      status:
                        type: string
                      session:
                        type: object
                        properties:
                          id:
                            type: string
                          user_id:
                            type: string
                          lobby_id:
                            type: string
                          currency:
                            type: string
                          balance:
                            type: integer
                          denomination:
                            type: integer
                          machine_balance:
                            type: integer
                        required:
                          - id
                          - lobby_id
                          - currency
                          - balance
                          - denomination
                          - machine_balance
                      tags:
                        type: object
                    required:
                      - serial
                      - is_alive
                      - status
                required:
                  - machine
                additionalProperties: false
  /api/v1/manage/machines/{serial}/service/session/init:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              additionalProperties: false
              nullable: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                required:
                  - url
  /api/v1/manage/machines/service/session:
    get:
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessions:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        serial:
                          type: string
                      required:
                        - id
                        - serial
                      additionalProperties: false
                required:
                  - sessions
  /api/v1/manage/machines/{serial}/video-link:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                ipAddress:
                  type: string
                userId:
                  type: string
                userAlias:
                  type: string
                comment:
                  type: string
              additionalProperties: false
              nullable: true
      parameters:
        - schema:
            type: string
          in: query
          name: key
          required: true
        - schema:
            type: string
          in: path
          name: serial
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                required:
                  - url
externalDocs:
  url: /cas/documentation
  description: CAS API
