14
14
* limitations under the License.
15
15
*/
16
16
17
+
17
18
import extend = require( 'extend' ) ;
18
19
import { OutgoingHttpHeaders } from 'http' ;
19
20
import semver = require( 'semver' ) ;
@@ -23,12 +24,18 @@ import { stripTrailingSlash } from './helper';
23
24
import { RequestWrapper } from './requestwrapper' ;
24
25
25
26
export interface UserOptions {
26
- url ?: string ; // deprecated
27
+ /** The Authenticator object used to authenticate requests to the service */
28
+ authenticator ?: AuthenticatorInterface ;
29
+ /** The base url to use when contacting the service. The base url may differ between IBM Cloud regions. */
27
30
serviceUrl ?: string ;
28
- version ?: string ;
31
+ /** Default headers that shall be included with every request to the service. */
29
32
headers ?: OutgoingHttpHeaders ;
33
+ /** The API version date to use with the service, in "YYYY-MM-DD" format. */
34
+ version ?: string ;
35
+ /** Set to `true` to allow unauthorized requests - not recommended for production use. */
30
36
disableSslVerification ?: boolean ;
31
- authenticator ?: AuthenticatorInterface ;
37
+ /** Deprecated. Use `serviceUrl` instead. */
38
+ url ?: string ;
32
39
/** Allow additional request config parameters */
33
40
[ propName : string ] : any ;
34
41
}
@@ -48,8 +55,7 @@ export class BaseService {
48
55
/**
49
56
* Internal base class that other services inherit from
50
57
* @param {UserOptions } options
51
- * @param {HeaderOptions } [options.headers]
52
- * @param {boolean } [options.headers.X-Watson-Learning-Opt-Out=false] - opt-out of data collection
58
+ * @param {OutgoingHttpHeaders } [options.headers]
53
59
* @param {string } [options.url] - override default service base url
54
60
* @private
55
61
* @abstract
@@ -142,7 +148,7 @@ export class BaseService {
142
148
* - array: each element of the array is sent as a separate form part using any special processing as described above
143
149
* @param {Object } parameters.defaultOptions
144
150
* @param {string } parameters.defaultOptions.serviceUrl - the base URL of the service
145
- * @param {HeaderOptions } parameters.defaultOptions.headers - additional headers to be passed on the request.
151
+ * @param {OutgoingHttpHeaders } parameters.defaultOptions.headers - additional headers to be passed on the request.
146
152
* @param {Function } callback - callback function to pass the response back to
147
153
* @returns {ReadableStream|undefined }
148
154
*/
0 commit comments