Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Institution

A data container for data related to an insitution with static methods for interfacing with hackerapi.com

class
extends

{ HackerAPI.Base }

Hierarchy

Index

Constructors

constructor

  • new Institution(__namedParameters?: { address: undefined | Address; country: undefined | string; countryCode: undefined | string; country_code: undefined | string; id: undefined | number; institutionType: undefined | string; institution_type: undefined | string; isCustom: undefined | false | true; isEnabled: undefined | false | true; is_custom: undefined | false | true; is_enabled: undefined | false | true; name: undefined | string; website: undefined | string }): Institution
  • Parameters

    • Default value __namedParameters: { address: undefined | Address; country: undefined | string; countryCode: undefined | string; country_code: undefined | string; id: undefined | number; institutionType: undefined | string; institution_type: undefined | string; isCustom: undefined | false | true; isEnabled: undefined | false | true; is_custom: undefined | false | true; is_enabled: undefined | false | true; name: undefined | string; website: undefined | string } = {}
      • address: undefined | Address
      • country: undefined | string
      • countryCode: undefined | string
      • country_code: undefined | string
      • id: undefined | number
      • institutionType: undefined | string
      • institution_type: undefined | string
      • isCustom: undefined | false | true
      • isEnabled: undefined | false | true
      • is_custom: undefined | false | true
      • is_enabled: undefined | false | true
      • name: undefined | string
      • website: undefined | string

    Returns Institution

Properties

Optional address

address: Address | undefined

Optional country

country: undefined | string

Optional countryCode

countryCode: undefined | string

Optional id

id: undefined | number

Optional institutionType

institutionType: undefined | string

Optional isCustom

isCustom: undefined | false | true

Optional isEnabled

isEnabled: undefined | false | true

Optional name

name: undefined | string

specialHandlers

specialHandlers: {}

Type declaration

  • [key: string]: (...args: unknown[]) => [string, undefined | string]
      • (...args: unknown[]): [string, undefined | string]
      • Parameters

        • Rest ...args: unknown[]

        Returns [string, undefined | string]

Optional website

website: undefined | string

Methods

toHackerAPIFormat

  • toHackerAPIFormat(method?: undefined | string): {}

Static create

Static dateHandler

  • dateHandler(key: string, date: string | Date): string[]
  • Converts a Javascript date (where only day, month and year are relevant) to a format understood by hackerapi

    Parameters

    • key: string
    • date: string | Date

      Doesn't do anything if string

    Returns string[]

    key: [0], value: [1]

Static dateTimeHandler

  • dateTimeHandler(key: string, datetime: string | Date): string[]
  • Converts Javascript date to a format understood by hackerapi

    Parameters

    • key: string
    • datetime: string | Date

    Returns string[]

    key: [0], value: [1]

Static delete

  • delete(__namedParameters: { id: number }, token?: undefined | string): Promise<any>
  • Deletes an institution on hackerapi

    Parameters

    • __namedParameters: { id: number }
      • id: number
    • Optional token: undefined | string

    Returns Promise<any>

Static doNotSendHandler

  • doNotSendHandler(key: string, _: any): (undefined | string)[]
  • Does not send the field to hackerapi

    Parameters

    • key: string
    • _: any

    Returns (undefined | string)[]

    key: [0], value: [1]

Static fetch

  • fetch(__namedParameters: { id: number }): Promise<{}>
  • Fetches an institution from hackerapi

    Parameters

    • __namedParameters: { id: number }
      • id: number

    Returns Promise<{}>

Static renameHandler

  • renameHandler(renamedKey: string): (Anonymous function)
  • HOC for renaming a field before sending it to hackerapi

    Parameters

    • renamedKey: string

      The string to rename the key to

    Returns (Anonymous function)

    key: [0], value: [1]

Generated using TypeDoc