Skip to content

Commit dc38567

Browse files
authored
Merge pull request watson-developer-cloud#833 from watson-developer-cloud/regenerate-sdk-release-2-2019
Regenerate sdk release 2 2019
2 parents 9ce784d + 96fc83a commit dc38567

File tree

11 files changed

+318
-129
lines changed

11 files changed

+318
-129
lines changed

assistant/v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,6 +4228,8 @@ namespace AssistantV1 {
42284228
export interface InputData {
42294229
/** The text of the user input. This string cannot contain carriage return, newline, or tab characters, and it must be no longer than 2048 characters. */
42304230
text: string;
4231+
/** InputData accepts additional properties. */
4232+
[propName: string]: any;
42314233
}
42324234

42334235
/** Intent. */
@@ -4364,8 +4366,6 @@ namespace AssistantV1 {
43644366
output: OutputData;
43654367
/** An array of objects describing any actions requested by the dialog node. */
43664368
actions?: DialogNodeAction[];
4367-
/** MessageResponse accepts additional properties. */
4368-
[propName: string]: any;
43694369
}
43704370

43714371
/** An output object that includes the response to the user, the dialog nodes that were triggered, and messages from the log. */

compare-comply/v1.ts

Lines changed: 88 additions & 75 deletions
Large diffs are not rendered by default.

discovery/v1-generated.ts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,52 @@ class DiscoveryV1 extends BaseService {
13501350
return this.createRequest(parameters, _callback);
13511351
};
13521352

1353+
/**
1354+
* Get stopword list status.
1355+
*
1356+
* Returns the current status of the stopword list for the specified collection.
1357+
*
1358+
* @param {Object} params - The parameters to send to the service.
1359+
* @param {string} params.environment_id - The ID of the environment.
1360+
* @param {string} params.collection_id - The ID of the collection.
1361+
* @param {Object} [params.headers] - Custom request headers
1362+
* @param {Function} [callback] - The callback that handles the response.
1363+
* @returns {NodeJS.ReadableStream|void}
1364+
*/
1365+
public getStopwordListStatus(params: DiscoveryV1.GetStopwordListStatusParams, callback?: DiscoveryV1.Callback<DiscoveryV1.TokenDictStatusResponse>): NodeJS.ReadableStream | void {
1366+
const _params = extend({}, params);
1367+
const _callback = (callback) ? callback : () => { /* noop */ };
1368+
const requiredParams = ['environment_id', 'collection_id'];
1369+
1370+
const missingParams = getMissingParams(_params, requiredParams);
1371+
if (missingParams) {
1372+
return _callback(missingParams);
1373+
}
1374+
1375+
const path = {
1376+
'environment_id': _params.environment_id,
1377+
'collection_id': _params.collection_id
1378+
};
1379+
1380+
const defaultHeaders = getDefaultHeaders('discovery', 'v1', 'getStopwordListStatus');
1381+
1382+
const parameters = {
1383+
options: {
1384+
url: '/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords',
1385+
method: 'GET',
1386+
path,
1387+
},
1388+
defaultOptions: extend(true, {}, this._options, {
1389+
headers: extend(true, defaultHeaders, {
1390+
'Accept': 'application/json',
1391+
'Content-Type': 'application/json',
1392+
}, _params.headers),
1393+
}),
1394+
};
1395+
1396+
return this.createRequest(parameters, _callback);
1397+
};
1398+
13531399
/**
13541400
* Get tokenization dictionary status.
13551401
*
@@ -4047,6 +4093,15 @@ namespace DiscoveryV1 {
40474093
headers?: Object;
40484094
}
40494095

4096+
/** Parameters for the `getStopwordListStatus` operation. */
4097+
export interface GetStopwordListStatusParams {
4098+
/** The ID of the environment. */
4099+
environment_id: string;
4100+
/** The ID of the collection. */
4101+
collection_id: string;
4102+
headers?: Object;
4103+
}
4104+
40504105
/** Parameters for the `getTokenizationDictionaryStatus` operation. */
40514106
export interface GetTokenizationDictionaryStatusParams {
40524107
/** The ID of the environment. */
@@ -4935,7 +4990,7 @@ namespace DiscoveryV1 {
49354990
export interface DocumentAccepted {
49364991
/** The unique identifier of the ingested document. */
49374992
document_id?: string;
4938-
/** Status of the document in the ingestion process. */
4993+
/** Status of the document in the ingestion process. A status of `processing` is returned for documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is returned for all others. */
49394994
status?: string;
49404995
/** Array of notices produced by the document-ingestion process. */
49414996
notices?: Notice[];
@@ -4949,6 +5004,8 @@ namespace DiscoveryV1 {
49495004
processing?: number;
49505005
/** The number of documents in the collection that failed to be ingested. */
49515006
failed?: number;
5007+
/** The number of documents that have been uploaded to the collection, but have not yet started processing. */
5008+
pending?: number;
49525009
}
49535010

49545011
/** DocumentSnapshot. */

lib/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function getDefaultHeaders(serviceName: string, serviceVersion: string, o
1414

1515
const headers = {
1616
'User-Agent': `${sdkName}-${sdkVersion} ${osName} ${osVersion} ${nodeVersion}`,
17-
'X-IBMCloud-SDK-Analytics': `service_name=${serviceName};service_version=${serviceVersion};operation_id=${operationId},async=true`,
17+
'X-IBMCloud-SDK-Analytics': `service_name=${serviceName};service_version=${serviceVersion};operation_id=${operationId};async=true`,
1818
}
1919

2020
return headers;

speech-to-text/v1-generated.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { getMissingParams } from '../lib/helper';
2222
import { FileObject } from '../lib/helper';
2323

2424
/**
25-
* The IBM&reg; Speech to Text service provides APIs that use IBM's speech-recognition capabilities to produce transcripts of spoken audio. The service can transcribe speech from various languages and audio formats. It addition to basic transcription, the service can produce detailed information about many different aspects of the audio. For most languages, the service supports two sampling rates, broadband and narrowband. It returns all JSON response content in the UTF-8 character set. For speech recognition, the service supports synchronous and asynchronous HTTP Representational State Transfer (REST) interfaces. It also supports a WebSocket interface that provides a full-duplex, low-latency communication channel: Clients send requests and audio to the service and receive results over a single connection asynchronously. The service also offers two customization interfaces. Use language model customization to expand the vocabulary of a base model with domain-specific terminology. Use acoustic model customization to adapt a base model for the acoustic characteristics of your audio. For language model customization, the service also supports grammars. A grammar is a formal language specification that lets you restrict the phrases that the service can recognize. Language model customization is generally available for production use with most supported languages. Acoustic model customization is beta functionality that is available for all supported languages.
25+
* The IBM&reg; Speech to Text service provides APIs that use IBM's speech-recognition capabilities to produce transcripts of spoken audio. The service can transcribe speech from various languages and audio formats. In addition to basic transcription, the service can produce detailed information about many different aspects of the audio. For most languages, the service supports two sampling rates, broadband and narrowband. It returns all JSON response content in the UTF-8 character set. For speech recognition, the service supports synchronous and asynchronous HTTP Representational State Transfer (REST) interfaces. It also supports a WebSocket interface that provides a full-duplex, low-latency communication channel: Clients send requests and audio to the service and receive results over a single connection asynchronously. The service also offers two customization interfaces. Use language model customization to expand the vocabulary of a base model with domain-specific terminology. Use acoustic model customization to adapt a base model for the acoustic characteristics of your audio. For language model customization, the service also supports grammars. A grammar is a formal language specification that lets you restrict the phrases that the service can recognize. Language model customization is generally available for production use with most supported languages. Acoustic model customization is beta functionality that is available for all supported languages.
2626
*/
2727

2828
class SpeechToTextV1 extends BaseService {
@@ -2565,16 +2565,18 @@ class SpeechToTextV1 extends BaseService {
25652565
* existing request completes.
25662566
*
25672567
* You can use the optional `custom_language_model_id` parameter to specify the GUID of a separately created custom
2568-
* language model that is to be used during training. Specify a custom language model if you have verbatim
2568+
* language model that is to be used during training. Train with a custom language model if you have verbatim
25692569
* transcriptions of the audio files that you have added to the custom model or you have either corpora (text files)
2570-
* or a list of words that are relevant to the contents of the audio files. For more information, see the **Create a
2571-
* custom language model** method.
2570+
* or a list of words that are relevant to the contents of the audio files. Both of the custom models must be based on
2571+
* the same version of the same base model for training to succeed.
25722572
*
25732573
* Training can fail to start for the following reasons:
25742574
* * The service is currently handling another request for the custom model, such as another training request or a
25752575
* request to add audio resources to the model.
25762576
* * The custom model contains less than 10 minutes or more than 100 hours of audio data.
25772577
* * One or more of the custom model's audio resources is invalid.
2578+
* * You passed an incompatible custom language model with the `custom_language_model_id` query parameter. Both custom
2579+
* models must be based on the same version of the same base model.
25782580
*
25792581
* **See also:** [Train the custom acoustic
25802582
* model](https://cloud.ibm.com/docs/services/speech-to-text/acoustic-create.html#trainModel).
@@ -2586,7 +2588,8 @@ class SpeechToTextV1 extends BaseService {
25862588
* @param {string} [params.custom_language_model_id] - The customization ID (GUID) of a custom language model that is
25872589
* to be used during training of the custom acoustic model. Specify a custom language model that has been trained with
25882590
* verbatim transcriptions of the audio resources or that contains words that are relevant to the contents of the
2589-
* audio resources.
2591+
* audio resources. The custom language model must be based on the same version of the same base model as the custom
2592+
* acoustic model. The credentials specified with the request must own both custom models.
25902593
* @param {Object} [params.headers] - Custom request headers
25912594
* @param {Function} [callback] - The callback that handles the response.
25922595
* @returns {NodeJS.ReadableStream|void}
@@ -2659,7 +2662,12 @@ class SpeechToTextV1 extends BaseService {
26592662
* custom model.
26602663
* @param {string} [params.custom_language_model_id] - If the custom acoustic model was trained with a custom language
26612664
* model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before
2662-
* the custom acoustic model can be upgraded.
2665+
* the custom acoustic model can be upgraded. The credentials specified with the request must own both custom models.
2666+
* @param {boolean} [params.force] - If `true`, forces the upgrade of a custom acoustic model for which no input data
2667+
* has been modified since it was last trained. Use this parameter only to force the upgrade of a custom acoustic
2668+
* model that is trained with a custom language model, and only if you receive a 400 response code and the message `No
2669+
* input data modified since last training`. See [Upgrading a custom acoustic
2670+
* model](https://cloud.ibm.com/docs/services/speech-to-text/custom-upgrade.html#upgradeAcoustic).
26632671
* @param {Object} [params.headers] - Custom request headers
26642672
* @param {Function} [callback] - The callback that handles the response.
26652673
* @returns {NodeJS.ReadableStream|void}
@@ -2675,7 +2683,8 @@ class SpeechToTextV1 extends BaseService {
26752683
}
26762684

26772685
const query = {
2678-
'custom_language_model_id': _params.custom_language_model_id
2686+
'custom_language_model_id': _params.custom_language_model_id,
2687+
'force': _params.force
26792688
};
26802689

26812690
const path = {
@@ -3710,7 +3719,7 @@ namespace SpeechToTextV1 {
37103719
export interface TrainAcousticModelParams {
37113720
/** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model. */
37123721
customization_id: string;
3713-
/** The customization ID (GUID) of a custom language model that is to be used during training of the custom acoustic model. Specify a custom language model that has been trained with verbatim transcriptions of the audio resources or that contains words that are relevant to the contents of the audio resources. */
3722+
/** The customization ID (GUID) of a custom language model that is to be used during training of the custom acoustic model. Specify a custom language model that has been trained with verbatim transcriptions of the audio resources or that contains words that are relevant to the contents of the audio resources. The custom language model must be based on the same version of the same base model as the custom acoustic model. The credentials specified with the request must own both custom models. */
37143723
custom_language_model_id?: string;
37153724
headers?: Object;
37163725
}
@@ -3719,8 +3728,10 @@ namespace SpeechToTextV1 {
37193728
export interface UpgradeAcousticModelParams {
37203729
/** The customization ID (GUID) of the custom acoustic model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model. */
37213730
customization_id: string;
3722-
/** If the custom acoustic model was trained with a custom language model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before the custom acoustic model can be upgraded. */
3731+
/** If the custom acoustic model was trained with a custom language model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before the custom acoustic model can be upgraded. The credentials specified with the request must own both custom models. */
37233732
custom_language_model_id?: string;
3733+
/** If `true`, forces the upgrade of a custom acoustic model for which no input data has been modified since it was last trained. Use this parameter only to force the upgrade of a custom acoustic model that is trained with a custom language model, and only if you receive a 400 response code and the message `No input data modified since last training`. See [Upgrading a custom acoustic model](https://cloud.ibm.com/docs/services/speech-to-text/custom-upgrade.html#upgradeAcoustic). */
3734+
force?: boolean;
37243735
headers?: Object;
37253736
}
37263737

test/integration/discovery.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,18 @@ describe('discovery_integration', function() {
516516
done();
517517
});
518518
});
519+
it('should getStopwordListStatus', function(done) {
520+
const params = {
521+
environment_id,
522+
collection_id,
523+
};
524+
discovery.getStopwordListStatus(params, (err, res) => {
525+
expect(err).toBeNull();
526+
expect(res.type).toBeDefined();
527+
expect(res.status).toBeDefined();
528+
done();
529+
});
530+
});
519531
it('should deleteStopwordList', function(done) {
520532
const params = {
521533
environment_id,

test/unit/assistant.v1.test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,12 @@ describe('getWorkspace', () => {
282282
const workspace_id = 'fake_workspace_id';
283283
const _export = 'fake_export';
284284
const include_audit = 'fake_include_audit';
285+
const sort = 'fake_sort';
285286
const params = {
286287
workspace_id,
287288
export: _export,
288289
include_audit,
290+
sort,
289291
};
290292

291293
// invoke method
@@ -303,6 +305,7 @@ describe('getWorkspace', () => {
303305
checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType);
304306
expect(options.qs['export']).toEqual(_export);
305307
expect(options.qs['include_audit']).toEqual(include_audit);
308+
expect(options.qs['sort']).toEqual(sort);
306309
expect(options.path['workspace_id']).toEqual(workspace_id);
307310
});
308311

test/unit/discovery.v1.test.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,83 @@ describe('deleteTokenizationDictionary', () => {
19031903
});
19041904
});
19051905
});
1906+
describe('getStopwordListStatus', () => {
1907+
describe('positive tests', () => {
1908+
beforeAll(() => {
1909+
missingParamsMock.mockReturnValue(missingParamsSuccess);
1910+
});
1911+
test('should pass the right params to createRequest', () => {
1912+
// parameters
1913+
const environment_id = 'fake_environment_id';
1914+
const collection_id = 'fake_collection_id';
1915+
const params = {
1916+
environment_id,
1917+
collection_id,
1918+
};
1919+
1920+
// invoke method
1921+
discovery.getStopwordListStatus(params);
1922+
1923+
// assert that create request was called
1924+
expect(createRequestMock).toHaveBeenCalledTimes(1);
1925+
1926+
const options = getOptions(createRequestMock);
1927+
1928+
checkUrlAndMethod(
1929+
options,
1930+
'/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords',
1931+
'GET'
1932+
);
1933+
checkCallback(createRequestMock);
1934+
const expectedAccept = 'application/json';
1935+
const expectedContentType = 'application/json';
1936+
checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType);
1937+
expect(options.path['environment_id']).toEqual(environment_id);
1938+
expect(options.path['collection_id']).toEqual(collection_id);
1939+
});
1940+
1941+
test('should prioritize user-given headers', () => {
1942+
// parameters
1943+
const environment_id = 'fake_environment_id';
1944+
const collection_id = 'fake_collection_id';
1945+
const accept = 'fake/header';
1946+
const contentType = 'fake/header';
1947+
const params = {
1948+
environment_id,
1949+
collection_id,
1950+
headers: {
1951+
Accept: accept,
1952+
'Content-Type': contentType,
1953+
},
1954+
};
1955+
1956+
discovery.getStopwordListStatus(params);
1957+
checkMediaHeaders(createRequestMock, accept, contentType);
1958+
});
1959+
});
1960+
describe('negative tests', () => {
1961+
beforeAll(() => {
1962+
missingParamsMock.mockReturnValue(missingParamsError);
1963+
});
1964+
1965+
test('should convert a `null` value for `params` to an empty object', done => {
1966+
discovery.getStopwordListStatus(null, () => {
1967+
checkForEmptyObject(missingParamsMock);
1968+
done();
1969+
});
1970+
});
1971+
1972+
test('should enforce required parameters', done => {
1973+
// required parameters for this method
1974+
const requiredParams = ['environment_id', 'collection_id'];
1975+
1976+
discovery.getStopwordListStatus({}, err => {
1977+
checkRequiredParamsHandling(requiredParams, err, missingParamsMock, createRequestMock);
1978+
done();
1979+
});
1980+
});
1981+
});
1982+
});
19061983
describe('getTokenizationDictionaryStatus', () => {
19071984
describe('positive tests', () => {
19081985
beforeAll(() => {

test/unit/requestWrapper.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('requestwrapper', () => {
4242
`watson-apis-node-sdk-${pjson.version} ${os.platform()} ${os.release()} ${process.version}`
4343
);
4444
expect(req.headers['X-IBMCloud-SDK-Analytics']).toBe(
45-
'service_name=conversation;service_version=v1;operation_id=listIntents,async=true'
45+
'service_name=conversation;service_version=v1;operation_id=listIntents;async=true'
4646
);
4747
});
4848
});

0 commit comments

Comments
 (0)