import PronunciationChallengeController from 'itslanguage/administrative-sdk/pronunciation-challenge/pronunciation-challenge-controller.js'
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 |
createPronunciationChallenge(challenge: PronunciationChallenge, audioBlob: Blob): Promise<PronunciationChallenge> Create a pronunciation challenge. |
|
public |
deletePronunciationChallenge(challengeId: string): Promise<PronunciationChallenge> Delete a pronunciation challenge from the current active Organisation derived from the OAuth2 scope. |
|
public |
getPronunciationChallenge(challengeId: string): Promise<PronunciationChallenge> 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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
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:
Name | Type | Attribute | Description |
challengeId | string | A pronunciation challenge identifier. |
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:
Name | Type | Attribute | Description |
challengeId | string | Specify a pronunciation challenge identifier. |
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.
Throw:
Promise.<Error> |
If no result could not be found. |