-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
chatApiClientContext.ts
51 lines (40 loc) · 1.47 KB
/
chatApiClientContext.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
51
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreHttp from "@azure/core-http";
import { ChatApiClientOptionalParams } from "./models";
const packageName = "azure-communication-chat";
const packageVersion = "1.0.0-beta.3";
export class ChatApiClientContext extends coreHttp.ServiceClient {
endpoint: string;
apiVersion: string;
/**
* Initializes a new instance of the ChatApiClientContext class.
* @param endpoint - The endpoint of the Azure Communication resource.
* @param options - The parameter options
*/
constructor(endpoint: string, options?: ChatApiClientOptionalParams) {
if (endpoint === undefined) {
throw new Error("'endpoint' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
if (!options.userAgent) {
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}
super(undefined, options);
this.requestContentType = "application/json; charset=utf-8";
this.baseUri = options.endpoint || "{endpoint}";
// Parameter assignments
this.endpoint = endpoint;
// Assigning values to Constant parameters
this.apiVersion = options.apiVersion || "2020-11-01-preview3";
}
}