x-generator: NSwag v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))
swagger: '2.0'
info:
  title: Absorb Integration API
  version: v2
consumes:
  - application/json
produces:
  - application/json
paths:
  /instructor-led-course-sessions/{sessionId}/session-schedules/{sessionScheduleId}/attendance/{id}:
    put:
      tags:
        - Attendances
      summary: Update attendance record.
      description: >-
        Update an existing attendance record associated with the identified
        session, session schedule, and attendance record.
      operationId: Attendances_UpdateAttendance
      parameters:
        - type: string
          name: id
          in: path
          required: true
          description: The attendance Id.
          format: guid
          x-nullable: false
        - type: string
          name: sessionId
          in: path
          required: true
          description: The session Id.
          format: guid
          x-nullable: false
        - type: string
          name: sessionScheduleId
          in: path
          required: true
          description: The session schedule Id.
          format: guid
          x-nullable: false
        - name: requestBody
          in: body
          description: The request body including whether or not the learner was present.
          schema:
            $ref: '#/definitions/UpdateAttendanceRequest'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/AttendanceStatusResource'
        '400':
          x-nullable: false
          description: The required body paramaters were not included.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '403':
          x-nullable: false
          description: >-
            User does not have sufficient permissions to update the attendance
            record.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '404':
          x-nullable: false
          description: The attendance record could not be found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
  /instructor-led-course-sessions/{sessionId}/session-schedules/{sessionScheduleId}/attendance:
    post:
      tags:
        - Attendances
      summary: Create attendance record.
      description: >-
        Create a new attendance record associated with the identified session
        and session schedule.
      operationId: Attendances_CreateAttendance
      parameters:
        - type: string
          name: sessionId
          in: path
          required: true
          description: The session Id.
          format: guid
          x-nullable: false
        - type: string
          name: sessionScheduleId
          in: path
          required: true
          description: The session schedule Id.
          format: guid
          x-nullable: false
        - name: requestBody
          in: body
          description: |-
            The request body including the session enrollment identifier and
                        whether or not the learner was present.
          schema:
            $ref: '#/definitions/CreateAttendanceRequest'
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '201':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/AttendanceStatusResource'
        '400':
          x-nullable: false
          description: The required body paramaters were not included.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '401':
          x-nullable: false
          description: >-
            The user does not have the required permissions to create an
            attendance record.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '404':
          x-nullable: false
          description: The session or session schedule could not be found.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
    get:
      tags:
        - Attendances
      summary: List attendance records.
      description: >-
        List all attendance records associated with the identified session and
        session schedule.
      operationId: Attendances_GetAttendances
      parameters:
        - type: string
          name: sessionId
          in: path
          required: true
          description: The session Id.
          format: guid
          x-nullable: false
        - type: string
          name: sessionScheduleId
          in: path
          required: true
          description: The session schedule Id.
          format: guid
          x-nullable: false
        - type: string
          name: _filter
          in: query
          description: >-
            One or more filter operations to be performed on the collection.

            The referenced fields must allow filtering. See the respective
            report's schema for which fields can be filtered. 
                        
            Supports most of the [OData filter
            syntax](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part2-url-conventions/odata-v4.01-cs01-part2-url-conventions.html#sec_SystemQueryOptionfilter).
                        
            Supported operations:
                * eq,
                * ne,
                * gt,
                * ge,
                * lt,
                * le,
                * and,
                * or,
                * not,
                * ()

            Supported functions:
                * substringof('value',fieldName),
                * endswith(fieldName,'value'),
                * startswith(fieldName,'value'),
                * tolower(fieldName),
                * toupper(fieldName)
                        
            Examples:

            * _filter=`firstname eq 'Jeffrey'`

            * _filter=`id eq guid'a14c149a-2ce0-41d4-b532-02189ad3cb22'`

            * _filter=`startsWith(lastname,'leb') or dateAdded ge
            datetime'1998-03-06T20:38:07Z'`
          x-nullable: true
        - type: string
          name: _sort
          in: query
          description: >-
            Optional list of comma-separated fields to sort the collection by.


            The referenced fields must allow sorting. See the respective
            report's schema for which fields can be sorted. 

            If not specified, all report fields are returned.


            To sort in a descending manner, prefix the field name with `-`. For
            example, 

            `_sort=name,-date`, sorts the collection of items by `name`
            (ascending) 

            and then by `date` (descending).
          x-nullable: true
        - type: string
          name: _limit
          in: query
          description: >-
            The maximum number of items to return in the current page of the
            collection.
          x-nullable: true
        - type: string
          name: _offset
          in: query
          description: The number of pages to offset into the collection.
          x-nullable: true
        - type: string
          name: x-api-key
          in: header
        - type: string
          name: x-api-version
          in: header
          description: '2'
      responses:
        '200':
          x-nullable: false
          description: ''
          schema:
            $ref: '#/definitions/AttendancesResource'
        '404':
          x-nullable: false
          description: >-
            The session or session schedule does not exist or are not associated
            with each other.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
        '422':
          x-nullable: false
          description: A validation error occured with the provided parameters.
          schema:
            $ref: '#/definitions/GenericErrorResponse'
      security:
        - api_key: []
definitions:
  AttendanceResource:
    type: object
    description: >-
      Represents information about an attendance for an Integration API
      endpoint.
    properties:
      id:
        type: string
        description: |-
          `Filterable` 

          The attendance Id.
        format: guid
      sessionEnrollmentId:
        type: string
        description: |-
          `Filterable` 

          The session enrollment Id.
        format: guid
      isPresent:
        type: boolean
        description: |-
          `Sortable` `Filterable` 

          true if the user has been marked as present.
      dateEdited:
        type: string
        description: |-
          `Sortable` `Filterable` 

          Date and time that the enrollment has last been modified. 
        format: date-time
      userId:
        type: string
        description: |-
          `Filterable` 

          The User Id.
        format: guid
  Link:
    type: object
    properties:
      Rel:
        $ref: '#/definitions/Relation'
      Items:
        type: array
        items:
          $ref: '#/definitions/LinkItem'
  Relation:
    type: object
    properties:
      Name:
        type: string
  LinkItem:
    type: object
    properties:
      Href:
        type: string
      Name:
        type: string
      Templated:
        type: boolean
      Type:
        type: string
      Deprecation:
        type: string
      Profile:
        type: string
      Title:
        type: string
      Hreflang:
        type: string
  IEmbeddedResource:
    type: object
    x-abstract: true
    properties:
      Name:
        type: string
      Resources:
        type: array
        items:
          $ref: '#/definitions/IResource'
  IResource:
    type: object
    x-abstract: true
    properties:
      Links:
        type: array
        items:
          $ref: '#/definitions/Link'
      EmbeddedResources:
        type: array
        items:
          $ref: '#/definitions/IEmbeddedResource'
  GenericErrorResponse:
    type: object
    description: |-
      This class is NOT to be used as an actual response. This is to be used as
      the return type for non-200 responses in `SwaggerResponse` attributes.
    properties:
      validations:
        type: array
        description: The validations (if any) which caused the error.
        items:
          type: string
      code:
        description: The status code returned.
        allOf:
          - $ref: '#/definitions/HttpStatusCode'
      message:
        type: string
        description: The error message.
      term:
        type: string
        description: The general error term.
      _meta:
        type: object
        description: 'A list of meta data (if any). '
        additionalProperties:
          type: string
  HttpStatusCode:
    type: integer
    description: ''
    x-enumNames:
      - Continue
      - SwitchingProtocols
      - OK
      - Created
      - Accepted
      - NonAuthoritativeInformation
      - NoContent
      - ResetContent
      - PartialContent
      - MultipleChoices
      - Ambiguous
      - MovedPermanently
      - Moved
      - Found
      - Redirect
      - SeeOther
      - RedirectMethod
      - NotModified
      - UseProxy
      - Unused
      - TemporaryRedirect
      - RedirectKeepVerb
      - BadRequest
      - Unauthorized
      - PaymentRequired
      - Forbidden
      - NotFound
      - MethodNotAllowed
      - NotAcceptable
      - ProxyAuthenticationRequired
      - RequestTimeout
      - Conflict
      - Gone
      - LengthRequired
      - PreconditionFailed
      - RequestEntityTooLarge
      - RequestUriTooLong
      - UnsupportedMediaType
      - RequestedRangeNotSatisfiable
      - ExpectationFailed
      - UpgradeRequired
      - InternalServerError
      - NotImplemented
      - BadGateway
      - ServiceUnavailable
      - GatewayTimeout
      - HttpVersionNotSupported
  AttendanceStatusResource:
    type: object
    description: >-
      Represents information about an attendance status for an Integration API
      endpoint.
    properties:
      attendanceId:
        type: string
        description: The attendance Id.
        format: guid
      isPresent:
        type: boolean
        description: true if the user has been marked as present.
  UpdateAttendanceRequest:
    type: object
    description: Request model for updating an attendance record for a session enrollment.
    required:
      - isPresent
    properties:
      isPresent:
        type: boolean
        description: true if the user has been marked as present.
  CreateAttendanceRequest:
    type: object
    description: Request model for creating an attendance record for a session enrollment.
    required:
      - sessionEnrollmentId
      - isPresent
    properties:
      id:
        type: string
        description: >-
          The optional unique identifier of the attendance record. If not
          provided, one will be created.
        format: guid
      sessionEnrollmentId:
        type: string
        description: >-
          The unique identifier of the session enrollment the attendance belongs
          to.
        format: guid
        minLength: 1
      isPresent:
        type: boolean
        description: true if the user has been marked as present.
  AttendancesResource:
    type: object
    description: A resource representing a paginated list of AttendanceResource
    properties:
      totalItems:
        type: integer
        description: The total number of items in the unbounded collection
        format: int32
      returnedItems:
        type: integer
        description: The number of items in the bound collection being returned
        format: int32
      limit:
        type: integer
        description: The current page size for the collection
        format: int32
      offset:
        type: integer
        description: The current offset for the collection
        format: int32
      attendances:
        type: array
        description: A collection of AttendanceResource.
        items:
          $ref: '#/definitions/AttendanceResource'
securityDefinitions:
  api_key:
    type: apiKey
    name: x-api-key
    in: header
tags:
  - name: Attendances
x-servers:
  - url: https://rest.myabsorb.com
    description: US
  - url: https://rest.myabsorb.ca
    description: CA
  - url: https://rest.myabsorb.eu
    description: EU
  - url: https://rest.myabsorb.com.au
    description: AU
