15
15
*/
16
16
17
17
/**
18
- * IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-902c9336-20210507-162723
18
+ * IBM OpenAPI SDK Code Generator Version: 3.38.0-07189efd-20210827-205025
19
19
*/
20
20
21
-
22
21
import * as extend from 'extend' ;
23
22
import { IncomingHttpHeaders , OutgoingHttpHeaders } from 'http' ;
24
- import { Authenticator , BaseService , getAuthenticatorFromEnvironment , getMissingParams , UserOptions } from 'ibm-cloud-sdk-core' ;
23
+ import {
24
+ Authenticator ,
25
+ BaseService ,
26
+ getAuthenticatorFromEnvironment ,
27
+ getMissingParams ,
28
+ UserOptions ,
29
+ } from 'ibm-cloud-sdk-core' ;
25
30
import { getSdkHeaders } from '../lib/common' ;
26
31
27
32
/**
@@ -51,11 +56,14 @@ import { getSdkHeaders } from '../lib/common';
51
56
*
52
57
* **Note:** Request logging is disabled for the Personality Insights service. Regardless of whether you set the
53
58
* `X-Watson-Learning-Opt-Out` request header, the service does not log or retain data from requests and responses.
59
+ *
60
+ * API Version: 3.4.4
61
+ * See: https://cloud.ibm.com/docs/personality-insights
54
62
*/
55
63
56
64
class PersonalityInsightsV3 extends BaseService {
57
-
58
65
static DEFAULT_SERVICE_URL : string = 'https://api.us-south.personality-insights.watson.cloud.ibm.com' ;
66
+
59
67
static DEFAULT_SERVICE_NAME : string = 'personality_insights' ;
60
68
61
69
/** Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current
@@ -146,8 +154,8 @@ class PersonalityInsightsV3 extends BaseService {
146
154
* profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-outputCSV#outputCSV).
147
155
*
148
156
* @param {Object } params - The parameters to send to the service.
149
- * @param {Content| string } params.content - A maximum of 20 MB of content to analyze, though the service requires much
150
- * less text; for more information, see [Providing sufficient
157
+ * @param {Content | string } params.content - A maximum of 20 MB of content to analyze, though the service requires
158
+ * much less text; for more information, see [Providing sufficient
151
159
* input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient). For JSON
152
160
* input, provide an object of type `Content`.
153
161
* @param {string } [params.contentType] - The type of the input. For more information, see **Content types** in the
@@ -175,8 +183,10 @@ class PersonalityInsightsV3 extends BaseService {
175
183
* @param {OutgoingHttpHeaders } [params.headers] - Custom request headers
176
184
* @returns {Promise<PersonalityInsightsV3.Response<PersonalityInsightsV3.Profile>> }
177
185
*/
178
- public profile ( params : PersonalityInsightsV3 . ProfileParams ) : Promise < PersonalityInsightsV3 . Response < PersonalityInsightsV3 . Profile > > {
179
- const _params = Object . assign ( { } , params ) ;
186
+ public profile (
187
+ params : PersonalityInsightsV3 . ProfileParams
188
+ ) : Promise < PersonalityInsightsV3 . Response < PersonalityInsightsV3 . Profile > > {
189
+ const _params = { ...params } ;
180
190
const requiredParams = [ 'content' ] ;
181
191
182
192
const missingParams = getMissingParams ( _params , requiredParams ) ;
@@ -189,10 +199,14 @@ class PersonalityInsightsV3 extends BaseService {
189
199
'version' : this . version ,
190
200
'raw_scores' : _params . rawScores ,
191
201
'csv_headers' : _params . csvHeaders ,
192
- 'consumption_preferences' : _params . consumptionPreferences
202
+ 'consumption_preferences' : _params . consumptionPreferences ,
193
203
} ;
194
204
195
- const sdkHeaders = getSdkHeaders ( PersonalityInsightsV3 . DEFAULT_SERVICE_NAME , 'v3' , 'profile' ) ;
205
+ const sdkHeaders = getSdkHeaders (
206
+ PersonalityInsightsV3 . DEFAULT_SERVICE_NAME ,
207
+ 'v3' ,
208
+ 'profile'
209
+ ) ;
196
210
197
211
const parameters = {
198
212
options : {
@@ -202,17 +216,22 @@ class PersonalityInsightsV3 extends BaseService {
202
216
qs : query ,
203
217
} ,
204
218
defaultOptions : extend ( true , { } , this . baseOptions , {
205
- headers : extend ( true , sdkHeaders , {
206
- 'Accept' : 'application/json' ,
207
- 'Content-Type' : _params . contentType ,
208
- 'Content-Language' : _params . contentLanguage ,
209
- 'Accept-Language' : _params . acceptLanguage
210
- } , _params . headers ) ,
219
+ headers : extend (
220
+ true ,
221
+ sdkHeaders ,
222
+ {
223
+ 'Accept' : 'application/json' ,
224
+ 'Content-Type' : _params . contentType ,
225
+ 'Content-Language' : _params . contentLanguage ,
226
+ 'Accept-Language' : _params . acceptLanguage ,
227
+ } ,
228
+ _params . headers
229
+ ) ,
211
230
} ) ,
212
231
} ;
213
232
214
233
return this . createRequest ( parameters ) ;
215
- } ;
234
+ }
216
235
217
236
/**
218
237
* Get profile as csv.
@@ -253,8 +272,8 @@ class PersonalityInsightsV3 extends BaseService {
253
272
* profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-outputCSV#outputCSV).
254
273
*
255
274
* @param {Object } params - The parameters to send to the service.
256
- * @param {Content| string } params.content - A maximum of 20 MB of content to analyze, though the service requires much
257
- * less text; for more information, see [Providing sufficient
275
+ * @param {Content | string } params.content - A maximum of 20 MB of content to analyze, though the service requires
276
+ * much less text; for more information, see [Providing sufficient
258
277
* input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient). For JSON
259
278
* input, provide an object of type `Content`.
260
279
* @param {string } [params.contentType] - The type of the input. For more information, see **Content types** in the
@@ -280,10 +299,12 @@ class PersonalityInsightsV3 extends BaseService {
280
299
* @param {boolean } [params.consumptionPreferences] - Indicates whether consumption preferences are returned with the
281
300
* results. By default, no consumption preferences are returned.
282
301
* @param {OutgoingHttpHeaders } [params.headers] - Custom request headers
283
- * @returns {Promise<PersonalityInsightsV3.Response<NodeJS.ReadableStream|Buffer >> }
302
+ * @returns {Promise<PersonalityInsightsV3.Response<NodeJS.ReadableStream>> }
284
303
*/
285
- public profileAsCsv ( params : PersonalityInsightsV3 . ProfileAsCsvParams ) : Promise < PersonalityInsightsV3 . Response < NodeJS . ReadableStream | Buffer > > {
286
- const _params = Object . assign ( { } , params ) ;
304
+ public profileAsCsv (
305
+ params : PersonalityInsightsV3 . ProfileAsCsvParams
306
+ ) : Promise < PersonalityInsightsV3 . Response < NodeJS . ReadableStream > > {
307
+ const _params = { ...params } ;
287
308
const requiredParams = [ 'content' ] ;
288
309
289
310
const missingParams = getMissingParams ( _params , requiredParams ) ;
@@ -296,10 +317,14 @@ class PersonalityInsightsV3 extends BaseService {
296
317
'version' : this . version ,
297
318
'raw_scores' : _params . rawScores ,
298
319
'csv_headers' : _params . csvHeaders ,
299
- 'consumption_preferences' : _params . consumptionPreferences
320
+ 'consumption_preferences' : _params . consumptionPreferences ,
300
321
} ;
301
322
302
- const sdkHeaders = getSdkHeaders ( PersonalityInsightsV3 . DEFAULT_SERVICE_NAME , 'v3' , 'profileAsCsv' ) ;
323
+ const sdkHeaders = getSdkHeaders (
324
+ PersonalityInsightsV3 . DEFAULT_SERVICE_NAME ,
325
+ 'v3' ,
326
+ 'profileAsCsv'
327
+ ) ;
303
328
304
329
const parameters = {
305
330
options : {
@@ -309,37 +334,39 @@ class PersonalityInsightsV3 extends BaseService {
309
334
qs : query ,
310
335
} ,
311
336
defaultOptions : extend ( true , { } , this . baseOptions , {
312
- headers : extend ( true , sdkHeaders , {
313
- 'Accept' : 'text/csv' ,
314
- 'Content-Type' : _params . contentType ,
315
- 'Content-Language' : _params . contentLanguage ,
316
- 'Accept-Language' : _params . acceptLanguage
317
- } , _params . headers ) ,
337
+ headers : extend (
338
+ true ,
339
+ sdkHeaders ,
340
+ {
341
+ 'Accept' : 'text/csv' ,
342
+ 'Content-Type' : _params . contentType ,
343
+ 'Content-Language' : _params . contentLanguage ,
344
+ 'Accept-Language' : _params . acceptLanguage ,
345
+ } ,
346
+ _params . headers
347
+ ) ,
318
348
} ) ,
319
349
} ;
320
350
321
351
return this . createRequest ( parameters ) ;
322
- } ;
323
-
352
+ }
324
353
}
325
354
326
355
/*************************
327
356
* interfaces
328
357
************************/
329
358
330
359
namespace PersonalityInsightsV3 {
331
-
332
360
/** Options for the `PersonalityInsightsV3` constructor. */
333
361
export interface Options extends UserOptions {
334
-
335
362
/** Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current
336
363
* version is `2017-10-13`.
337
364
*/
338
365
version : string ;
339
366
}
340
367
341
368
/** An operation response. */
342
- export interface Response < T = any > {
369
+ export interface Response < T = any > {
343
370
result : T ;
344
371
status : number ;
345
372
statusText : string ;
@@ -350,7 +377,7 @@ namespace PersonalityInsightsV3 {
350
377
export type Callback < T > = ( error : any , response ?: Response < T > ) => void ;
351
378
352
379
/** The body of a service request that returns no response data. */
353
- export interface Empty { }
380
+ export interface Empty { }
354
381
355
382
/** A standard JS object, defined to avoid the limitations of `Object` and `object` */
356
383
export interface JsonObject {
@@ -368,7 +395,7 @@ namespace PersonalityInsightsV3 {
368
395
* input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient). For JSON
369
396
* input, provide an object of type `Content`.
370
397
*/
371
- content : Content | string ;
398
+ content : Content | string ;
372
399
/** The type of the input. For more information, see **Content types** in the method description. */
373
400
contentType ?: ProfileConstants . ContentType | string ;
374
401
/** The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional
@@ -441,7 +468,7 @@ namespace PersonalityInsightsV3 {
441
468
* input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient). For JSON
442
469
* input, provide an object of type `Content`.
443
470
*/
444
- content : Content | string ;
471
+ content : Content | string ;
445
472
/** The type of the input. For more information, see **Content types** in the method description. */
446
473
contentType ?: ProfileAsCsvConstants . ContentType | string ;
447
474
/** The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional
@@ -697,7 +724,6 @@ namespace PersonalityInsightsV3 {
697
724
*/
698
725
message : string ;
699
726
}
700
-
701
727
}
702
728
703
729
export = PersonalityInsightsV3 ;
0 commit comments