# Copyright 2021 - 2021 PeopleWare n.v.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

in: header
name: x-if-unmodified-since
description: >-
  Clients can choose to apply optimistic locking by sending the `if-not-modified-since` header, with the `createdAt` of
  the version of the resource edits are based on as value. If the value provided by the client does not equal the most
  recent value in persistent storage, the `PUT` is refused with a `412` status code, whose body contains the most recent
  version of the resource.


  See [RFC 7232 Section 3.4](https://tools.ietf.org/html/rfc7232#section-3.4). We do not use a _HTTP Date_ however, but
  represent a moment in time as ISO-8601 expressed in UTC ('Z'), to ms precision, and the reference is the value of
  `createdAt` in the resource, not the value of the `date` header.
schema:
  $ref: '../time/ChangeDateTime.yaml'
