Home Manual Reference Source
private class | source

PronunciationChallengeController

Controller class for the PronunciationChallenge model.

Constructor Summary

Public Constructor
public

constructor(connection: Connection)

Member Summary

Private Members
private

Object to use for making a connection to the REST API and Websocket server.

Method Summary

Public Methods
public

Create a pronunciation challenge.

public

Delete a pronunciation challenge from the current active Organisation derived from the OAuth2 scope.

public

Get a pronunciation challenge from the current active Organisation derived from the OAuth2 scope.

public

Get and return all pronunciation challenges in the current active Organisation derived from the OAuth2 scope.

Public Constructors

public constructor(connection: Connection) source

Params:

NameTypeAttributeDescription
connection Connection

Object to use for making a connection to the REST API and Websocket server.

Private Members

private _connection: Connection source

Object to use for making a connection to the REST API and Websocket server.

Public Methods

public createPronunciationChallenge(challenge: PronunciationChallenge, audioBlob: Blob): Promise<PronunciationChallenge> source

Create a pronunciation challenge. The created challenge will be part of the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
challenge PronunciationChallenge

Object to create.

audioBlob Blob

Audio fragment to link to the challenge.

Return:

Promise<PronunciationChallenge>

Promise containing the newly created PronunciationChallenge.

Throw:

Promise.<Error>

challenge parameter of type "PronunciationChallenge" is required.

Promise.<Error>

audioBlob parameter of type "Blob" is required.

Promise.<Error>

If the server returned an error.

public deletePronunciationChallenge(challengeId: string): Promise<PronunciationChallenge> source

Delete a pronunciation challenge from the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
challengeId string

A pronunciation challenge identifier.

Return:

Promise<PronunciationChallenge>

Promise containing the given challenge ID.

Throw:

Promise.<Error>

PronunciationChallenge#id field is required.

Promise.<Error>

If the server returned an error.

public getPronunciationChallenge(challengeId: string): Promise<PronunciationChallenge> source

Get a pronunciation challenge from the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
challengeId string

Specify a pronunciation challenge identifier.

Return:

Promise<PronunciationChallenge>

Promise containing a PronunciationChallenge.

Throw:

Promise.<Error>

PronunciationChallenge#id field is required.

Promise.<Error>

If no result could not be found.

public getPronunciationChallenges(): Promise<PronunciationChallenge[]> source

Get and return all pronunciation challenges in the current active Organisation derived from the OAuth2 scope.

Return:

Promise<PronunciationChallenge[]>

Promise containing a list of PronunciationChallenges.

Throw:

Promise.<Error>

If no result could not be found.