-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
trainingAPIClientContext.ts
50 lines (42 loc) · 1.48 KB
/
trainingAPIClientContext.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";
const packageName = "@azure/cognitiveservices-customvision-training";
const packageVersion = "4.0.0";
export class TrainingAPIClientContext extends msRest.ServiceClient {
apiKey: string;
endpoint: string;
/**
* Initializes a new instance of the TrainingAPIClientContext class.
* @param apiKey API key.
* @param endpoint Supported Cognitive Services endpoints.
* @param [options] The parameter options
*/
constructor(apiKey: string, endpoint: string, options?: msRest.ServiceClientOptions) {
if (apiKey == undefined) {
throw new Error("'apiKey' cannot be null.");
}
if (endpoint == undefined) {
throw new Error("'endpoint' cannot be null.");
}
if (!options) {
options = {};
}
if (!options.userAgent) {
const defaultUserAgent = msRest.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(undefined, options);
this.baseUri = "{Endpoint}/customvision/v3.0/training";
this.requestContentType = "application/json; charset=utf-8";
this.apiKey = apiKey;
this.endpoint = endpoint;
}
}