-
Notifications
You must be signed in to change notification settings - Fork 3
/
quotas.d.ts
112 lines (110 loc) · 4.1 KB
/
quotas.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
107
108
109
110
111
112
import { A as ApiCallOptions } from './invoke-fetch-types-0Dw3a71T.js';
import './auth-types-PkN9CAF_.js';
/**
* A specific error.
*/
type Error = {
/** The error code. */
code: string;
/** Summary of the problem. */
title: string;
};
type ErrorResponse = {
errors?: Error[];
};
type GetQuotaByIdResult = {
/** Quota item. */
data: Quota[];
};
type GetQuotasResult = {
/** Array of quota items. */
data: Quota[];
};
type Quota = {
/** The attributes of the quota. */
attributes: {
/** The quota limit. If there is no quota limit, -1 is returned. */
quota: number;
/** The unit of the quota limit. For memory quotas, the unit is always "bytes". For other discrete units, the item counted is used as unit, for example "spaces". */
unit: string;
/** The current quota usage, if applicable. This attribute is only present if it is requested using the reportUsage query parameter. */
usage?: number;
/** The warning thresholds at which "close to quota" warnings can be issued when exceeded. If omitted, no warning threshold shall be used. Currently, the array will contain only one threshold value. In the future, this may be extended. The threshold is a number between 0 and 1, relating to the quota limit. For example, a value of 0.9 means that a warning should be issued when exceeding 90% of the quota limit. */
warningThresholds?: number[];
};
/** The unique identifier of the quota item. For example, "app_mem_size", "app_upload_disk_size", or "shared_spaces". */
id: string;
/** The resource type of the quota item. Always equal to "quotas". */
type: string;
};
/**
* Returns all quota items for the tenant (provided in JWT).
*
* @param query an object with query parameters
* @throws GetQuotasHttpError
*/
declare const getQuotas: (query: {
/** The Boolean flag indicating whether quota usage shall be part of the response. The default value is false (only limits returned). */
reportUsage?: boolean;
}, options?: ApiCallOptions) => Promise<GetQuotasHttpResponse>;
type GetQuotasHttpResponse = {
data: GetQuotasResult;
headers: Headers;
status: number;
};
type GetQuotasHttpError = {
data: ErrorResponse;
headers: Headers;
status: number;
};
/**
* Returns a specific quota item for the tenant (provided in JWT).
*
* @param id The unique identifier of the quota item. For example, "app_mem_size", "app_upload_disk_size", or "shared_spaces".
* @param query an object with query parameters
* @throws GetQuotaHttpError
*/
declare const getQuota: (id: string, query: {
/** The Boolean flag indicating whether quota usage shall be part of the response. The default value is false (usage not included). */
reportUsage?: boolean;
}, options?: ApiCallOptions) => Promise<GetQuotaHttpResponse>;
type GetQuotaHttpResponse = {
data: GetQuotaByIdResult;
headers: Headers;
status: number;
};
type GetQuotaHttpError = {
data: ErrorResponse;
headers: Headers;
status: number;
};
/**
* Clears the cache for quotas api requests.
*/
declare function clearCache(): void;
interface QuotasAPI {
/**
* Returns all quota items for the tenant (provided in JWT).
*
* @param query an object with query parameters
* @throws GetQuotasHttpError
*/
getQuotas: typeof getQuotas;
/**
* Returns a specific quota item for the tenant (provided in JWT).
*
* @param id The unique identifier of the quota item. For example, "app_mem_size", "app_upload_disk_size", or "shared_spaces".
* @param query an object with query parameters
* @throws GetQuotaHttpError
*/
getQuota: typeof getQuota;
/**
* Clears the cache for quotas api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the quotas api
*/
declare const quotasExport: QuotasAPI;
export { type Error, type ErrorResponse, type GetQuotaByIdResult, type GetQuotaHttpError, type GetQuotaHttpResponse, type GetQuotasHttpError, type GetQuotasHttpResponse, type GetQuotasResult, type Quota, type QuotasAPI, clearCache, quotasExport as default, getQuota, getQuotas };