This repository was archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathserver-accounts-service.d.ts
106 lines (90 loc) · 2.21 KB
/
server-accounts-service.d.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
interface IGetUsageInfo {
/**
* Returns the usage information for the provided account.
* @param {string} accountId Account id which will be used to get the usage info.
* @returns {Promise<IUsageInfo[]>}.
*/
getUsageInfo(accountId: string): Promise<IUsageInfo[]>;
}
interface IServerAccountsService extends IGetUsageInfo {
getAccounts(): Promise<IAccount[]>
getUserInfo(): Promise<IUserInfo>;
getAccountFeatures(accountId: string): Promise<IDictionary<IFeatureInfo>>;
syncPolicies(data: IDictionary<string>): Promise<void>;
}
interface IAccount {
/**
* The identifier of the account.
*/
id: string;
/**
* The name of the account. Currently firstname and lastname of the owner.
*/
name: string;
/**
* The type of the account - personal or shared.
*/
type: string;
}
interface IFeatureInfoBase {
/**
* The name of the feature (e.g. Cloud Builds).
*/
feature: string;
}
interface IUsageInfoBase extends IFeatureInfoBase {
/**
* The maximum allowed usage ammount.
*/
allowedUsage: number;
/**
* If this property is set to true the allowed usage is unlimited.
*/
unlimited: boolean;
/**
* When the monthly usage will be reset. This property is here for backwards compatibility.
*/
licenseExpiration: string;
/**
* When the license of the user expires. This is not necessary to be one month. We have complimentary
* licenses with custom license expiration. Also our users can buy N monthly licenses and the
* license expiration date will be N * 1 month.
*/
licenseExpirationDate: string;
/**
* When the monthly usage will be reset.
*/
resetDate: string;
/**
* The type of the license.
*/
licenseType: string;
/**
* Subscription edition type.
*/
editionType: string;
}
interface IUsageInfo extends IUsageInfoBase {
/**
* The description of the feature.
*/
description: string;
/**
* The usage amount.
*/
usage: number;
/**
* The usage ammount after which a notification should be sent to the user.
*/
softUsageLimit: number;
}
interface IFeatureInfo extends IFeatureInfoBase {
/**
* The type of the feature (e.g. CloudBuilds).
*/
type: string;
/**
* If this property is set to true the feature is enabled for the account.
*/
enabled: boolean;
}