/
identityRestClientContext.ts
51 lines (40 loc) · 1.52 KB
/
identityRestClientContext.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 { IdentityRestClientOptionalParams } from "./models";
const packageName = "azure-communication-identity";
const packageVersion = "1.1.0-beta.1";
export class IdentityRestClientContext extends coreHttp.ServiceClient {
endpoint: string;
apiVersion: string;
/**
* Initializes a new instance of the IdentityRestClientContext class.
* @param endpoint The communication resource, for example https://my-resource.communication.azure.com
* @param options The parameter options
*/
constructor(endpoint: string, options?: IdentityRestClientOptionalParams) {
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 || "2021-10-31-preview";
}
}