Koha-clms/api/v1/swagger/paths/circulation_rules.yaml

178 lines
5.4 KiB
YAML

---
/circulation_rules:
get:
x-mojo-to: CirculationRules#list_rules
operationId: listCirculationRules
tags:
- circulation_rules
summary: Get circulation rules for a given item type/library/patron combination.
produces:
- application/json
parameters:
- $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"
- $ref: "../swagger.yaml#/parameters/request_id_header"
- name: effective
in: query
description: Boolean indicating whether to return effective rules or all rules. Defaults to true.
required: false
type: boolean
- name: item_type_id
in: query
description: The item type identifier
required: false
type: string
- name: library_id
in: query
description: The library identifier
required: false
type: string
- name: patron_category_id
in: query
description: The patron category identifier
required: false
type: string
- name: rules
in: query
description: A comma-separated list of rule kinds
required: false
type: string
responses:
"200":
description: A list of rules for this item type, library and patron category combination
schema:
type: array
items:
$ref: "../swagger.yaml#/definitions/circulation_rules"
"400":
description: |
Bad request. Possible `error_code` attribute values:
* `invalid_query`
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"
"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:
- circulate: circulate_remaining_permissions
- parameters: manage_circ_rules
- parameters: manage_circ_triggers
put:
x-mojo-to: CirculationRules#set_rules
operationId: setCirculationRules
tags:
- circulation_rules
summary: Update circulation rules
parameters:
- name: body
in: body
description: A JSON object containing new information about circulation rules
required: true
schema:
$ref: "../swagger.yaml#/definitions/circulation_rules"
consumes:
- application/json
produces:
- application/json
responses:
"200":
description: A successfully updated circulation rules set
schema:
items:
$ref: "../swagger.yaml#/definitions/circulation_rules"
"400":
description: |
Bad request.
schema:
$ref: "../swagger.yaml#/definitions/error"
"403":
description: Access forbidden
schema:
$ref: "../swagger.yaml#/definitions/error"
"404":
description: Resource not found
schema:
$ref: "../swagger.yaml#/definitions/error"
"409":
description: Conflict in updating 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:
- circulate: circulate_remaining_permissions
- parameters: manage_circ_rules
- parameters: manage_circ_triggers
/circulation_rules/kinds:
get:
x-mojo-to: CirculationRules#get_kinds
operationId: getCirculationRuleKinds
tags:
- circulation_rules
summary: Get circulation rules kinds
produces:
- application/json
responses:
"200":
description: A map of rule kind information
schema:
type: object
additionalProperties:
$ref: "../swagger.yaml#/definitions/circ-rule-kind"
"400":
description: Bad request
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:
- circulate: circulate_remaining_permissions
- parameters: manage_circ_rules
- parameters: manage_circ_triggers