---
openapi: 3.0.0
info:
  title: Micro-wallet
  version: '2.0'
servers:
- url: https://wappsto.com/services/2.0
  description: Server to connect to the API
components:
  schemas:
    Deletelist:
      title: Deletelist
      type: object
      properties:
        deleted:
          type: array
          items:
            type: string
          description: List of deleted objects
        child_deleted:
          type: array
          items:
            type: string
          description: List of deleted children object related to the chosen objects
            to delete
        shared_deleted:
          type: array
          items:
            type: string
          description: List of removed objects previosly shared and accepted by the
            user
        shared_child_deleted:
          type: array
          items:
            type: string
          description: List of removed children objects previosly shared and accepted
            by the user related to the chosen objects to delete
        not_deleted:
          type: array
          items:
            type: string
          description: List of not deleted objects
        child_not_deleted:
          type: array
          items:
            type: string
          description: List of not deleted children object related to the chosen objects
            to delete
        shared_not_deleted:
          type: array
          items:
            type: string
          description: List of not removed objects previosly shared and accepted by
            the user
        shared_child_not_deleted:
          type: array
          items:
            type: string
          description: List of not removed children objects previosly shared and accepted
            by the user related to the chosen objects to delete
        pending:
          type: array
          items:
            type: string
          description: List of objects that will be deleted eventually
        child_pending:
          type: array
          items:
            type: string
          description: List of children objects that will be deleted eventually
        owned_not_deleted_because_it_has_parent:
          type: array
          items:
            type: string
          description: List of owned object not deleted since they have a parent
        shared_not_deleted_because_it_has_parent:
          type: array
          items:
            type: string
          description: List of shared object not deleted since they have a parent
        code:
          type: integer
          description: Code of the deletion
        message:
          type: string
          description: Final status of the deletion
        error:
          type: string
          description: Possible incurred errors
        meta:
          type: object
          description: Meta data of the object
        unsuccessful:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              message:
                type: string
              data:
                type: object
          description: An array that includes a more deep description about the reason
            of unsuccessful deletions
      additionalProperties: false
      description: Output obtained when one or multiple objects are deleted with a
        DELETE request
    Httpresponse:
      title: Httpresponse
      type: object
      properties:
        message:
          type: string
          description: Message of the error
        data:
          type: object
          description: More information about the error
        code:
          type: integer
          description: Identifier code of the error
        service:
          type: string
          description: Service that sent the error
        meta:
          type: object
          description: Meta data of the object
      additionalProperties: false
      description: Output obtain when a fast communication is returned (usually an
        error)
    Idlist:
      title: Idlist
      type: object
      properties:
        id:
          items:
            type: string
            pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          type: array
          description: Ids found
        more:
          type: boolean
          description: If true, it means that using offset it is possible to retrieve
            other values
        limit:
          type: integer
          multipleOf: 1
          minimum: 1
          description: Limit used to retrieve the ids
        count:
          type: integer
          multipleOf: 1
          minimum: 0
          description: Number of ids returned
        data:
          type: object
          description: Further information in relation of the service
        child:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              version:
                type: string
                pattern: "(\\d+)\\.(\\d+)"
          description: It is an array that gives a brief description of the type and
            the version of the retrieved objects
        meta:
          type: object
      additionalProperties: false
      description: Output obtain when a list is returned
    Fetch:
      title: Fetch
      type: object
      properties:
        filter:
          type: object
        return:
          type: string
          description: A graphQL string that describes the format it needs to be returned
        table:
          type: boolean
          description: If true, use iot table to fetch the data
        data:
          type: object
          description: The output obtained after filtering and parsing the results
            with the GraphQL request
        meta:
          type: object
          description: Meta data of the object
      additionalProperties: false
      description: Output obtained when the input is a fetch request
    Counter:
      title: Counter
      type: object
      properties:
        meta:
          type: object
          description: Meta data of the object
          example:
            type: counter
            version: '2.0'
        data:
          type: array
          items:
            type: object
          description: Data of counter endpoint
          example:
          - time: '2021-03-19T00:00:00.000000Z'
            request: 4
            request_time: 29
            traffic_in: 19958
            traffic_out: 23811
            iot_traffic_in: 0
            iot_traffic_out: 0
            log_row: 0
            document: 40
            daily_point: 46
            total_document: 40
            total_log_row: 0
            total_point: 86
            user_id: bd54e622-0e1e-47c1-95e0-8cd5a7349e64
            email: test_soledad_haley@seluxit.com
      additionalProperties: false
      description: Endpoint to return data about the usage of the Wappsto API
  parameters:
    url_id:
      name: :id
      in: path
      required: true
      description: Id of the given object
      schema:
        type: string
        pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
    url_hex:
      name: :token
      in: path
      required: true
      description: Token used for some operation
      schema:
        type: string
        pattern: "^[0-9a-fA-F]{64}$"
tags:
- name: Counter
  description: Endpoint to return data about the usage of the Wappsto API
paths:
  "/counter":
    get:
      tags:
      - Counter
      summary: Retrieve counter wallet
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Counter"
              example:
                meta:
                  type: counter
                  version: '2.0'
                data:
                - time: '2021-03-19T00:00:00.000000Z'
                  request: 4
                  request_time: 29
                  traffic_in: 19958
                  traffic_out: 23811
                  iot_traffic_in: 0
                  iot_traffic_out: 0
                  log_row: 0
                  document: 40
                  daily_point: 46
                  total_document: 40
                  total_log_row: 0
                  total_point: 86
                  user_id: bd54e622-0e1e-47c1-95e0-8cd5a7349e64
                  email: test_soledad_haley@seluxit.com
  "/counter/number_networks":
    get:
      tags:
      - Counter
      summary: Retrieve number networks
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Counter"
              example:
                meta:
                  type: counter
                  version: '2.0'
                data:
                - time: '2021-03-19T00:00:00.000000Z'
                  request: 4
                  request_time: 29
                  traffic_in: 19958
                  traffic_out: 23811
                  iot_traffic_in: 0
                  iot_traffic_out: 0
                  log_row: 0
                  document: 40
                  daily_point: 46
                  total_document: 40
                  total_log_row: 0
                  total_point: 86
                  user_id: bd54e622-0e1e-47c1-95e0-8cd5a7349e64
                  email: test_soledad_haley@seluxit.com
  "/counter/network":
    get:
      tags:
      - Counter
      summary: Retrieve networks' counter
      parameters: []
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/Counter"
              example:
                meta:
                  type: counter
                  version: '2.0'
                data:
                - time: '2021-03-19T00:00:00.000000Z'
                  request: 4
                  request_time: 29
                  traffic_in: 19958
                  traffic_out: 23811
                  iot_traffic_in: 0
                  iot_traffic_out: 0
                  log_row: 0
                  document: 40
                  daily_point: 46
                  total_document: 40
                  total_log_row: 0
                  total_point: 86
                  user_id: bd54e622-0e1e-47c1-95e0-8cd5a7349e64
                  email: test_soledad_haley@seluxit.com
