---
"/erm/counter_files/{erm_counter_files_id}/file/content":
  get:
    x-mojo-to: ERM::EUsage::CounterFiles#get
    operationId: downloadCounterFile
    tags:
      - erm_counter_files
    summary: Download Counter file
    produces:
      - application/octet-stream
    parameters:
      - description: Case insensitive search on erm_counter_files_id
        in: path
        name: erm_counter_files_id
        required: true
        type: integer
    responses:
      200:
        description: A counter file
        schema:
          type: file
      400:
        description: Bad request
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      401:
        description: Authentication required
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      403:
        description: Access forbidden
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      404:
        description: Ressource not found
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      500:
        description: |-
          Internal server error. Possible `error_code` attribute values:
          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      503:
        description: Under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        erm: 1
/erm/counter_files:
  get:
    x-mojo-to: ERM::EUsage::CounterFiles#list
    operationId: listErmCounterFiles
    tags:
      - erm_counter_files
    summary: List counter_files
    produces:
      - application/json
    parameters:
      - description: Case insensitive search on counter_file erm_counter_files_id
        in: query
        name: erm_counter_files_id
        required: false
        type: integer
      - description: Case insensitive search on counter_file usage_data_provider_id
        in: query
        name: usage_data_provider_id
        required: false
        type: integer
      - description: Case insensitive search on counter_file filename
        in: query
        name: filename
        required: false
        type: string
      - description: Case insensitive search on counter_file type
        in: query
        name: type
        required: false
        type: string
      - description: Case insensitive search on counter_file file_content
        in: query
        name: file_content
        required: false
        type: string
      - description: Case insensitive search on counter_file date_uploaded
        in: query
        name: date_uploaded
        required: false
        type: string
      - name: x-koha-embed
        in: header
        required: false
        description: Embed list sent as a request header
        type: array
        items:
          type: string
          enum:
            - counter_logs
        collectionFormat: csv
      - $ref: "../swagger.yaml#/parameters/match"
      - $ref: "../swagger.yaml#/parameters/order_by"
      - $ref: "../swagger.yaml#/parameters/page"
      - $ref: "../swagger.yaml#/parameters/per_page"
      - $ref: "../swagger.yaml#/parameters/q_param"
      - $ref: "../swagger.yaml#/parameters/q_body"
    responses:
      200:
        description: A list of counter_files
        schema:
          items:
            $ref: "../swagger.yaml#/definitions/erm_counter_file"
          type: array
      400:
        description: |
          Bad request. Possible `error_code` attribute values:

            * `invalid_query`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      403:
        description: Access forbidden
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      500:
        description: |-
          Internal server error. Possible `error_code` attribute values:
          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      503:
        description: Under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        erm: 1
"/erm/counter_files/{erm_counter_files_id}":
  delete:
    x-mojo-to: ERM::EUsage::CounterFiles#delete
    operationId: deleteERMCounterFiles
    tags:
      - erm_counter_files
    summary: Delete counter_file
    produces:
      - application/json
    parameters:
      - $ref: "../swagger.yaml#/parameters/erm_counter_files_id_pp"
    responses:
      204:
        description: counter_file deleted
      400:
        description: Bad request
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      401:
        description: authentication required
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      403:
        description: access forbidden
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      404:
        description: ressource not found
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      409:
        description: conflict in deleting resource
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      500:
        description: |-
          internal server error. possible `error_code` attribute values:
          * `internal_server_error`
        schema:
          $ref: "../swagger.yaml#/definitions/error"
      503:
        description: under maintenance
        schema:
          $ref: "../swagger.yaml#/definitions/error"
    x-koha-authorization:
      permissions:
        erm: 1
