Skip to content

Commit e662162

Browse files
authored
Merge pull request #778 from watson-developer-cloud/regenerate-sdk-release-7
Regenerate sdk release 7
2 parents aa78432 + 0d1774c commit e662162

File tree

11 files changed

+334
-183
lines changed

11 files changed

+334
-183
lines changed

assistant/v1.ts

Lines changed: 60 additions & 40 deletions
Large diffs are not rendered by default.

conversation/v1-generated.ts

Lines changed: 58 additions & 40 deletions
Large diffs are not rendered by default.

discovery/v1-generated.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,11 @@ class DiscoveryV1 extends BaseService {
601601
if (missingParams) {
602602
return _callback(missingParams);
603603
}
604-
605604
if (_params.file && !_params.filename) {
606605
console.warn(
607606
'WARNING: `filename` should be provided if `file` is not null. This will be REQUIRED in the next major release.'
608607
);
609608
}
610-
611609
const formData = {
612610
'configuration': _params.configuration,
613611
'file': {
@@ -1101,13 +1099,11 @@ class DiscoveryV1 extends BaseService {
11011099
if (missingParams) {
11021100
return _callback(missingParams);
11031101
}
1104-
11051102
if (_params.file && !_params.filename) {
11061103
console.warn(
11071104
'WARNING: `filename` should be provided if `file` is not null. This will be REQUIRED in the next major release.'
11081105
);
11091106
}
1110-
11111107
const formData = {
11121108
'file': {
11131109
data: _params.file,
@@ -1256,13 +1252,11 @@ class DiscoveryV1 extends BaseService {
12561252
if (missingParams) {
12571253
return _callback(missingParams);
12581254
}
1259-
12601255
if (_params.file && !_params.filename) {
12611256
console.warn(
12621257
'WARNING: `filename` should be provided if `file` is not null. This will be REQUIRED in the next major release.'
12631258
);
12641259
}
1265-
12661260
const formData = {
12671261
'file': {
12681262
data: _params.file,
@@ -4325,6 +4319,8 @@ namespace DiscoveryV1 {
43254319

43264320
/** An object that indicates the Categories enrichment will be applied to the specified field. */
43274321
export interface NluEnrichmentCategories {
4322+
/** NluEnrichmentCategories accepts additional properties. */
4323+
[propName: string]: any;
43284324
}
43294325

43304326
/** An object specifying the emotion detection enrichment and related parameters. */
@@ -4548,6 +4544,8 @@ namespace DiscoveryV1 {
45484544
sha1?: string;
45494545
/** Array of notices for the document. */
45504546
notices?: Notice[];
4547+
/** QueryNoticesResult accepts additional properties. */
4548+
[propName: string]: any;
45514549
}
45524550

45534551
/** QueryPassages. */
@@ -4631,6 +4629,8 @@ namespace DiscoveryV1 {
46314629
collection_id?: string;
46324630
/** Metadata of the query result. */
46334631
result_metadata?: QueryResultResultMetadata;
4632+
/** QueryResult accepts additional properties. */
4633+
[propName: string]: any;
46344634
}
46354635

46364636
/** Metadata of a query result. */

language-translator/v2-generated.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ class LanguageTranslatorV2 extends BaseService {
199199
* are treated as a parallel corpus instead of a glossary.
200200
* @param {NodeJS.ReadableStream|FileObject|Buffer} [params.monolingual_corpus] - A UTF-8 encoded plain text file that
201201
* is used to customize the target language model.
202+
* @param {string} [params.forced_glossary_filename] - The filename for forced_glossary.
203+
* @param {string} [params.parallel_corpus_filename] - The filename for parallel_corpus.
204+
* @param {string} [params.monolingual_corpus_filename] - The filename for monolingual_corpus.
202205
* @param {Object} [params.headers] - Custom request headers
203206
* @param {Function} [callback] - The callback that handles the response.
204207
* @returns {NodeJS.ReadableStream|void}
@@ -214,14 +217,17 @@ class LanguageTranslatorV2 extends BaseService {
214217
const formData = {
215218
'forced_glossary': {
216219
data: _params.forced_glossary,
220+
filename: _params.forced_glossary_filename,
217221
contentType: 'application/octet-stream'
218222
},
219223
'parallel_corpus': {
220224
data: _params.parallel_corpus,
225+
filename: _params.parallel_corpus_filename,
221226
contentType: 'application/octet-stream'
222227
},
223228
'monolingual_corpus': {
224229
data: _params.monolingual_corpus,
230+
filename: _params.monolingual_corpus_filename,
225231
contentType: 'text/plain'
226232
}
227233
};
@@ -428,6 +434,12 @@ namespace LanguageTranslatorV2 {
428434
parallel_corpus?: NodeJS.ReadableStream|FileObject|Buffer;
429435
/** A UTF-8 encoded plain text file that is used to customize the target language model. */
430436
monolingual_corpus?: NodeJS.ReadableStream|FileObject|Buffer;
437+
/** The filename for forced_glossary. */
438+
forced_glossary_filename?: string;
439+
/** The filename for parallel_corpus. */
440+
parallel_corpus_filename?: string;
441+
/** The filename for monolingual_corpus. */
442+
monolingual_corpus_filename?: string;
431443
headers?: Object;
432444
}
433445

language-translator/v3.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ class LanguageTranslatorV3 extends BaseService {
216216
* source and target language. You can upload multiple parallel_corpus files in one request. All uploaded
217217
* parallel_corpus files combined, your parallel corpus must contain at least 5,000 parallel sentences to train
218218
* successfully.
219+
* @param {string} [params.forced_glossary_filename] - The filename for forced_glossary.
220+
* @param {string} [params.parallel_corpus_filename] - The filename for parallel_corpus.
219221
* @param {Object} [params.headers] - Custom request headers
220222
* @param {Function} [callback] - The callback that handles the response.
221223
* @returns {NodeJS.ReadableStream|void}
@@ -231,10 +233,12 @@ class LanguageTranslatorV3 extends BaseService {
231233
const formData = {
232234
'forced_glossary': {
233235
data: _params.forced_glossary,
236+
filename: _params.forced_glossary_filename,
234237
contentType: 'application/octet-stream'
235238
},
236239
'parallel_corpus': {
237240
data: _params.parallel_corpus,
241+
filename: _params.parallel_corpus_filename,
238242
contentType: 'application/octet-stream'
239243
}
240244
};
@@ -442,6 +446,10 @@ namespace LanguageTranslatorV3 {
442446
forced_glossary?: NodeJS.ReadableStream|FileObject|Buffer;
443447
/** A TMX file with parallel sentences for source and target language. You can upload multiple parallel_corpus files in one request. All uploaded parallel_corpus files combined, your parallel corpus must contain at least 5,000 parallel sentences to train successfully. */
444448
parallel_corpus?: NodeJS.ReadableStream|FileObject|Buffer;
449+
/** The filename for forced_glossary. */
450+
forced_glossary_filename?: string;
451+
/** The filename for parallel_corpus. */
452+
parallel_corpus_filename?: string;
445453
headers?: Object;
446454
}
447455

lib/base_service.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,19 @@ function hasCredentials(obj: any): boolean {
7373
}
7474

7575
function hasBasicCredentials(obj: any): boolean {
76-
return obj && obj.username && obj.password && obj.username !== 'apikey';
76+
return obj && obj.username && obj.password && !usesBasicForIam(obj);
7777
}
7878

7979
function hasIamCredentials(obj: any): boolean {
8080
return obj && (obj.iam_apikey || obj.iam_access_token);
8181
}
8282

83+
// returns true if the user provides basic auth creds with the intention
84+
// of using IAM auth
85+
function usesBasicForIam(obj: any): boolean {
86+
return obj.username === 'apikey' && !obj.password.startsWith('icp-');
87+
}
88+
8389
export class BaseService {
8490
static URL: string;
8591
name: string;
@@ -135,7 +141,7 @@ export class BaseService {
135141
iamAccessToken: _options.iam_access_token,
136142
iamUrl: _options.iam_url
137143
});
138-
} else if (_options.username === 'apikey') {
144+
} else if (usesBasicForIam(_options)) {
139145
this.tokenManager = new IamTokenManagerV1({
140146
iamApikey: _options.password,
141147
iamUrl: _options.iam_url
@@ -280,7 +286,7 @@ export class BaseService {
280286
'api_key, and iam_access_token.';
281287
throw new Error(errorMessage);
282288
}
283-
if (!hasIamCredentials(_options) && _options.username !== 'apikey') {
289+
if (!hasIamCredentials(_options) && !usesBasicForIam(_options)) {
284290
if (hasBasicCredentials(_options)) {
285291
// Calculate and add Authorization header to base options
286292
const encodedCredentials = bufferFrom(

natural-language-classifier/v1-generated.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ class NaturalLanguageClassifierV1 extends BaseService {
165165
* @param {NodeJS.ReadableStream|FileObject|Buffer} params.training_data - Training data in CSV format. Each text
166166
* value must have at least one class. The data can include up to 20,000 records. For details, see [Data
167167
* preparation](https://console.bluemix.net/docs/services/natural-language-classifier/using-your-data.html).
168+
* @param {string} [params.metadata_filename] - The filename for training_metadata.
169+
* @param {string} [params.training_data_filename] - The filename for training_data.
168170
* @param {Object} [params.headers] - Custom request headers
169171
* @param {Function} [callback] - The callback that handles the response.
170172
* @returns {NodeJS.ReadableStream|void}
@@ -180,10 +182,12 @@ class NaturalLanguageClassifierV1 extends BaseService {
180182
const formData = {
181183
'training_metadata': {
182184
data: _params.metadata,
185+
filename: _params.metadata_filename,
183186
contentType: 'application/json'
184187
},
185188
'training_data': {
186189
data: _params.training_data,
190+
filename: _params.training_data_filename,
187191
contentType: 'text/csv'
188192
}
189193
};
@@ -362,6 +366,10 @@ namespace NaturalLanguageClassifierV1 {
362366
metadata: NodeJS.ReadableStream|FileObject|Buffer;
363367
/** Training data in CSV format. Each text value must have at least one class. The data can include up to 20,000 records. For details, see [Data preparation](https://console.bluemix.net/docs/services/natural-language-classifier/using-your-data.html). */
364368
training_data: NodeJS.ReadableStream|FileObject|Buffer;
369+
/** The filename for training_metadata. */
370+
metadata_filename?: string;
371+
/** The filename for training_data. */
372+
training_data_filename?: string;
365373
headers?: Object;
366374
}
367375

natural-language-understanding/v1-generated.ts

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,21 @@ class NaturalLanguageUnderstandingV1 extends BaseService {
104104
*
105105
* @param {Object} params - The parameters to send to the service.
106106
* @param {Features} params.features - Specific features to analyze the document for.
107-
* @param {string} [params.text] - The plain text to analyze.
108-
* @param {string} [params.html] - The HTML file to analyze.
109-
* @param {string} [params.url] - The web page to analyze.
107+
* @param {string} [params.text] - The plain text to analyze. One of the `text`, `html`, or `url` parameters is
108+
* required.
109+
* @param {string} [params.html] - The HTML file to analyze. One of the `text`, `html`, or `url` parameters is
110+
* required.
111+
* @param {string} [params.url] - The web page to analyze. One of the `text`, `html`, or `url` parameters is required.
110112
* @param {boolean} [params.clean] - Remove website elements, such as links, ads, etc.
111-
* @param {string} [params.xpath] - XPath query for targeting nodes in HTML.
113+
* @param {string} [params.xpath] - An [XPath query](https://www.w3.org/TR/xpath/) to perform on `html` or `url`
114+
* input. Results of the query will be appended to the cleaned webpage text before it is analyzed. To analyze only the
115+
* results of the XPath query, set the `clean` parameter to `false`.
112116
* @param {boolean} [params.fallback_to_raw] - Whether to use raw HTML content if text cleaning fails.
113117
* @param {boolean} [params.return_analyzed_text] - Whether or not to return the analyzed text.
114-
* @param {string} [params.language] - ISO 639-1 code indicating the language to use in the analysis.
118+
* @param {string} [params.language] - ISO 639-1 code that specifies the language of your text. This overrides
119+
* automatic language detection. Language support differs depending on the features you include in your analysis. See
120+
* [Language support](https://www.bluemix.net/docs/services/natural-language-understanding/language-support.html) for
121+
* more information.
115122
* @param {number} [params.limit_text_characters] - Sets the maximum number of characters that are processed by the
116123
* service.
117124
* @param {Object} [params.headers] - Custom request headers
@@ -264,21 +271,21 @@ namespace NaturalLanguageUnderstandingV1 {
264271
export interface AnalyzeParams {
265272
/** Specific features to analyze the document for. */
266273
features: Features;
267-
/** The plain text to analyze. */
274+
/** The plain text to analyze. One of the `text`, `html`, or `url` parameters is required. */
268275
text?: string;
269-
/** The HTML file to analyze. */
276+
/** The HTML file to analyze. One of the `text`, `html`, or `url` parameters is required. */
270277
html?: string;
271-
/** The web page to analyze. */
278+
/** The web page to analyze. One of the `text`, `html`, or `url` parameters is required. */
272279
url?: string;
273280
/** Remove website elements, such as links, ads, etc. */
274281
clean?: boolean;
275-
/** XPath query for targeting nodes in HTML. */
282+
/** An [XPath query](https://www.w3.org/TR/xpath/) to perform on `html` or `url` input. Results of the query will be appended to the cleaned webpage text before it is analyzed. To analyze only the results of the XPath query, set the `clean` parameter to `false`. */
276283
xpath?: string;
277284
/** Whether to use raw HTML content if text cleaning fails. */
278285
fallback_to_raw?: boolean;
279286
/** Whether or not to return the analyzed text. */
280287
return_analyzed_text?: boolean;
281-
/** ISO 639-1 code indicating the language to use in the analysis. */
288+
/** ISO 639-1 code that specifies the language of your text. This overrides automatic language detection. Language support differs depending on the features you include in your analysis. See [Language support](https://www.bluemix.net/docs/services/natural-language-understanding/language-support.html) for more information. */
282289
language?: string;
283290
/** Sets the maximum number of characters that are processed by the service. */
284291
limit_text_characters?: number;
@@ -339,6 +346,8 @@ namespace NaturalLanguageUnderstandingV1 {
339346

340347
/** The hierarchical 5-level taxonomy the content is categorized into. */
341348
export interface CategoriesOptions {
349+
/** CategoriesOptions accepts additional properties. */
350+
[propName: string]: any;
342351
}
343352

344353
/** The hierarchical 5-level taxonomy the content is categorized into. */
@@ -397,7 +406,7 @@ namespace NaturalLanguageUnderstandingV1 {
397406

398407
/** Whether or not to return emotion analysis of the content. */
399408
export interface EmotionOptions {
400-
/** Set this to false to hide document-level emotion results. */
409+
/** Set this to `false` to hide document-level emotion results. */
401410
document?: boolean;
402411
/** Emotion results will be returned for each target string that is found in the document. */
403412
targets?: string[];
@@ -429,13 +438,13 @@ namespace NaturalLanguageUnderstandingV1 {
429438
export interface EntitiesOptions {
430439
/** Maximum number of entities to return. */
431440
limit?: number;
432-
/** Set this to true to return locations of entity mentions. */
441+
/** Set this to `true` to return locations of entity mentions. */
433442
mentions?: boolean;
434-
/** Enter a custom model ID to override the standard entity detection model. */
443+
/** Enter a [custom model](https://www.bluemix.net/docs/services/natural-language-understanding/customizing.html) ID to override the standard entity detection model. */
435444
model?: string;
436-
/** Set this to true to return sentiment information for detected entities. */
445+
/** Set this to `true` to return sentiment information for detected entities. */
437446
sentiment?: boolean;
438-
/** Set this to true to analyze emotion for detected keywords. */
447+
/** Set this to `true` to analyze emotion for detected keywords. */
439448
emotion?: boolean;
440449
}
441450

@@ -505,9 +514,9 @@ namespace NaturalLanguageUnderstandingV1 {
505514
export interface KeywordsOptions {
506515
/** Maximum number of keywords to return. */
507516
limit?: number;
508-
/** Set this to true to return sentiment information for detected keywords. */
517+
/** Set this to `true` to return sentiment information for detected keywords. */
509518
sentiment?: boolean;
510-
/** Set this to true to analyze emotion for detected keywords. */
519+
/** Set this to `true` to analyze emotion for detected keywords. */
511520
emotion?: boolean;
512521
}
513522

@@ -530,6 +539,8 @@ namespace NaturalLanguageUnderstandingV1 {
530539

531540
/** The Authors, Publication Date, and Title of the document. Supports URL and HTML input types. */
532541
export interface MetadataOptions {
542+
/** MetadataOptions accepts additional properties. */
543+
[propName: string]: any;
533544
}
534545

535546
/** The Authors, Publication Date, and Title of the document. Supports URL and HTML input types. */
@@ -577,7 +588,7 @@ namespace NaturalLanguageUnderstandingV1 {
577588

578589
/** An option specifying if the relationships found between entities in the analyzed content should be returned. */
579590
export interface RelationsOptions {
580-
/** Enter a custom model ID to override the default model. */
591+
/** Enter a [custom model](https://www.bluemix.net/docs/services/natural-language-understanding/customizing.html) ID to override the default model. */
581592
model?: string;
582593
}
583594

@@ -627,9 +638,9 @@ namespace NaturalLanguageUnderstandingV1 {
627638
export interface SemanticRolesOptions {
628639
/** Maximum number of semantic_roles results to return. */
629640
limit?: number;
630-
/** Set this to true to return keyword information for subjects and objects. */
641+
/** Set this to `true` to return keyword information for subjects and objects. */
631642
keywords?: boolean;
632-
/** Set this to true to return entity information for subjects and objects. */
643+
/** Set this to `true` to return entity information for subjects and objects. */
633644
entities?: boolean;
634645
}
635646

@@ -663,7 +674,7 @@ namespace NaturalLanguageUnderstandingV1 {
663674

664675
/** An option specifying if sentiment of detected entities, keywords, or phrases should be returned. */
665676
export interface SentimentOptions {
666-
/** Set this to false to hide document-level sentiment results. */
677+
/** Set this to `false` to hide document-level sentiment results. */
667678
document?: boolean;
668679
/** Sentiment results will be returned for each target string that is found in the document. */
669680
targets?: string[];

0 commit comments

Comments
 (0)