-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
entitySearchClientContext.ts
50 lines (42 loc) · 1.62 KB
/
entitySearchClientContext.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
import * as msRest from "@azure/ms-rest-js";
import * as Models from "./models";
const packageName = "@azure/cognitiveservices-entitysearch";
const packageVersion = "3.0.1";
export class EntitySearchClientContext extends msRest.ServiceClient {
endpoint?: string;
credentials: msRest.ServiceClientCredentials;
/**
* Initializes a new instance of the EntitySearchClientContext class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param [options] The parameter options
*/
constructor(credentials: msRest.ServiceClientCredentials, options?: Models.EntitySearchClientOptions) {
if (credentials == undefined) {
throw new Error("'credentials' cannot be null.");
}
if (!options) {
options = {};
}
if (!options.userAgent) {
const defaultUserAgent = msRest.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(credentials, options);
this.endpoint = 'https://api.cognitive.microsoft.com';
this.baseUri = "{Endpoint}/bing/v7.0";
this.requestContentType = "application/json; charset=utf-8";
this.credentials = credentials;
if (options.endpoint !== null && options.endpoint !== undefined) {
this.endpoint = options.endpoint;
}
}
}