post:
  operationId: nonEmployeeRecordCreation
  # security:
  #   - oauth2: [idn:nesr:create]
  tags:
    - Non-Employee Lifecycle Management
  summary: Create Non-Employee Record
  description: >-
    This request will create a non-employee record.<br><br>

    Requires role context of `idn:nesr:create` 
  requestBody:
    description: Non-Employee record creation request body.
    required: true
    content:
      application/json:
        schema:
          $ref: '../schemas/non-employee/NonEmployeeRequestBody.yaml'
  responses:
    '200':
      description: Created 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'
    '429':
      $ref: '../responses/429.yaml'
    '500':
      $ref: '../responses/500.yaml'
get:
  operationId: nonEmployeeRecordList
  security:
    - oauth2: []
  tags:
    - Non-Employee Lifecycle Management
  summary: List Non-Employee Records
  description: >-
    This gets a list of non-employee records.<br><br>
    There are two contextual uses for this endpoint:<br>
      1. The user has the role context of `idn:nesr:read`, in which case they can get a list of all of the non-employees.<br>
      2. The user is an account manager, in which case they can get a list of the non-employees that they manage.
  parameters:
    - $ref: '../parameters/limit.yaml'
    - $ref: '../parameters/offset.yaml'
    - $ref: '../parameters/count.yaml'
    - in: query
      name: sorters
      required: false
      schema:
        type: string
        format: comma-separated
      example: accountName,sourceId
      description: >-
        Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://community.sailpoint.com/t5/IdentityNow-Wiki/V3-API-Standard-Collection-Parameters/ta-p/156407#toc-hId-2058949)<br/><br/>
        Sorting is supported for the following fields: **id, accountName, sourceId, manager, firstName, lastName, email, phone, startDate, endDate, created, modified**
    - in: query
      name: filters
      required: false
      schema:
        type: string
      example: sourceId eq "2c91808568c529c60168cca6f90c1313"
      description: >-
        Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://community.sailpoint.com/t5/IdentityNow-Wiki/V3-API-Standard-Collection-Parameters/ta-p/156407)<br/><br/>
        Filtering is supported for the following fields and operators:<br/><br/>
        **sourceId**: *eq* <br/><br/>
        *Example:* sourceId eq "2c91808568c529c60168cca6f90c1313"
  responses:
    '200':
      description: Non-Employee record objects
      content:
        application/json:
          schema:
            type: array
            items:
              $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'
