Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AuthorizationV1

interfaces

Hierarchy

  • BaseService
    • AuthorizationV1

Index

Constructors

constructor

  • Authorization Service

    Generates temporary auth tokens for use in untrusted environments. Tokens expire after one hour.

    Parameters

    Name Type Attribute Description
    options UserOptions

    Returns AuthorizationV1

Properties

name

name: string

serviceVersion

serviceVersion: string

Optional targetUrl

targetUrl: string

Static DEFAULT_SERVICE_NAME

DEFAULT_SERVICE_NAME: string

Static DEFAULT_SERVICE_URL

DEFAULT_SERVICE_URL: string

Static URL

URL: string = "https://api.us-south.speech-to-text.watson.cloud.ibm.com/authorization/api"

Methods

disableRetries

  • disableRetries(): void
  • Disables retries.

    Returns void

enableRetries

  • enableRetries(retryOptions?: RetryOptions): void
  • Enable retries for unfulfilled requests.

    Parameters

    Name Type Attribute Description
    retryOptions RetryOptions Optional

    configuration for retries

    Returns void

getAuthenticator

  • getAuthenticator(): any
  • Get the instance of the authenticator set on the service.

    Returns any

getHttpClient

  • getHttpClient(): AxiosInstance
  • Get the Axios instance set on the service. All requests will be made using this instance.

    Returns AxiosInstance

getToken

  • If using an RC service, get an IAM access token. If using a CF service, get a percent-encoded authorization token based on resource query string param

    Parameters

    Name Type Attribute Description
    params GetTokenParams | GetTokenCallback

    callback GetTokenCallback Optional

    called with a %-encoded token if CF

    Returns Promise<any>

setEnableGzipCompression

  • setEnableGzipCompression(setting: boolean): void
  • Turn request body compression on or off.

    Parameters

    Name Type Attribute Description
    setting boolean

    Will turn it on if 'true', off if 'false'.

    Returns void

setServiceUrl

  • setServiceUrl(url: string): void
  • Set the service URL to send requests to.

    Parameters

    Name Type Attribute Description
    url string

    The base URL for the service.

    Returns void

Generated using TypeDoc