Loan anonymization preference storage (v1.0)

http://localhost:9130

Table of contents

Loan anonymization preference storage API

Replace the stored loan anonymization preferences of the users who deviate from the library policy

/loan-anonymization-preference-storage

PUT /loan-anonymization-preference-storage/loan-anonymization-preferences

Replace all stored preferences: add or update the given users, remove all others

PUT /loan-anonymization-preference-storage/loan-anonymization-preferences
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "All users whose loan anonymization preference deviates from the library policy",
  "type": "object",
  "properties": {
    "preferences": {
      "description": "One entry per user, users who follow the library policy are not listed",
      "type": "array",
      "items": {
        "description": "Loan anonymization preference of one user",
        "type": "object",
        "javaType": "org.folio.rest.jaxrs.model.UserLoanAnonymizationPreference",
        "properties": {
          "userId": {
            "description": "ID of the user",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "uuid.schema",
            "type": "string",
            "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
          },
          "preference": {
            "description": "The user's loan anonymization preference",
            "type": "string",
            "enum": [
              "asEarlyAsPossible",
              "never"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "userId",
          "preference"
        ]
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "preferences"
  ]
}

Response 204

Preferences replaced

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "errors.schema",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "id": "error.schema",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "id": "parameters.schema",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator