From df6ee0f3e6a0bdeb8356ebacc4e7c3afb51a544e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 May 2022 11:14:37 +0200 Subject: [PATCH] Bug 32030: eHolding - API specs Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- api/v1/swagger/definitions/erm_eholding.yaml | 134 +++++++ api/v1/swagger/paths/erm_eholdings.yaml | 373 +++++++++++++++++++ api/v1/swagger/swagger.yaml | 12 + 3 files changed, 519 insertions(+) create mode 100644 api/v1/swagger/definitions/erm_eholding.yaml create mode 100644 api/v1/swagger/paths/erm_eholdings.yaml diff --git a/api/v1/swagger/definitions/erm_eholding.yaml b/api/v1/swagger/definitions/erm_eholding.yaml new file mode 100644 index 0000000000..ce7417cbf5 --- /dev/null +++ b/api/v1/swagger/definitions/erm_eholding.yaml @@ -0,0 +1,134 @@ +--- +type: object +properties: + eholding_id: + type: integer + description: internally assigned identifier + readOnly: true + publication_title: + description: publication_title of the eHolding + type: string + print_identifier: + description: print_identifier of the eHolding + type: + - string + - "null" + online_identifier: + description: online_identifier of the eHolding + type: + - string + - "null" + date_first_issue_online: + description: date_first_issue_online of the eHolding + type: + - string + - "null" + num_first_vol_online: + description: num_first_vol_online of the eHolding + type: + - string + - "null" + num_first_issue_online: + description: num_first_issue_online of the eHolding + type: + - string + - "null" + date_last_issue_online: + description: date_last_issue_online of the eHolding + type: + - string + - "null" + num_last_vol_online: + description: num_last_vol_online of the eHolding + type: + - string + - "null" + num_last_issue_online: + description: num_last_issue_online of the eHolding + type: + - string + - "null" + title_url: + description: title_url of the eHolding + type: + - string + - "null" + first_author: + description: first_author of the eHolding + type: + - string + - "null" + title_id: + description: title_id of the eHolding + type: + - string + - "null" + embargo_info: + description: embargo_info of the eHolding + type: + - string + - "null" + coverage_depth: + description: coverage_depth of the eHolding + type: + - string + - "null" + notes: + description: notes of the eHolding + type: + - string + - "null" + publisher_name: + description: publisher_name of the eHolding + type: + - string + - "null" + publication_type: + description: publication_type of the eHolding + type: + - string + - "null" + date_monograph_published_print: + description: date_monograph_published_print of the eHolding + type: + - string + - "null" + date_monograph_published_online: + description: date_monograph_published_online of the eHolding + type: + - string + - "null" + monograph_volume: + description: monograph_volume of the eHolding + type: + - string + - "null" + monograph_edition: + description: monograph_edition of the eHolding + type: + - string + - "null" + first_editor: + description: first_editor of the eHolding + type: + - string + - "null" + parent_publication_title_id: + description: parent_publication_title_id of the eHolding + type: + - string + - "null" + preceeding_publication_title_id: + description: preceeding_publication_title_id of the eHolding + type: + - string + - "null" + access_type: + description: access_type of the eHolding + type: + - string + - "null" + +additionalProperties: false +required: + - publication_title diff --git a/api/v1/swagger/paths/erm_eholdings.yaml b/api/v1/swagger/paths/erm_eholdings.yaml new file mode 100644 index 0000000000..de67b8ab64 --- /dev/null +++ b/api/v1/swagger/paths/erm_eholdings.yaml @@ -0,0 +1,373 @@ +--- +/erm/eholdings: + get: + x-mojo-to: ERM::EHoldings#list + operationId: listErmEHoldings + tags: + - eholding + summary: List eholdings + produces: + - application/json + parameters: + - description: Case insensitive search on eholding eholding_id + in: query + name: eholding_id + required: false + type: integer + - description: Case insensitive search on eholding publication_title + in: query + name: publication_title + required: false + type: string + - description: Case insensitive search on eholding print_identifier + in: query + name: print_identifier + required: false + type: string + - description: Case insensitive search on eholding online_identifier + in: query + name: online_identifier + required: false + type: string + - description: Case insensitive search on eholding date_first_issue_online + in: query + name: date_first_issue_online + required: false + type: string + - description: Case insensitive search on eholding num_first_vol_online + in: query + name: num_first_vol_online + required: false + type: string + - description: Case insensitive search on eholding num_first_issue_online + in: query + name: num_first_issue_online + required: false + type: string + - description: Case insensitive search on eholding date_last_issue_online + in: query + name: date_last_issue_online + required: false + type: string + - description: Case insensitive search on eholding num_last_vol_online + in: query + name: num_last_vol_online + required: false + type: string + - description: Case insensitive search on eholding num_last_issue_online + in: query + name: num_last_issue_online + required: false + type: string + - description: Case insensitive search on eholding title_url + in: query + name: title_url + required: false + type: string + - description: Case insensitive search on eholding first_author + in: query + name: first_author + required: false + type: string + - description: Case insensitive search on eholding title_id + in: query + name: title_id + required: false + type: string + - description: Case insensitive search on eholding embargo_info + in: query + name: embargo_info + required: false + type: string + - description: Case insensitive search on eholding coverage_depth + in: query + name: coverage_depth + required: false + type: string + - description: Case insensitive search on eholding notes + in: query + name: notes + required: false + type: string + - description: Case insensitive search on eholding publisher_name + in: query + name: publisher_name + required: false + type: string + - description: Case insensitive search on eholding publication_type + in: query + name: publication_type + required: false + type: string + - description: Case insensitive search on eholding date_monograph_published_print + in: query + name: date_monograph_published_print + required: false + type: string + - description: Case insensitive search on eholding date_monograph_published_online + in: query + name: date_monograph_published_online + required: false + type: string + - description: Case insensitive search on eholding monograph_volume + in: query + name: monograph_volume + required: false + type: string + - description: Case insensitive search on eholding monograph_edition + in: query + name: monograph_edition + required: false + type: string + - description: Case insensitive search on eholding first_editor + in: query + name: first_editor + required: false + type: string + - description: Case insensitive search on eholding parent_publication_title_id + in: query + name: parent_publication_title_id + required: false + type: string + - description: Case insensitive search on eholding preceeding_publication_title_id + in: query + name: preceeding_publication_title_id + required: false + type: string + - description: Case insensitive search on eholding access_type + in: query + name: access_type + required: false + type: string + - $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/q_header" + responses: + 200: + description: A list of eholding + schema: + items: + $ref: "../swagger.yaml#/definitions/erm_eholding" + type: array + 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 + post: + x-mojo-to: ERM::EHoldings#add + operationId: addErmEHoldings + tags: + - eholding + summary: Add eholding + consumes: + - application/json + produces: + - application/json + parameters: + - description: A JSON object containing information about the new eholding + in: body + name: body + required: true + schema: + $ref: "../swagger.yaml#/definitions/erm_eholding" + responses: + 201: + description: A successfully created eholding + schema: + items: + $ref: "../swagger.yaml#/definitions/erm_eholding" + 400: + description: Bad parameter + 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 creating 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 +"/erm/eholdings/{eholding_id}": + get: + x-mojo-to: ERM::EHoldings#get + operationId: getErmEHoldings + tags: + - eholding + summary: Get eholding + produces: + - application/json + parameters: + - $ref: "../swagger.yaml#/parameters/eholding_id_pp" + responses: + 200: + description: Aneholding + schema: + items: + $ref: "../swagger.yaml#/definitions/erm_eholding" + 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 + x-koha-embed: + - agreements + put: + x-mojo-to: ERM::EHoldings#update + operationId: updateErmEHoldings + tags: + - eholding + summary: Update eholding + consumes: + - application/json + produces: + - application/json + parameters: + - $ref: "../swagger.yaml#/parameters/eholding_id_pp" + - name: body + in: body + description: A JSON object containing new information about existing eholding + required: true + schema: + $ref: "../swagger.yaml#/definitions/erm_eholding" + responses: + 200: + description: A successfully updated eholding + schema: + items: + $ref: "../swagger.yaml#/definitions/erm_eholding" + 400: + description: Bad parameter + 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 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: + erm: 1 + x-koha-embed: + - agreements + delete: + x-mojo-to: ERM::EHoldings#delete + operationId: deleteErmEHoldings + tags: + - eholding + summary: Delete eholding + produces: + - application/json + parameters: + - $ref: "../swagger.yaml#/parameters/eholding_id_pp" + responses: + 204: + description: eholding deleted + 400: + description: eholding deletion failed + 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 diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index e0962d408c..0c97fffb65 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -24,6 +24,8 @@ definitions: $ref: ./definitions/city.yaml erm_agreement: $ref: ./definitions/erm_agreement.yaml + erm_eholding: + $ref: ./definitions/erm_eholding.yaml erm_license: $ref: ./definitions/erm_license.yaml erm_package: @@ -167,6 +169,10 @@ paths: $ref: ./paths/erm_agreements.yaml#/~1erm~1agreements "/erm/agreements/{agreement_id}": $ref: "./paths/erm_agreements.yaml#/~1erm~1agreements~1{agreement_id}" + /erm/eholdings: + $ref: ./paths/erm_eholdings.yaml#/~1erm~1eholdings + "/erm/eholdings/{eholding_id}": + $ref: "./paths/erm_eholdings.yaml#/~1erm~1eholdings~1{eholding_id}" /erm/licenses: $ref: ./paths/erm_licenses.yaml#/~1erm~1licenses "/erm/licenses/{license_id}": @@ -344,6 +350,12 @@ parameters: name: club_id required: true type: integer + eholding_id_pp: + description: eHoldings internal identifier + in: path + name: eholding_id + required: true + type: integer fund_id_pp: description: Fund id in: path -- 2.20.1