get:
  operationId: getNonEmployeeRecord
  # security:
  #   - oauth2: [idn:nesr:read]
  tags:
    - Non-Employee Lifecycle Management
  summary: Get a Non-Employee Record
  description: >-
    This gets a non-employee record.

    Requires role context of `idn:nesr:read`
  parameters:
    - in: path
      name: id
      description: >-
        Non-Employee record id (UUID)
      required: true
      example: ef38f94347e94562b5bb8424a56397d8
      schema:
        type: string
  responses:
    "200":
      description: Non-Employee record object
      content:
        application/json:
          schema:
            $ref: "../schemas/non-employee/NonEmployeeRecord.yaml"
    "400":
      $ref: "../responses/400.yaml"
    "401":
      $ref: "../responses/401.yaml"
    "403":
      $ref: "../responses/403.yaml"
    "429":
      $ref: "../responses/429.yaml"
    "500":
      $ref: "../responses/500.yaml"
put:
  operationId: updateNonEmployeeRecord
  security:
    - oauth2: []
  tags:
    - Non-Employee Lifecycle Management
  summary: Update Non-Employee Record
  description: >-
    This request will update a non-employee record. There are two
    contextual uses for this endpoint:
      1. The user has the role context of `idn:nesr:update`, in which case they
    update all available fields.
      2. The user is owner of the source, in this case they can only update the
    end date.
  parameters:
    - in: path
      name: id
      description: >-
        Non-employee record id (UUID)
      example: ef38f94347e94562b5bb8424a56397d8
      required: true
      schema:
        type: string
  requestBody:
    description:
      Non-employee record creation request body. Attributes are restricted by
      user type. Owner of source can update end date. Organization admins can
      update all available fields.
    required: true
    content:
      application/json:
        schema:
          $ref: "../schemas/non-employee/NonEmployeeRequestBody.yaml"
  responses:
    "200":
      description: An updated non-employee record.
      content:
        application/json:
          schema:
            $ref: "../schemas/non-employee/NonEmployeeRecord.yaml"
    "400":
      $ref: "../responses/400.yaml"
    "401":
      $ref: "../responses/401.yaml"
    "403":
      $ref: "../responses/403.yaml"
    "404":
      $ref: "../responses/404.yaml"
    "429":
      $ref: "../responses/429.yaml"
    "500":
      $ref: "../responses/500.yaml"
patch:
  operationId: patchNonEmployeeRecord
  security:
    - oauth2: []
  tags:
    - Non-Employee Lifecycle Management
  summary: Patch Non-Employee Record
  description: >-
    This request will patch a non-employee record. There are two
    contextual uses for this endpoint:
      1. The user has the role context of `idn:nesr:update`, in which case they
    update all available fields.
      2. The user is owner of the source, in this case they can only update the
    end date.
  parameters:
    - in: path
      name: id
      description: >-
        Non-employee record id (UUID)
      example: ef38f94347e94562b5bb8424a56397d8
      required: true
      schema:
        type: string
  requestBody:
    description:
      A list of non-employee update operations according to the [JSON
      Patch](https://tools.ietf.org/html/rfc6902) standard. Attributes are
      restricted by user type. Owner of source can update end date. Organization
      admins can update all available fields.
    required: true
    content:
      application/json-patch+json:
        schema:
          type: array
          items:
            $ref: "../schemas/JsonPatchOperation.yaml"
        example:
          - op: "replace"
            path: "/endDate"
            value: "2019-08-23T18:40:35.772Z"
  responses:
    "200":
      description: A patched non-employee record.
      content:
        application/json:
          schema:
            $ref: "../schemas/non-employee/NonEmployeeRecord.yaml"
    "400":
      $ref: "../responses/400.yaml"
    "401":
      $ref: "../responses/401.yaml"
    "403":
      $ref: "../responses/403.yaml"
    "404":
      $ref: "../responses/404.yaml"
    "429":
      $ref: "../responses/429.yaml"
    "500":
      $ref: "../responses/500.yaml"
delete:
  operationId: deleteNonEmployeeRecord
  # security:
  #   - oauth2: [idn:nesr:delete]
  tags:
    - Non-Employee Lifecycle Management
  summary: Delete Non-Employee Record
  description: >-
    This request will delete a non-employee record.

    Requires role context of `idn:nesr:delete`
  parameters:
    - in: path
      name: id
      description: >-
        Non-Employee record id (UUID)
      example: ef38f94347e94562b5bb8424a56397d8
      required: true
      schema:
        type: string
  responses:
    "204":
      $ref: "../responses/204.yaml"
    "400":
      $ref: "../responses/400.yaml"
    "401":
      $ref: "../responses/401.yaml"
    "403":
      $ref: "../responses/403.yaml"
    "429":
      $ref: "../responses/429.yaml"
    "500":
      $ref: "../responses/500.yaml"
