-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathauth.ts
69 lines (64 loc) · 1.71 KB
/
auth.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { authGetAccess } from "../funcs/authGetAccess.js";
import { authGetAccessToken } from "../funcs/authGetAccessToken.js";
import { authGetUser } from "../funcs/authGetUser.js";
import { authValidateApiKey } from "../funcs/authValidateApiKey.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import * as shared from "./models/shared/index.js";
import { unwrapAsync } from "./types/fp.js";
export class Auth extends ClientSDK {
/**
* Get access allowances for a particular workspace
*
* @remarks
* Checks if generation is permitted for a particular run of the CLI
*/
async getAccess(
request: operations.GetWorkspaceAccessRequest,
options?: RequestOptions,
): Promise<shared.AccessDetails> {
return unwrapAsync(authGetAccess(
this,
request,
options,
));
}
/**
* Get or refresh an access token for the current workspace.
*/
async getAccessToken(
request: operations.GetAccessTokenRequest,
options?: RequestOptions,
): Promise<operations.GetAccessTokenResponse> {
return unwrapAsync(authGetAccessToken(
this,
request,
options,
));
}
/**
* Get information about the current user.
*/
async getUser(
options?: RequestOptions,
): Promise<operations.GetUserResponse> {
return unwrapAsync(authGetUser(
this,
options,
));
}
/**
* Validate the current api key.
*/
async validateApiKey(
options?: RequestOptions,
): Promise<operations.ValidateApiKeyResponse> {
return unwrapAsync(authValidateApiKey(
this,
options,
));
}
}