Options
All
  • Public
  • Public/Protected
  • All
Menu

Class representing the Interfolio Unit

example
let units = await api.Tenure.Units.getUnits();

Hierarchy

  • UnitApi

Index

Constructors

Properties

Methods

Constructors

constructor

  • Constructor for the object

    Parameters

    • config: ApiRequest | ApiConfig

      Configuration for API calls - of type either ApiConfig or ApiRequest

      note pass in ApiRequest to keep all errors in one object instance

    • module: "tenure" | "search" = 'search'

    Returns UnitApi

Properties

Readonly apiRequest

apiRequest: ApiRequest

API request object for making the actual http requests

Readonly module

module: "tenure" | "search"

Methods

create

  • create(__namedParameters: { parentUnitId: number; unitName: string }): Promise<Unit>
  • Create a new Interfolio Unit

    example
    let newUnit = await api.Core.Units.create({parentUnitId: 9999, unitName: "New Unit Name"});
    

    Parameters

    • __namedParameters: { parentUnitId: number; unitName: string }
      • parentUnitId: number

        ID of the parent in which to create the units

      • unitName: string

        Name of the units

    Returns Promise<Unit>

delete

  • delete(unitId: number): Promise<boolean>
  • Delete a units

    example
    await api.Core.Units.delete(9999);
    

    Parameters

    • unitId: number

      The id of the units to delete

    Returns Promise<boolean>

findUnit

  • findUnit(__namedParameters: { parentUnitId?: number; unitName: string }): Promise<Unit>
  • Find a units with the matching name (and parent units if specified).

    example
    let units = await api.Core.Units.findUnit({unitName: "Biology"});
    

    Parameters

    • __namedParameters: { parentUnitId?: number; unitName: string }
      • Optional parentUnitId?: number

        The id of the parent units to search in

      • unitName: string

        The name of the units to find

    Returns Promise<Unit>

getUnits

  • getUnits(): Promise<Unit[]>
  • Get the units which the user has access to. Based upon administrative access

    example
    let units = await api.Core.Units.getUnits();
    

    Returns Promise<Unit[]>

Legend

  • Class
  • Constructor
  • Property
  • Method
  • Variable
  • Function
  • Type alias

Generated using TypeDoc