@squonk/account-server-client 4.2.1 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/asset/asset.cjs +99 -126
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.cts +99 -99
  4. package/asset/asset.d.ts +99 -99
  5. package/asset/asset.js +107 -134
  6. package/asset/asset.js.map +1 -1
  7. package/charges/charges.cjs +73 -85
  8. package/charges/charges.cjs.map +1 -1
  9. package/charges/charges.d.cts +47 -47
  10. package/charges/charges.d.ts +47 -47
  11. package/charges/charges.js +78 -90
  12. package/charges/charges.js.map +1 -1
  13. package/chunk-3WKSNKHE.js +25 -0
  14. package/chunk-3WKSNKHE.js.map +1 -0
  15. package/chunk-NY2VJJG7.cjs +25 -0
  16. package/chunk-NY2VJJG7.cjs.map +1 -0
  17. package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
  18. package/chunk-RB2KVIEK.cjs.map +1 -0
  19. package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
  20. package/chunk-XYDLYMQ2.js.map +1 -0
  21. package/event-stream/event-stream.cjs +53 -61
  22. package/event-stream/event-stream.cjs.map +1 -1
  23. package/event-stream/event-stream.d.cts +45 -45
  24. package/event-stream/event-stream.d.ts +45 -45
  25. package/event-stream/event-stream.js +58 -66
  26. package/event-stream/event-stream.js.map +1 -1
  27. package/index.cjs +49 -57
  28. package/index.cjs.map +1 -1
  29. package/index.d.cts +796 -773
  30. package/index.d.ts +796 -773
  31. package/index.js +48 -56
  32. package/index.js.map +1 -1
  33. package/merchant/merchant.cjs +38 -45
  34. package/merchant/merchant.cjs.map +1 -1
  35. package/merchant/merchant.d.cts +25 -25
  36. package/merchant/merchant.d.ts +25 -25
  37. package/merchant/merchant.js +42 -49
  38. package/merchant/merchant.js.map +1 -1
  39. package/organisation/organisation.cjs +77 -87
  40. package/organisation/organisation.cjs.map +1 -1
  41. package/organisation/organisation.d.cts +72 -70
  42. package/organisation/organisation.d.ts +72 -70
  43. package/organisation/organisation.js +83 -93
  44. package/organisation/organisation.js.map +1 -1
  45. package/package.json +13 -16
  46. package/product/product.cjs +143 -153
  47. package/product/product.cjs.map +1 -1
  48. package/product/product.d.cts +100 -100
  49. package/product/product.d.ts +100 -100
  50. package/product/product.js +153 -163
  51. package/product/product.js.map +1 -1
  52. package/src/account-server-api.schemas.ts +863 -856
  53. package/src/asset/asset.ts +899 -634
  54. package/src/charges/charges.ts +822 -498
  55. package/src/custom-instance.ts +3 -3
  56. package/src/event-stream/event-stream.ts +531 -345
  57. package/src/index.ts +2 -2
  58. package/src/merchant/merchant.ts +355 -234
  59. package/src/options-mutator.ts +27 -0
  60. package/src/organisation/organisation.ts +812 -504
  61. package/src/product/product.ts +1373 -841
  62. package/src/state/state.ts +174 -127
  63. package/src/unit/unit.ts +1273 -603
  64. package/src/user/user.ts +895 -564
  65. package/state/state.cjs +22 -24
  66. package/state/state.cjs.map +1 -1
  67. package/state/state.d.cts +14 -14
  68. package/state/state.d.ts +14 -14
  69. package/state/state.js +24 -26
  70. package/state/state.js.map +1 -1
  71. package/unit/unit.cjs +171 -106
  72. package/unit/unit.cjs.map +1 -1
  73. package/unit/unit.d.cts +200 -90
  74. package/unit/unit.d.ts +200 -90
  75. package/unit/unit.js +179 -114
  76. package/unit/unit.js.map +1 -1
  77. package/user/user.cjs +94 -110
  78. package/user/user.cjs.map +1 -1
  79. package/user/user.d.cts +77 -77
  80. package/user/user.d.ts +77 -77
  81. package/user/user.js +101 -117
  82. package/user/user.js.map +1 -1
  83. package/chunk-EBOQPVLG.js.map +0 -1
  84. package/chunk-TKLTUR4R.cjs.map +0 -1
@@ -1,649 +1,446 @@
1
- // @ts-nocheck
2
1
  /**
3
- * Generated by orval v7.4.1 🍺
2
+ * Generated by orval v7.10.0 🍺
4
3
  * Do not edit manually.
5
4
  * Account Server API
6
5
  * The Informatics Matters Account Server API.
7
6
 
8
7
  A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
9
8
 
10
- * OpenAPI spec version: 4.2
9
+ * OpenAPI spec version: 4.3
11
10
  */
12
- export type AttachAssetParams = {
13
- /**
14
- * A Merchant Identity
15
- */
16
- m_id?: QMIdParameter;
17
- };
18
-
19
- export type GetUnitsParams = {
20
- /**
21
- * An object name
22
- */
23
- name?: QNameParameter;
24
- };
25
-
26
- export type GetOrganisationsParams = {
27
- /**
28
- * An object name
29
- */
30
- name?: QNameParameter;
31
- };
32
-
33
- /**
34
- * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
35
- */
36
- export type QUntilParameter = string;
37
-
38
- /**
39
- * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
40
- */
41
- export type QFromParameter = string;
42
-
43
- export type GetUnitChargesParams = {
44
- /**
45
- * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
46
- */
47
- from?: QFromParameter;
48
- /**
49
- * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
50
- */
51
- until?: QUntilParameter;
52
- /**
53
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
54
- */
55
- pbp?: QPbpParameter;
56
- };
57
-
58
- export type GetProductChargesParams = {
59
- /**
60
- * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
61
- */
62
- from?: QFromParameter;
63
- /**
64
- * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
65
- */
66
- until?: QUntilParameter;
67
- /**
68
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
69
- */
70
- pbp?: QPbpParameter;
71
- };
72
-
73
- export type GetOrganisationChargesParams = {
74
- /**
75
- * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
76
- */
77
- from?: QFromParameter;
78
- /**
79
- * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
80
- */
81
- until?: QUntilParameter;
82
- /**
83
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
84
- */
85
- pbp?: QPbpParameter;
86
- };
87
-
88
- export type GetChargesParams = {
89
- /**
90
- * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
91
- */
92
- from?: QFromParameter;
93
- /**
94
- * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
95
- */
96
- until?: QUntilParameter;
97
- /**
98
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
99
- */
100
- pbp?: QPbpParameter;
101
- };
102
-
103
- /**
104
- * A User Identity
105
- */
106
- export type QUserIdParameter = string;
107
-
108
- /**
109
- * A Product Identity
110
- */
111
- export type QProductIdParameter = string;
112
-
113
- /**
114
- * A Unit Identity
115
- */
116
- export type QUnitIdParameter = string;
117
-
118
- /**
119
- * An object name
120
- */
121
- export type QNameParameter = string;
122
-
123
- /**
124
- * A Merchant Identity
125
- */
126
- export type QMIdParameter = number;
127
-
128
- export type DetachAssetParams = {
129
- /**
130
- * A Merchant Identity
131
- */
132
- m_id?: QMIdParameter;
133
- };
134
-
135
- /**
136
- * An Organisation Identity
137
- */
138
- export type QOrgIdParameter = string;
139
-
140
- export type GetAssetParams = {
141
- /**
142
- * A User Identity
143
- */
144
- user_id?: QUserIdParameter;
145
- /**
146
- * A Product Identity
147
- */
148
- product_id?: QProductIdParameter;
149
- /**
150
- * A Unit Identity
151
- */
152
- unit_id?: QUnitIdParameter;
153
- /**
154
- * An Organisation Identity
155
- */
156
- org_id?: QOrgIdParameter;
157
- };
11
+ export interface AsError {
12
+ /** Brief error text that can be presented to the user */
13
+ error: string;
14
+ }
158
15
 
159
- /**
160
- * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
161
- */
162
- export type QPbpParameter = number;
16
+ export type AssetGetByIdResponse = AssetDetail;
163
17
 
164
- export type ProductPatchBodyBody = {
165
- /**
166
- * The name you want to give the Product
167
- * @maxLength 80
168
- */
169
- name?: string;
170
- /**
171
- * The Product's built-in coin allowance. Product allowances cannot be reduced
172
- * @minimum 1
18
+ export interface AssetGetResponse {
19
+ /** A list of Assets
173
20
  */
174
- allowance?: number;
175
- /**
176
- * The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced
177
- * @minimum 1
21
+ assets: AssetDetail[];
22
+ /** The number of Assets returned
178
23
  */
179
- limit?: number;
180
- };
24
+ count: number;
25
+ }
181
26
 
182
- /**
183
- * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
184
- */
185
- export type UnitProductPostBodyBodyFlavour = typeof UnitProductPostBodyBodyFlavour[keyof typeof UnitProductPostBodyBodyFlavour];
27
+ export interface AssetPostResponse {
28
+ /** The Asset ID
29
+ */
30
+ id: string;
31
+ }
186
32
 
33
+ export interface ChargesGetResponse {
34
+ coins: string;
35
+ count: number;
36
+ summary: ChargeSummary[];
37
+ organisation_charges: OrganisationChargeSummary[];
38
+ }
187
39
 
188
- // eslint-disable-next-line @typescript-eslint/no-redeclare
189
- export const UnitProductPostBodyBodyFlavour = {
190
- EVALUATION: 'EVALUATION',
191
- BRONZE: 'BRONZE',
192
- SILVER: 'SILVER',
193
- GOLD: 'GOLD',
194
- } as const;
40
+ export interface EventStreamGetPostResponse {
41
+ /** The EventStream ID */
42
+ id: number;
43
+ /** A symbolic name, used internally to identify the stream */
44
+ name: string;
45
+ /** The Event Stream location. This will be a URL where events can be fetched. The protocol is typically a WebSocket, but the protocol is defined by the specific Event Stream Service that has been deployed. */
46
+ location: string;
47
+ /** The Event Stream format. */
48
+ format: string;
49
+ }
195
50
 
196
51
  /**
197
- * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
198
-
199
- Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
52
+ * The Event Stream protocol, used to inform the client how to connect to given locations and handle events. At the moment the AS only supports web-sockets.
200
53
  */
201
- export type UnitProductPostBodyBodyType = typeof UnitProductPostBodyBodyType[keyof typeof UnitProductPostBodyBodyType];
202
-
54
+ export type EventStreamVersionGetResponseProtocol =
55
+ (typeof EventStreamVersionGetResponseProtocol)[keyof typeof EventStreamVersionGetResponseProtocol];
203
56
 
204
57
  // eslint-disable-next-line @typescript-eslint/no-redeclare
205
- export const UnitProductPostBodyBodyType = {
206
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
207
- DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
58
+ export const EventStreamVersionGetResponseProtocol = {
59
+ ERROR_INTERNAL: "ERROR_INTERNAL",
60
+ SERVICE_NOT_PRESENT: "SERVICE_NOT_PRESENT",
61
+ WEBSOCKET: "WEBSOCKET",
208
62
  } as const;
209
63
 
210
- export type UnitProductPostBodyBody = {
211
- /**
212
- * The name you want to give the Product
213
- * @maxLength 80
214
- */
64
+ export interface EventStreamVersionGetResponse {
65
+ /** The EventStream implementation version */
66
+ version: string;
67
+ /** The Event Stream protocol, used to inform the client how to connect to given locations and handle events. At the moment the AS only supports web-sockets. */
68
+ protocol: EventStreamVersionGetResponseProtocol;
69
+ /** The name of the Event Stream implementation, often used to identify the service origin and implementation. */
215
70
  name: string;
216
- /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
71
+ }
217
72
 
218
- Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */
219
- type: UnitProductPostBodyBodyType;
220
- /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */
221
- flavour?: UnitProductPostBodyBodyFlavour;
222
- /**
223
- * The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products
224
- * @minimum 1
225
- */
226
- allowance?: number;
227
- /**
228
- * The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products
229
- * @minimum 1
73
+ export interface StateGetVersionResponse {
74
+ /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined
230
75
  */
231
- limit?: number;
232
- };
233
-
234
- /**
235
- * The new default **Product** privacy applied to all products that belong to this Unit. Privacy is also controlled at the **Organisation** level. As an example, the Unit can declare its Products to be `DEFAULT_PRIVATE`, but the Organisation can declare its value to be `DEFAULT_PUBLIC`.
236
-
237
- Whether the privacy can be honoured will depend on the organisation's value
238
- */
239
- export type UnitPatchBodyBodyDefaultProductPrivacy = typeof UnitPatchBodyBodyDefaultProductPrivacy[keyof typeof UnitPatchBodyBodyDefaultProductPrivacy];
240
-
241
-
242
- // eslint-disable-next-line @typescript-eslint/no-redeclare
243
- export const UnitPatchBodyBodyDefaultProductPrivacy = {
244
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
245
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
246
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
247
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
248
- } as const;
249
-
250
- export type UnitPatchBodyBody = {
251
- /** The new name for the Unit */
252
- name?: string;
253
- /** The new default **Product** privacy applied to all products that belong to this Unit. Privacy is also controlled at the **Organisation** level. As an example, the Unit can declare its Products to be `DEFAULT_PRIVATE`, but the Organisation can declare its value to be `DEFAULT_PUBLIC`.
254
-
255
- Whether the privacy can be honoured will depend on the organisation's value */
256
- default_product_privacy?: UnitPatchBodyBodyDefaultProductPrivacy;
257
- };
258
-
259
- /**
260
- * The new default **Product** privacy applied to all products that belong to this Organisation. Privacy is also controlled at the **Unit** level. As an example the Organisation level privacy can be `DEFAULT_PRIVATE`, but the unit can declare its Products to be `ALWAYS_PRIVATE`.
261
-
262
- Whether the privacy can be honoured will depend on the value in any of the organisation's existing units
263
- */
264
- export type OrganisationPatchBodyBodyDefaultProductPrivacy = typeof OrganisationPatchBodyBodyDefaultProductPrivacy[keyof typeof OrganisationPatchBodyBodyDefaultProductPrivacy];
265
-
266
-
267
- // eslint-disable-next-line @typescript-eslint/no-redeclare
268
- export const OrganisationPatchBodyBodyDefaultProductPrivacy = {
269
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
270
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
271
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
272
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
273
- } as const;
76
+ version: string;
77
+ }
274
78
 
275
- export type OrganisationPatchBodyBody = {
276
- /** The new name for the Organisational */
277
- name?: string;
278
- /** The new default **Product** privacy applied to all products that belong to this Organisation. Privacy is also controlled at the **Unit** level. As an example the Organisation level privacy can be `DEFAULT_PRIVATE`, but the unit can declare its Products to be `ALWAYS_PRIVATE`.
79
+ export interface OrganisationPostResponse {
80
+ /** The Organisation's unique ID */
81
+ id: string;
82
+ }
279
83
 
280
- Whether the privacy can be honoured will depend on the value in any of the organisation's existing units */
281
- default_product_privacy?: OrganisationPatchBodyBodyDefaultProductPrivacy;
282
- };
84
+ export interface UsersGetResponse {
85
+ count: number;
86
+ organisation?: OrganisationDetail;
87
+ unit?: UnitDetail;
88
+ /** The list of Organisation Users
89
+ */
90
+ users: UserDetail[];
91
+ }
283
92
 
284
93
  /**
285
- * The default product privacy setting for products in the unit. Whether the privacy can be honoured will depend on the organisation's value
94
+ * The Organisation's default product privacy setting
286
95
  */
287
- export type OrganisationUnitPostBodyBodyDefaultProductPrivacy = typeof OrganisationUnitPostBodyBodyDefaultProductPrivacy[keyof typeof OrganisationUnitPostBodyBodyDefaultProductPrivacy];
288
-
96
+ export type OrganisationGetDefaultResponseDefaultProductPrivacy =
97
+ (typeof OrganisationGetDefaultResponseDefaultProductPrivacy)[keyof typeof OrganisationGetDefaultResponseDefaultProductPrivacy];
289
98
 
290
99
  // eslint-disable-next-line @typescript-eslint/no-redeclare
291
- export const OrganisationUnitPostBodyBodyDefaultProductPrivacy = {
292
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
293
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
294
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
295
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
100
+ export const OrganisationGetDefaultResponseDefaultProductPrivacy = {
101
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
102
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
103
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
104
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
296
105
  } as const;
297
106
 
298
- export type OrganisationUnitPostBodyBody = {
299
- /**
300
- * The name of the unit
301
- * @maxLength 80
107
+ export interface OrganisationGetDefaultResponse {
108
+ /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
109
+ caller_is_member?: boolean;
110
+ /** The Default Organisation ID
302
111
  */
303
- name: string;
304
- /**
305
- * The day you would like to be billed for the Unit's Products (a value from 1 and 28)
306
- * @minimum 1
307
- * @maximum 28
112
+ id?: string;
113
+ /** The Default Organisation Name
308
114
  */
309
- billing_day: number;
310
- /** The default product privacy setting for products in the unit. Whether the privacy can be honoured will depend on the organisation's value */
311
- default_product_privacy?: OrganisationUnitPostBodyBodyDefaultProductPrivacy;
312
- };
313
-
314
- export type PersonalUnitPutBodyBody = {
315
- /**
316
- * The day you would like to be billed for the Unit's Products (a value from 1 and 28)
317
- * @minimum 1
318
- * @maximum 28
115
+ name?: string;
116
+ /** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units
319
117
  */
320
- billing_day: number;
321
- };
322
-
323
- /**
324
- * The default product privacy setting for the Organisation
325
- */
326
- export type OrganisationPostBodyBodyDefaultProductPrivacy = typeof OrganisationPostBodyBodyDefaultProductPrivacy[keyof typeof OrganisationPostBodyBodyDefaultProductPrivacy];
118
+ private?: boolean;
119
+ created?: string;
120
+ /** The Organisation's default product privacy setting */
121
+ default_product_privacy?: OrganisationGetDefaultResponseDefaultProductPrivacy;
122
+ }
327
123
 
124
+ export interface OrganisationUnitPostResponse {
125
+ /** The unit's unique ID */
126
+ id: string;
127
+ }
328
128
 
329
- // eslint-disable-next-line @typescript-eslint/no-redeclare
330
- export const OrganisationPostBodyBodyDefaultProductPrivacy = {
331
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
332
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
333
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
334
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
335
- } as const;
129
+ export interface PersonalUnitPutResponse {
130
+ /** The unit's Organisation. Used to identify the Default organisation */
131
+ organisation_id: string;
132
+ /** The unit's unique ID */
133
+ id: string;
134
+ }
336
135
 
337
- export type OrganisationPostBodyBody = {
338
- /**
339
- * The name of the organisation
340
- * @maxLength 80
341
- */
136
+ export interface OrganisationChargeSummary {
137
+ organisation_id: string;
342
138
  name: string;
343
- /** The name of the organisation owner. A user ID */
344
- owner: string;
345
- /** The default product privacy setting for the Organisation */
346
- default_product_privacy?: OrganisationPostBodyBodyDefaultProductPrivacy;
347
- };
348
-
349
- export type EventStreamPostBodyBodyFormat = typeof EventStreamPostBodyBodyFormat[keyof typeof EventStreamPostBodyBodyFormat];
350
-
351
-
352
- // eslint-disable-next-line @typescript-eslint/no-redeclare
353
- export const EventStreamPostBodyBodyFormat = {
354
- PROTOCOL_STRING: 'PROTOCOL_STRING',
355
- JSON_STRING: 'JSON_STRING',
356
- } as const;
357
-
358
- export type EventStreamPostBodyBody = {
359
- format?: EventStreamPostBodyBodyFormat;
360
- };
361
-
362
- export type AssetPostBodyBodyScope = typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];
363
-
364
-
365
- // eslint-disable-next-line @typescript-eslint/no-redeclare
366
- export const AssetPostBodyBodyScope = {
367
- USER: 'USER',
368
- PRODUCT: 'PRODUCT',
369
- UNIT: 'UNIT',
370
- ORGANISATION: 'ORGANISATION',
371
- GLOBAL: 'GLOBAL',
372
- } as const;
139
+ summary: ChargeSummary[];
140
+ }
373
141
 
374
- export type AssetPostBodyBody = {
375
- /**
376
- * The name of the asset. This must be unique within its scope. For example, only one asset can be called "asset-1" within a given Unit. Asset names must be valid RFC 1123 Label Names
377
- * @maxLength 80
378
- * @pattern ^[a-z0-9-]{1,63}$
142
+ export interface OrganisationUnitsGetResponse {
143
+ count?: number;
144
+ organisation: OrganisationAllDetail;
145
+ /** A list of Units
379
146
  */
380
- name: string;
381
- /** A file containing the content for the asset. You must provide a value here or in content_string */
382
- content_file?: Blob;
383
- /** The textual content of the asset. You must provide a value here or in content_file */
384
- content_string?: string;
385
- scope: AssetPostBodyBodyScope;
386
- /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username. Global assets do not have a scope. */
387
- scope_id?: string;
388
- /** Is this a secret asset? */
389
- secret: boolean;
390
- /** An optional description for the Asset */
391
- description?: string;
392
- };
147
+ units: UnitAllDetail[];
148
+ }
393
149
 
394
- export type AssetPatchBodyBody = {
395
- /** A file containing the content for the asset. You must provide a value here or in content_string */
396
- content_file?: Blob;
397
- /** The textual content of the asset. You must provide a value here or in content_file */
398
- content_string?: string;
399
- /** An optional description for the Asset */
400
- description?: string;
401
- };
150
+ export interface OrganisationChargesGetResponse {
151
+ organisation_id: string;
152
+ name: string;
153
+ coins: string;
154
+ summary: ChargeSummary[];
155
+ unit_charges: OrganisationUnitChargeSummary[];
156
+ }
402
157
 
403
- export interface UserDetail {
404
- /** The user identity (username) */
405
- id: string;
158
+ export interface OrganisationUnitChargeSummary {
159
+ unit_id: string;
160
+ name: string;
161
+ /**
162
+ * @minimum 1
163
+ * @maximum 28
164
+ */
165
+ billing_day: number;
166
+ /** The start of the charge period */
167
+ from: string;
168
+ /** The date where of first day after the charge period */
169
+ until: string;
170
+ summary: ChargeSummary[];
406
171
  }
407
172
 
408
- export interface UserAccountDetail {
409
- user: UserDetail;
410
- /** Whether the caller has admin privilege */
411
- caller_has_admin_privilege: boolean;
412
- /** The roles assigned to the user recognised by the Account Server */
413
- account_server_roles: string[];
173
+ export interface OrganisationsGetResponse {
174
+ count: number;
175
+ /** A list of Organisations */
176
+ organisations: OrganisationAllDetail[];
414
177
  }
415
178
 
416
- /**
417
- * The Unit's default product privacy setting
418
- */
419
- export type UnitDetailDefaultProductPrivacy = typeof UnitDetailDefaultProductPrivacy[keyof typeof UnitDetailDefaultProductPrivacy];
179
+ export type OrganisationGetResponse = OrganisationAllDetail;
420
180
 
181
+ export type ProductChargesGetResponseProductType =
182
+ (typeof ProductChargesGetResponseProductType)[keyof typeof ProductChargesGetResponseProductType];
421
183
 
422
184
  // eslint-disable-next-line @typescript-eslint/no-redeclare
423
- export const UnitDetailDefaultProductPrivacy = {
424
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
425
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
426
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
427
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
185
+ export const ProductChargesGetResponseProductType = {
186
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
187
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
428
188
  } as const;
429
189
 
430
- export interface UnitDetail {
431
- /** Whether the user making the API call is a member of the Unit */
432
- caller_is_member: boolean;
433
- /** The Unit's unique identity */
434
- id: string;
435
- /** The Unit's name */
436
- name: string;
437
- /** The Unit's owner (a username) */
438
- owner_id: string;
439
- /** True if the Unit is private */
440
- private: boolean;
441
- created: string;
442
- /** The Unit's billing day */
190
+ export interface ProductChargesGetResponse {
191
+ product_id: string;
192
+ product_type: ProductChargesGetResponseProductType;
193
+ /**
194
+ * @minimum 1
195
+ * @maximum 28
196
+ */
443
197
  billing_day: number;
444
- /** The Unit's default product privacy setting */
445
- default_product_privacy: UnitDetailDefaultProductPrivacy;
198
+ /** True if the product can be (needs to be) claimed. */
199
+ claimable: boolean;
200
+ claim?: ProductClaimDetail;
201
+ count: number;
202
+ /** The start of the charge period */
203
+ from: string;
204
+ /** The date where of first day after the charge period */
205
+ until: string;
206
+ /** The total number of coins consumed by this product for the invoice period */
207
+ coins: string;
208
+ processing_charges: ProcessingCharges[];
209
+ storage_charges: StorageCharges;
210
+ }
211
+
212
+ export type ProductsGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;
213
+
214
+ export interface ProductsGetResponse {
215
+ count: number;
216
+ /** All the Products you have access to */
217
+ products: ProductsGetResponseProductsItem[];
218
+ }
219
+
220
+ export type ProductsGetDefaultStorageCostDefaultStorageCost = {
221
+ cost: string;
222
+ units: string;
223
+ description: string;
224
+ };
225
+
226
+ export interface ProductsGetDefaultStorageCost {
227
+ default_storage_cost: ProductsGetDefaultStorageCostDefaultStorageCost;
228
+ }
229
+
230
+ export interface ProductsGetTypesResponse {
231
+ /** The number of Product Types */
232
+ count: number;
233
+ /** All the Product Types you have access to */
234
+ product_types: ProductType[];
446
235
  }
447
236
 
448
237
  /**
449
- * The Unit's default product privacy setting
238
+ * The Unit's Product
450
239
  */
451
- export type UnitAllDetailDefaultProductPrivacy = typeof UnitAllDetailDefaultProductPrivacy[keyof typeof UnitAllDetailDefaultProductPrivacy];
452
-
240
+ export type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;
453
241
 
454
- // eslint-disable-next-line @typescript-eslint/no-redeclare
455
- export const UnitAllDetailDefaultProductPrivacy = {
456
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
457
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
458
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
459
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
460
- } as const;
242
+ export interface ProductUnitGetResponse {
243
+ /** The Unit's Product */
244
+ product: ProductUnitGetResponseProduct;
245
+ }
461
246
 
462
- export interface UnitAllDetail {
247
+ export interface UnitChargesGetResponse {
463
248
  /** Whether the user making the API call is a member of the Unit */
464
249
  caller_is_member: boolean;
465
- /** The Unit's unique identity */
466
- id: string;
467
- /** The Unit's name */
468
- name: string;
250
+ unit_id: string;
251
+ name?: string;
469
252
  /** The Unit's owner (a username) */
470
253
  owner_id: string;
471
254
  /** True if the Unit is private */
472
255
  private: boolean;
473
256
  created: string;
474
- /** The Unit's billing day */
257
+ coins: string;
258
+ count: number;
259
+ /**
260
+ * @minimum 1
261
+ * @maximum 28
262
+ */
475
263
  billing_day: number;
476
- /** The Unit's default product privacy setting */
477
- default_product_privacy: UnitAllDetailDefaultProductPrivacy;
478
- /** A list of users that are members of the Unit */
479
- users: UserDetail[];
264
+ /** The start of the charge period */
265
+ from: string;
266
+ /** The date where of first day after the charge period */
267
+ until: string;
268
+ summary: UnitChargeSummary;
269
+ products: UnitProductChargeSummary[];
480
270
  }
481
271
 
482
- /**
483
- * The kind of Service
484
- */
485
- export type MerchantDetailKind = typeof MerchantDetailKind[keyof typeof MerchantDetailKind];
486
-
487
-
488
- // eslint-disable-next-line @typescript-eslint/no-redeclare
489
- export const MerchantDetailKind = {
490
- DATA_MANAGER: 'DATA_MANAGER',
491
- } as const;
492
-
493
- export interface MerchantDetail {
494
- /** The unique ID of the Service */
495
- id: number;
496
- created: string;
497
- /** The kind of Service */
498
- kind: MerchantDetailKind;
499
- /** The name assigned to the Service */
500
- name: string;
501
- /** The hostname used by the Service */
502
- api_hostname: string;
272
+ export interface UnitChargeSummary {
273
+ charges: ChargeSummary[];
503
274
  }
504
275
 
505
- export type MerchantGetResponse = MerchantDetail;
506
-
507
- export interface MerchantsGetResponse {
508
- count?: number;
509
- /** The list of known Merchants
510
- */
511
- merchants: MerchantDetail[];
276
+ export interface UnitProductChargeSummary {
277
+ product_id: string;
278
+ product_type: string;
279
+ charges: ChargeSummary[];
512
280
  }
513
281
 
514
282
  /**
515
- * The Organisation's default product privacy setting
283
+ * The type of charge
516
284
  */
517
- export type OrganisationDetailDefaultProductPrivacy = typeof OrganisationDetailDefaultProductPrivacy[keyof typeof OrganisationDetailDefaultProductPrivacy];
518
-
285
+ export type ChargeSummaryType = (typeof ChargeSummaryType)[keyof typeof ChargeSummaryType];
519
286
 
520
287
  // eslint-disable-next-line @typescript-eslint/no-redeclare
521
- export const OrganisationDetailDefaultProductPrivacy = {
522
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
523
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
524
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
525
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
526
- } as const;
288
+ export const ChargeSummaryType = { PROCESSING: "PROCESSING", STORAGE: "STORAGE" } as const;
527
289
 
528
- export interface OrganisationDetail {
529
- /** Whether the user making the API call is a member of the Unit */
530
- caller_is_member: boolean;
531
- /** The Organisation's unique ID */
290
+ export interface ChargeSummary {
291
+ /** The type of charge */
292
+ type: ChargeSummaryType;
293
+ /** The cost, in coins of the charge */
294
+ coins: string;
295
+ }
296
+
297
+ export interface UnitProductPostResponse {
298
+ /** The Product's unique ID */
532
299
  id: string;
533
- /** The Organisation's name */
534
- name: string;
535
- /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
536
- owner_id?: string;
537
- /** True if the Unit is private */
538
- private: boolean;
539
- created: string;
540
- /** The Organisation's default product privacy setting */
541
- default_product_privacy: OrganisationDetailDefaultProductPrivacy;
542
300
  }
543
301
 
544
- /**
545
- * The Organisation's default product privacy setting
546
- */
547
- export type OrganisationAllDetailDefaultProductPrivacy = typeof OrganisationAllDetailDefaultProductPrivacy[keyof typeof OrganisationAllDetailDefaultProductPrivacy];
302
+ export type UnitGetResponse = UnitAllDetail;
303
+
304
+ export interface UnitsGetResponse {
305
+ /** A list of Units
306
+ */
307
+ units: OrganisationUnitsGetResponse[];
308
+ }
309
+
310
+ export type UserAccountGetResponse = UserAccountDetail;
548
311
 
312
+ export type AssetDetailScope = (typeof AssetDetailScope)[keyof typeof AssetDetailScope];
549
313
 
550
314
  // eslint-disable-next-line @typescript-eslint/no-redeclare
551
- export const OrganisationAllDetailDefaultProductPrivacy = {
552
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
553
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
554
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
555
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
315
+ export const AssetDetailScope = {
316
+ USER: "USER",
317
+ PRODUCT: "PRODUCT",
318
+ UNIT: "UNIT",
319
+ ORGANISATION: "ORGANISATION",
320
+ GLOBAL: "GLOBAL",
556
321
  } as const;
557
322
 
558
- export interface OrganisationAllDetail {
559
- /** Whether the user making the API call is a member of the Unit */
560
- caller_is_member: boolean;
561
- /** The Organisation's unique ID */
323
+ export interface AssetDetail {
324
+ creator: string;
562
325
  id: string;
563
- /** The Organisation's name */
564
326
  name: string;
565
- /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
566
- owner_id?: string;
567
- /** True if the Unit is private */
568
- private: boolean;
327
+ scope: AssetDetailScope;
328
+ scope_id: string;
329
+ secret: boolean;
330
+ disabled: boolean;
331
+ content: string;
569
332
  created: string;
570
- /** The Organisation's default product privacy setting */
571
- default_product_privacy: OrganisationAllDetailDefaultProductPrivacy;
572
- /** A list of users that are members of the Organisation */
573
- users: UserDetail[];
333
+ content_modified?: string;
334
+ description?: string;
335
+ merchants: MerchantDetail[];
574
336
  }
575
337
 
576
- /**
577
- * The kind of service that can use the Product
578
- */
579
- export type ProductTypeServiceKind = typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];
580
-
338
+ export type ProcessingChargesMerchantKind =
339
+ (typeof ProcessingChargesMerchantKind)[keyof typeof ProcessingChargesMerchantKind];
581
340
 
582
341
  // eslint-disable-next-line @typescript-eslint/no-redeclare
583
- export const ProductTypeServiceKind = {
584
- DATA_MANAGER: 'DATA_MANAGER',
585
- } as const;
342
+ export const ProcessingChargesMerchantKind = { DATA_MANAGER: "DATA_MANAGER" } as const;
586
343
 
587
- export interface ProductType {
588
- /** A product type, this is a unique string amongst all types known to the Account Server */
589
- type: string;
590
- /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */
591
- flavour?: string;
592
- /** The kind of service that can use the Product */
593
- service_kind?: ProductTypeServiceKind;
344
+ export interface ProcessingCharges {
345
+ merchant_name: string;
346
+ merchant_kind: ProcessingChargesMerchantKind;
347
+ merchant_api_hostname: string;
348
+ /** The date when the process stopped */
349
+ closed?: string;
350
+ /** True if no further change to the charges can occur. Typically True after the charge has been closed for a pre-configured period of time. */
351
+ final: boolean;
352
+ /** True if charges were received after the charge record was finalised */
353
+ post_final_charges?: boolean;
354
+ charge: ProcessingChargeItem;
594
355
  }
595
356
 
596
- export type ProductInstanceDetailCoins = {
597
- /** The number of coins used
598
- */
599
- used: number;
600
- };
601
-
602
- export interface ProductInstanceDetail {
603
- coins: ProductInstanceDetailCoins;
357
+ export interface ProcessingChargeItem {
358
+ /** The charge record number */
359
+ id: number;
360
+ /** The most recent sequence number for this charge */
361
+ sqn: number;
362
+ name?: string;
363
+ username: string;
364
+ /** The date and time of the processing charge */
365
+ timestamp: string;
366
+ /** The coin-cost of the storage */
367
+ coins: string;
368
+ additional_data?: ChargeAdditionalData;
604
369
  }
605
370
 
606
- /**
607
- * The Product Type flavour. Not all products have flavours
371
+ export interface StorageCharges {
372
+ num_items: number;
373
+ items: StorageChargeItem[];
374
+ }
608
375
 
609
- */
610
- export type ProductDetailFlavour = typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];
376
+ export interface StorageChargeItem {
377
+ item_number: number;
378
+ /** The date and time of the processing charge */
379
+ date: string;
380
+ /** The coin-cost of the storage */
381
+ coins: string;
382
+ /** The current burn rate, the approximate amount of coins you are currently consuming each day */
383
+ current_burn_rate?: string;
384
+ /** The date when the charges concluded */
385
+ closed?: string;
386
+ additional_data?: ChargeAdditionalData;
387
+ }
611
388
 
389
+ export interface ChargeAdditionalData {
390
+ [key: string]: unknown;
391
+ }
612
392
 
613
- // eslint-disable-next-line @typescript-eslint/no-redeclare
614
- export const ProductDetailFlavour = {
615
- EVALUATION: 'EVALUATION',
616
- BRONZE: 'BRONZE',
617
- SILVER: 'SILVER',
618
- GOLD: 'GOLD',
619
- } as const;
393
+ export interface ProductDmStorage {
394
+ product: ProductDetail;
395
+ organisation: OrganisationAllDetail;
396
+ unit: UnitAllDetail;
397
+ storage: ProductDmStorageDetail;
398
+ coins: ProductCoinsDetail;
399
+ /** True if the product can be (needs to be) claimed. */
400
+ claimable: boolean;
401
+ }
620
402
 
621
- /**
622
- * The Product Type
403
+ export interface ProductDmProjectTier {
404
+ product: ProductDetail;
405
+ organisation: OrganisationAllDetail;
406
+ unit: UnitAllDetail;
407
+ storage: ProductDmStorageDetail;
408
+ coins: ProductCoinsDetail;
409
+ instance: ProductInstanceDetail;
410
+ /** True if the product can be (needs to be) claimed. */
411
+ claimable: boolean;
412
+ claim?: ProductClaimDetail;
413
+ }
623
414
 
624
- */
625
- export type ProductDetailType = typeof ProductDetailType[keyof typeof ProductDetailType];
415
+ export type ProductDmStorageDetailSize = {
416
+ /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
417
+ peak: string;
418
+ /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
419
+ current: string;
420
+ /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */
421
+ unit_size: string;
422
+ /** The peak number of storage units used today */
423
+ units_used: number;
424
+ };
626
425
 
426
+ export type ProductDmStorageDetailCoins = {
427
+ /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */
428
+ used: number;
429
+ /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */
430
+ unit_cost: number;
431
+ };
627
432
 
628
- // eslint-disable-next-line @typescript-eslint/no-redeclare
629
- export const ProductDetailType = {
630
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
631
- DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
632
- } as const;
433
+ export interface ProductDmStorageDetail {
434
+ size: ProductDmStorageDetailSize;
435
+ coins: ProductDmStorageDetailCoins;
436
+ }
633
437
 
634
- export interface ProductDetail {
635
- /** The Product ID
636
- */
438
+ export interface ProductClaimDetail {
439
+ /** The service-specific ID that is using this Subscription
440
+ */
637
441
  id: string;
638
- created: string;
639
- /** The Product Type
640
- */
641
- type: ProductDetailType;
642
- /** The Product Type flavour. Not all products have flavours
643
- */
644
- flavour?: ProductDetailFlavour;
645
- /** The name of the Product
646
- */
442
+ /** A name for the service-specific ID
443
+ */
647
444
  name?: string;
648
445
  }
649
446
 
@@ -672,441 +469,651 @@ export interface ProductCoinsDetail {
672
469
  remaining_days: number;
673
470
  }
674
471
 
675
- export interface ProductClaimDetail {
676
- /** The service-specific ID that is using this Subscription
677
- */
678
- id: string;
679
- /** A name for the service-specific ID
472
+ /**
473
+ * The Product Type
474
+
680
475
  */
681
- name?: string;
682
- }
476
+ export type ProductDetailType = (typeof ProductDetailType)[keyof typeof ProductDetailType];
683
477
 
684
- export type ProductDmStorageDetailCoins = {
685
- /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */
686
- used: number;
687
- /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */
688
- unit_cost: number;
689
- };
478
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
479
+ export const ProductDetailType = {
480
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
481
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
482
+ } as const;
690
483
 
691
- export type ProductDmStorageDetailSize = {
692
- /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
693
- peak: string;
694
- /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
695
- current: string;
696
- /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */
697
- unit_size: string;
698
- /** The peak number of storage units used today */
699
- units_used: number;
700
- };
484
+ /**
485
+ * The Product Type flavour. Not all products have flavours
701
486
 
702
- export interface ProductDmStorageDetail {
703
- size: ProductDmStorageDetailSize;
704
- coins: ProductDmStorageDetailCoins;
705
- }
487
+ */
488
+ export type ProductDetailFlavour = (typeof ProductDetailFlavour)[keyof typeof ProductDetailFlavour];
706
489
 
707
- export interface ProductDmProjectTier {
708
- product: ProductDetail;
709
- organisation: OrganisationAllDetail;
710
- unit: UnitAllDetail;
711
- storage: ProductDmStorageDetail;
712
- coins: ProductCoinsDetail;
713
- instance: ProductInstanceDetail;
714
- /** True if the product can be (needs to be) claimed. */
715
- claimable: boolean;
716
- claim?: ProductClaimDetail;
717
- }
490
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
491
+ export const ProductDetailFlavour = {
492
+ EVALUATION: "EVALUATION",
493
+ BRONZE: "BRONZE",
494
+ SILVER: "SILVER",
495
+ GOLD: "GOLD",
496
+ } as const;
718
497
 
719
- export interface ProductDmStorage {
720
- product: ProductDetail;
721
- organisation: OrganisationAllDetail;
722
- unit: UnitAllDetail;
723
- storage: ProductDmStorageDetail;
724
- coins: ProductCoinsDetail;
725
- /** True if the product can be (needs to be) claimed. */
726
- claimable: boolean;
498
+ export interface ProductDetail {
499
+ /** The Product ID
500
+ */
501
+ id: string;
502
+ created: string;
503
+ /** The Product Type
504
+ */
505
+ type: ProductDetailType;
506
+ /** The Product Type flavour. Not all products have flavours
507
+ */
508
+ flavour?: ProductDetailFlavour;
509
+ /** The name of the Product
510
+ */
511
+ name?: string;
727
512
  }
728
513
 
729
- export interface ChargeAdditionalData { [key: string]: unknown }
514
+ export type ProductInstanceDetailCoins = {
515
+ /** The number of coins used
516
+ */
517
+ used: number;
518
+ };
730
519
 
731
- export interface StorageChargeItem {
732
- item_number: number;
733
- /** The date and time of the processing charge */
734
- date: string;
735
- /** The coin-cost of the storage */
736
- coins: string;
737
- /** The current burn rate, the approximate amount of coins you are currently consuming each day */
738
- current_burn_rate?: string;
739
- /** The date when the charges concluded */
740
- closed?: string;
741
- additional_data?: ChargeAdditionalData;
520
+ export interface ProductInstanceDetail {
521
+ coins: ProductInstanceDetailCoins;
742
522
  }
743
523
 
744
- export interface StorageCharges {
745
- num_items: number;
746
- items: StorageChargeItem[];
747
- }
524
+ /**
525
+ * The kind of service that can use the Product
526
+ */
527
+ export type ProductTypeServiceKind =
528
+ (typeof ProductTypeServiceKind)[keyof typeof ProductTypeServiceKind];
748
529
 
749
- export interface ProcessingChargeItem {
750
- /** The charge record number */
751
- id: number;
752
- /** The most recent sequence number for this charge */
753
- sqn: number;
754
- name?: string;
755
- username: string;
756
- /** The date and time of the processing charge */
757
- timestamp: string;
758
- /** The coin-cost of the storage */
759
- coins: string;
760
- additional_data?: ChargeAdditionalData;
761
- }
530
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
531
+ export const ProductTypeServiceKind = { DATA_MANAGER: "DATA_MANAGER" } as const;
762
532
 
763
- export type ProcessingChargesMerchantKind = typeof ProcessingChargesMerchantKind[keyof typeof ProcessingChargesMerchantKind];
533
+ export interface ProductType {
534
+ /** A product type, this is a unique string amongst all types known to the Account Server */
535
+ type: string;
536
+ /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */
537
+ flavour?: string;
538
+ /** The kind of service that can use the Product */
539
+ service_kind?: ProductTypeServiceKind;
540
+ }
764
541
 
542
+ /**
543
+ * The Organisation's default product privacy setting
544
+ */
545
+ export type OrganisationAllDetailDefaultProductPrivacy =
546
+ (typeof OrganisationAllDetailDefaultProductPrivacy)[keyof typeof OrganisationAllDetailDefaultProductPrivacy];
765
547
 
766
548
  // eslint-disable-next-line @typescript-eslint/no-redeclare
767
- export const ProcessingChargesMerchantKind = {
768
- DATA_MANAGER: 'DATA_MANAGER',
549
+ export const OrganisationAllDetailDefaultProductPrivacy = {
550
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
551
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
552
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
553
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
769
554
  } as const;
770
555
 
771
- export interface ProcessingCharges {
772
- merchant_name: string;
773
- merchant_kind: ProcessingChargesMerchantKind;
774
- merchant_api_hostname: string;
775
- /** The date when the process stopped */
776
- closed?: string;
777
- /** True if no further change to the charges can occur. Typically True after the charge has been closed for a pre-configured period of time. */
778
- final: boolean;
779
- /** True if charges were received after the charge record was finalised */
780
- post_final_charges?: boolean;
781
- charge: ProcessingChargeItem;
556
+ export interface OrganisationAllDetail {
557
+ /** Whether the user making the API call is a member of the Unit */
558
+ caller_is_member: boolean;
559
+ /** The Organisation's unique ID */
560
+ id: string;
561
+ /** The Organisation's name */
562
+ name: string;
563
+ /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
564
+ owner_id?: string;
565
+ /** True if the Unit is private */
566
+ private: boolean;
567
+ created: string;
568
+ /** The Organisation's default product privacy setting */
569
+ default_product_privacy: OrganisationAllDetailDefaultProductPrivacy;
570
+ /** A list of users that are members of the Organisation */
571
+ users: UserDetail[];
782
572
  }
783
573
 
784
- export type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];
785
-
574
+ /**
575
+ * The Organisation's default product privacy setting
576
+ */
577
+ export type OrganisationDetailDefaultProductPrivacy =
578
+ (typeof OrganisationDetailDefaultProductPrivacy)[keyof typeof OrganisationDetailDefaultProductPrivacy];
786
579
 
787
580
  // eslint-disable-next-line @typescript-eslint/no-redeclare
788
- export const AssetDetailScope = {
789
- USER: 'USER',
790
- PRODUCT: 'PRODUCT',
791
- UNIT: 'UNIT',
792
- ORGANISATION: 'ORGANISATION',
793
- GLOBAL: 'GLOBAL',
581
+ export const OrganisationDetailDefaultProductPrivacy = {
582
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
583
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
584
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
585
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
794
586
  } as const;
795
587
 
796
- export interface AssetDetail {
797
- creator: string;
588
+ export interface OrganisationDetail {
589
+ /** Whether the user making the API call is a member of the Unit */
590
+ caller_is_member: boolean;
591
+ /** The Organisation's unique ID */
798
592
  id: string;
593
+ /** The Organisation's name */
799
594
  name: string;
800
- scope: AssetDetailScope;
801
- scope_id: string;
802
- secret: boolean;
803
- disabled: boolean;
804
- content: string;
595
+ /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
596
+ owner_id?: string;
597
+ /** True if the Unit is private */
598
+ private: boolean;
805
599
  created: string;
806
- content_modified?: string;
807
- description?: string;
600
+ /** The Organisation's default product privacy setting */
601
+ default_product_privacy: OrganisationDetailDefaultProductPrivacy;
602
+ }
603
+
604
+ export interface MerchantsGetResponse {
605
+ count?: number;
606
+ /** The list of known Merchants
607
+ */
808
608
  merchants: MerchantDetail[];
809
609
  }
810
610
 
811
- export type UserAccountGetResponse = UserAccountDetail;
611
+ export type MerchantGetResponse = MerchantDetail;
812
612
 
813
- export interface UnitsGetResponse {
814
- /** A list of Units
613
+ /**
614
+ * The kind of Service
815
615
  */
816
- units: OrganisationUnitsGetResponse[];
817
- }
616
+ export type MerchantDetailKind = (typeof MerchantDetailKind)[keyof typeof MerchantDetailKind];
818
617
 
819
- export type UnitGetResponse = UnitAllDetail;
618
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
619
+ export const MerchantDetailKind = { DATA_MANAGER: "DATA_MANAGER" } as const;
820
620
 
821
- export interface UnitProductPostResponse {
822
- /** The Product's unique ID */
823
- id: string;
621
+ export interface MerchantDetail {
622
+ /** The unique ID of the Service */
623
+ id: number;
624
+ created: string;
625
+ /** The kind of Service */
626
+ kind: MerchantDetailKind;
627
+ /** The name assigned to the Service */
628
+ name: string;
629
+ /** The hostname used by the Service */
630
+ api_hostname: string;
824
631
  }
825
632
 
826
633
  /**
827
- * The type of charge
634
+ * The Unit's default product privacy setting
828
635
  */
829
- export type ChargeSummaryType = typeof ChargeSummaryType[keyof typeof ChargeSummaryType];
830
-
636
+ export type UnitAllDetailDefaultProductPrivacy =
637
+ (typeof UnitAllDetailDefaultProductPrivacy)[keyof typeof UnitAllDetailDefaultProductPrivacy];
831
638
 
832
639
  // eslint-disable-next-line @typescript-eslint/no-redeclare
833
- export const ChargeSummaryType = {
834
- PROCESSING: 'PROCESSING',
835
- STORAGE: 'STORAGE',
640
+ export const UnitAllDetailDefaultProductPrivacy = {
641
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
642
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
643
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
644
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
836
645
  } as const;
837
646
 
838
- export interface ChargeSummary {
839
- /** The type of charge */
840
- type: ChargeSummaryType;
841
- /** The cost, in coins of the charge */
842
- coins: string;
647
+ export interface UnitAllDetail {
648
+ /** Whether the user making the API call is a member of the Unit */
649
+ caller_is_member: boolean;
650
+ /** The Unit's unique identity */
651
+ id: string;
652
+ /** The Unit's name */
653
+ name: string;
654
+ /** The Unit's owner (a username) */
655
+ owner_id: string;
656
+ /** True if the Unit is private */
657
+ private: boolean;
658
+ created: string;
659
+ /** The Unit's billing day */
660
+ billing_day: number;
661
+ /** The Unit's default product privacy setting */
662
+ default_product_privacy: UnitAllDetailDefaultProductPrivacy;
663
+ /** A list of users that are members of the Unit */
664
+ users: UserDetail[];
843
665
  }
844
666
 
845
- export interface UnitProductChargeSummary {
846
- product_id: string;
847
- product_type: string;
848
- charges: ChargeSummary[];
849
- }
667
+ /**
668
+ * The Unit's default product privacy setting
669
+ */
670
+ export type UnitDetailDefaultProductPrivacy =
671
+ (typeof UnitDetailDefaultProductPrivacy)[keyof typeof UnitDetailDefaultProductPrivacy];
850
672
 
851
- export interface UnitChargeSummary {
852
- charges: ChargeSummary[];
853
- }
673
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
674
+ export const UnitDetailDefaultProductPrivacy = {
675
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
676
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
677
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
678
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
679
+ } as const;
854
680
 
855
- export interface UnitChargesGetResponse {
681
+ export interface UnitDetail {
856
682
  /** Whether the user making the API call is a member of the Unit */
857
683
  caller_is_member: boolean;
858
- unit_id: string;
859
- name?: string;
684
+ /** The Unit's unique identity */
685
+ id: string;
686
+ /** The Unit's name */
687
+ name: string;
860
688
  /** The Unit's owner (a username) */
861
689
  owner_id: string;
862
690
  /** True if the Unit is private */
863
691
  private: boolean;
864
692
  created: string;
865
- coins: string;
866
- count: number;
867
- /**
868
- * @minimum 1
869
- * @maximum 28
870
- */
693
+ /** The Unit's billing day */
871
694
  billing_day: number;
872
- /** The start of the charge period */
873
- from: string;
874
- /** The date where of first day after the charge period */
875
- until: string;
876
- summary: UnitChargeSummary;
877
- products: UnitProductChargeSummary[];
695
+ /** The Unit's default product privacy setting */
696
+ default_product_privacy: UnitDetailDefaultProductPrivacy;
878
697
  }
879
698
 
880
- /**
881
- * The Unit's Product
882
- */
883
- export type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;
884
-
885
- export interface ProductUnitGetResponse {
886
- /** The Unit's Product */
887
- product: ProductUnitGetResponseProduct;
699
+ export interface UserAccountDetail {
700
+ user: UserDetail;
701
+ /** Whether the caller has admin privilege */
702
+ caller_has_admin_privilege: boolean;
703
+ /** The roles assigned to the user recognised by the Account Server */
704
+ account_server_roles: string[];
888
705
  }
889
706
 
890
- export interface ProductsGetTypesResponse {
891
- /** The number of Product Types */
892
- count: number;
893
- /** All the Product Types you have access to */
894
- product_types: ProductType[];
707
+ export interface UserDetail {
708
+ /** The user identity (username) */
709
+ id: string;
895
710
  }
896
711
 
897
- export type ProductsGetDefaultStorageCostDefaultStorageCost = {
898
- cost: string;
899
- units: string;
900
- description: string;
712
+ export type AssetPatchBodyBody = {
713
+ /** A file containing the content for the asset. You must provide a value here or in content_string */
714
+ content_file?: Blob;
715
+ /** The textual content of the asset. You must provide a value here or in content_file */
716
+ content_string?: string;
717
+ /** An optional description for the Asset */
718
+ description?: string;
901
719
  };
902
720
 
903
- export interface ProductsGetDefaultStorageCost {
904
- default_storage_cost: ProductsGetDefaultStorageCostDefaultStorageCost;
905
- }
721
+ /**
722
+ * An enumeration of the scope of the asset. This can be one of `USER`, `PRODUCT`, `UNIT`, `ORGANISATION`, or `GLOBAL`. Assets that are not `GLOBAL` need a scope ID.
723
+ */
724
+ export type AssetPostBodyBodyScope =
725
+ (typeof AssetPostBodyBodyScope)[keyof typeof AssetPostBodyBodyScope];
906
726
 
907
- export type ProductsGetResponseProductsItem = ProductDmStorage | ProductDmProjectTier;
727
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
728
+ export const AssetPostBodyBodyScope = {
729
+ USER: "USER",
730
+ PRODUCT: "PRODUCT",
731
+ UNIT: "UNIT",
732
+ ORGANISATION: "ORGANISATION",
733
+ GLOBAL: "GLOBAL",
734
+ } as const;
908
735
 
909
- export interface ProductsGetResponse {
910
- count: number;
911
- /** All the Products you have access to */
912
- products: ProductsGetResponseProductsItem[];
913
- }
736
+ export type AssetPostBodyBody = {
737
+ /**
738
+ * The name of the asset. This must be unique within its scope. For example, only one asset can be called "asset-1" within a given `UNIT`. Asset names must be valid RFC 1123 Label Names
739
+ * @maxLength 80
740
+ * @pattern ^[a-z0-9-]{1,63}$
741
+ */
742
+ name: string;
743
+ /** A file containing the content for the asset. You must provide a value here or in **content_string** but not both */
744
+ content_file?: Blob;
745
+ /** The textual content of the asset. You must provide a value here or in **content_file** but not both */
746
+ content_string?: string;
747
+ /** An enumeration of the scope of the asset. This can be one of `USER`, `PRODUCT`, `UNIT`, `ORGANISATION`, or `GLOBAL`. Assets that are not `GLOBAL` need a scope ID. */
748
+ scope: AssetPostBodyBodyScope;
749
+ /** The unique identity based on the Scope of the asset. For example, this will be the Unit ID if it's a UNIT. A scope_id is required if the scope is USER as it will be automatically set to your username. Global assets do not have a scope. */
750
+ scope_id?: string;
751
+ /** Is this a secret asset? Secret assets are not revealed in a subsequent **GET** but are revealed to merchants they are connected to. */
752
+ secret: boolean;
753
+ /** An optional description for the Asset */
754
+ description?: string;
755
+ };
756
+
757
+ export type EventStreamPostBodyBodyFormat =
758
+ (typeof EventStreamPostBodyBodyFormat)[keyof typeof EventStreamPostBodyBodyFormat];
759
+
760
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
761
+ export const EventStreamPostBodyBodyFormat = {
762
+ PROTOCOL_STRING: "PROTOCOL_STRING",
763
+ JSON_STRING: "JSON_STRING",
764
+ } as const;
914
765
 
915
- export type ProductChargesGetResponseProductType = typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];
766
+ export type EventStreamPostBodyBody = { format?: EventStreamPostBodyBodyFormat };
916
767
 
768
+ /**
769
+ * The default product privacy setting for the Organisation
770
+ */
771
+ export type OrganisationPostBodyBodyDefaultProductPrivacy =
772
+ (typeof OrganisationPostBodyBodyDefaultProductPrivacy)[keyof typeof OrganisationPostBodyBodyDefaultProductPrivacy];
917
773
 
918
774
  // eslint-disable-next-line @typescript-eslint/no-redeclare
919
- export const ProductChargesGetResponseProductType = {
920
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
921
- DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
775
+ export const OrganisationPostBodyBodyDefaultProductPrivacy = {
776
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
777
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
778
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
779
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
922
780
  } as const;
923
781
 
924
- export interface ProductChargesGetResponse {
925
- product_id: string;
926
- product_type: ProductChargesGetResponseProductType;
782
+ export type OrganisationPostBodyBody = {
927
783
  /**
784
+ * The name of the organisation
785
+ * @maxLength 80
786
+ */
787
+ name: string;
788
+ /** The name of the organisation owner. A user ID */
789
+ owner: string;
790
+ /** The default product privacy setting for the Organisation */
791
+ default_product_privacy?: OrganisationPostBodyBodyDefaultProductPrivacy;
792
+ };
793
+
794
+ export type PersonalUnitPutBodyBody = {
795
+ /**
796
+ * The day you would like to be billed for the Unit's Products (a value from 1 and 28)
928
797
  * @minimum 1
929
798
  * @maximum 28
930
799
  */
931
800
  billing_day: number;
932
- /** True if the product can be (needs to be) claimed. */
933
- claimable: boolean;
934
- claim?: ProductClaimDetail;
935
- count: number;
936
- /** The start of the charge period */
937
- from: string;
938
- /** The date where of first day after the charge period */
939
- until: string;
940
- /** The total number of coins consumed by this product for the invoice period */
941
- coins: string;
942
- processing_charges: ProcessingCharges[];
943
- storage_charges: StorageCharges;
944
- }
801
+ };
945
802
 
946
- export type OrganisationGetResponse = OrganisationAllDetail;
803
+ /**
804
+ * The default product privacy setting for products in the unit. Whether the privacy can be honoured will depend on the organisation's value
805
+ */
806
+ export type OrganisationUnitPostBodyBodyDefaultProductPrivacy =
807
+ (typeof OrganisationUnitPostBodyBodyDefaultProductPrivacy)[keyof typeof OrganisationUnitPostBodyBodyDefaultProductPrivacy];
947
808
 
948
- export interface OrganisationsGetResponse {
949
- count: number;
950
- /** A list of Organisations */
951
- organisations: OrganisationAllDetail[];
952
- }
809
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
810
+ export const OrganisationUnitPostBodyBodyDefaultProductPrivacy = {
811
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
812
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
813
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
814
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
815
+ } as const;
953
816
 
954
- export interface OrganisationUnitChargeSummary {
955
- unit_id: string;
817
+ export type OrganisationUnitPostBodyBody = {
818
+ /**
819
+ * The name of the unit
820
+ * @maxLength 80
821
+ */
956
822
  name: string;
957
823
  /**
824
+ * The day you would like to be billed for the Unit's Products (a value from 1 and 28)
958
825
  * @minimum 1
959
826
  * @maximum 28
960
827
  */
961
828
  billing_day: number;
962
- /** The start of the charge period */
963
- from: string;
964
- /** The date where of first day after the charge period */
965
- until: string;
966
- summary: ChargeSummary[];
967
- }
829
+ /** The default product privacy setting for products in the unit. Whether the privacy can be honoured will depend on the organisation's value */
830
+ default_product_privacy?: OrganisationUnitPostBodyBodyDefaultProductPrivacy;
831
+ };
968
832
 
969
- export interface OrganisationChargesGetResponse {
970
- organisation_id: string;
971
- name: string;
972
- coins: string;
973
- summary: ChargeSummary[];
974
- unit_charges: OrganisationUnitChargeSummary[];
975
- }
833
+ /**
834
+ * The new default **Product** privacy applied to all products that belong to this Organisation. Privacy is also controlled at the **Unit** level. As an example the Organisation level privacy can be `DEFAULT_PRIVATE`, but the unit can declare its Products to be `ALWAYS_PRIVATE`.
835
+
836
+ Whether the privacy can be honoured will depend on the value in any of the organisation's existing units
837
+ */
838
+ export type OrganisationPatchBodyBodyDefaultProductPrivacy =
839
+ (typeof OrganisationPatchBodyBodyDefaultProductPrivacy)[keyof typeof OrganisationPatchBodyBodyDefaultProductPrivacy];
840
+
841
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
842
+ export const OrganisationPatchBodyBodyDefaultProductPrivacy = {
843
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
844
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
845
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
846
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
847
+ } as const;
848
+
849
+ export type OrganisationPatchBodyBody = {
850
+ /** The new name for the Organisational */
851
+ name?: string;
852
+ /** The new default **Product** privacy applied to all products that belong to this Organisation. Privacy is also controlled at the **Unit** level. As an example the Organisation level privacy can be `DEFAULT_PRIVATE`, but the unit can declare its Products to be `ALWAYS_PRIVATE`.
853
+
854
+ Whether the privacy can be honoured will depend on the value in any of the organisation's existing units */
855
+ default_product_privacy?: OrganisationPatchBodyBodyDefaultProductPrivacy;
856
+ };
976
857
 
977
- export interface OrganisationUnitsGetResponse {
978
- count?: number;
979
- organisation: OrganisationAllDetail;
980
- /** A list of Units
858
+ /**
859
+ * The new default **Product** privacy applied to all products that belong to this Unit. Privacy is also controlled at the **Organisation** level. As an example, the Unit can declare its Products to be `DEFAULT_PRIVATE`, but the Organisation can declare its value to be `DEFAULT_PUBLIC`.
860
+
861
+ Whether the privacy can be honoured will depend on the organisation's value
981
862
  */
982
- units: UnitAllDetail[];
983
- }
863
+ export type UnitPatchBodyBodyDefaultProductPrivacy =
864
+ (typeof UnitPatchBodyBodyDefaultProductPrivacy)[keyof typeof UnitPatchBodyBodyDefaultProductPrivacy];
984
865
 
985
- export interface OrganisationChargeSummary {
986
- organisation_id: string;
987
- name: string;
988
- summary: ChargeSummary[];
989
- }
866
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
867
+ export const UnitPatchBodyBodyDefaultProductPrivacy = {
868
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
869
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
870
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
871
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
872
+ } as const;
990
873
 
991
- export interface PersonalUnitPutResponse {
992
- /** The unit's Organisation. Used to identify the Default organisation */
993
- organisation_id: string;
994
- /** The unit's unique ID */
995
- id: string;
996
- }
874
+ export type UnitPatchBodyBody = {
875
+ /** The new name for the Unit */
876
+ name?: string;
877
+ /** The new default **Product** privacy applied to all products that belong to this Unit. Privacy is also controlled at the **Organisation** level. As an example, the Unit can declare its Products to be `DEFAULT_PRIVATE`, but the Organisation can declare its value to be `DEFAULT_PUBLIC`.
997
878
 
998
- export interface OrganisationUnitPostResponse {
999
- /** The unit's unique ID */
1000
- id: string;
1001
- }
879
+ Whether the privacy can be honoured will depend on the organisation's value */
880
+ default_product_privacy?: UnitPatchBodyBodyDefaultProductPrivacy;
881
+ };
1002
882
 
1003
883
  /**
1004
- * The Organisation's default product privacy setting
884
+ * The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
885
+
886
+ Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products
1005
887
  */
1006
- export type OrganisationGetDefaultResponseDefaultProductPrivacy = typeof OrganisationGetDefaultResponseDefaultProductPrivacy[keyof typeof OrganisationGetDefaultResponseDefaultProductPrivacy];
888
+ export type UnitProductPostBodyBodyType =
889
+ (typeof UnitProductPostBodyBodyType)[keyof typeof UnitProductPostBodyBodyType];
1007
890
 
891
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
892
+ export const UnitProductPostBodyBodyType = {
893
+ DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: "DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION",
894
+ DATA_MANAGER_STORAGE_SUBSCRIPTION: "DATA_MANAGER_STORAGE_SUBSCRIPTION",
895
+ } as const;
896
+
897
+ /**
898
+ * The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products
899
+ */
900
+ export type UnitProductPostBodyBodyFlavour =
901
+ (typeof UnitProductPostBodyBodyFlavour)[keyof typeof UnitProductPostBodyBodyFlavour];
1008
902
 
1009
903
  // eslint-disable-next-line @typescript-eslint/no-redeclare
1010
- export const OrganisationGetDefaultResponseDefaultProductPrivacy = {
1011
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
1012
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
1013
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
1014
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
904
+ export const UnitProductPostBodyBodyFlavour = {
905
+ EVALUATION: "EVALUATION",
906
+ BRONZE: "BRONZE",
907
+ SILVER: "SILVER",
908
+ GOLD: "GOLD",
1015
909
  } as const;
1016
910
 
1017
- export interface OrganisationGetDefaultResponse {
1018
- /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
1019
- caller_is_member?: boolean;
1020
- /** The Default Organisation ID
911
+ export type UnitProductPostBodyBody = {
912
+ /**
913
+ * The name you want to give the Product
914
+ * @maxLength 80
915
+ */
916
+ name: string;
917
+ /** The Type of Product. Storage subscriptions require an **Allowance** to be defined and the **Flavour** must not be provided.
918
+
919
+ Project Tier subscriptions have built-in allowances and Limits so you must not provide values for these for these products */
920
+ type: UnitProductPostBodyBodyType;
921
+ /** The Flavour of the Product. Used only for Project Tier Products. Do not set this for Storage products */
922
+ flavour?: UnitProductPostBodyBodyFlavour;
923
+ /**
924
+ * The Product's coin allowance. You must provide this for Storage products but you must not provide a value for Project Tier Products
925
+ * @minimum 1
926
+ */
927
+ allowance?: number;
928
+ /**
929
+ * The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. You can provide this for Storage products but you must not provide a value for Project Tier Products
930
+ * @minimum 1
931
+ */
932
+ limit?: number;
933
+ };
934
+
935
+ export type ProductPatchBodyBody = {
936
+ /**
937
+ * The name you want to give the Product
938
+ * @maxLength 80
939
+ */
940
+ name?: string;
941
+ /**
942
+ * The Product's built-in coin allowance. Product allowances cannot be reduced
943
+ * @minimum 1
944
+ */
945
+ allowance?: number;
946
+ /**
947
+ * The Product's built-in coin limit. If set it must not be less than the allowance. If not set the allowance is used. The existing product limit cannot be reduced
948
+ * @minimum 1
949
+ */
950
+ limit?: number;
951
+ };
952
+
953
+ /**
954
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
1021
955
  */
1022
- id?: string;
1023
- /** The Default Organisation Name
956
+ export type QPbpParameter = number;
957
+
958
+ /**
959
+ * An Organisation Identity
1024
960
  */
1025
- name?: string;
1026
- /** True if the Organisation is private. The Default organisation is always public, although it does not contain a membership (unless you're admin) and only houses Personal Units
961
+ export type QOrgIdParameter = string;
962
+
963
+ /**
964
+ * A Merchant Identity
1027
965
  */
1028
- private?: boolean;
1029
- created?: string;
1030
- /** The Organisation's default product privacy setting */
1031
- default_product_privacy?: OrganisationGetDefaultResponseDefaultProductPrivacy;
1032
- }
966
+ export type QMIdParameter = number;
1033
967
 
1034
- export interface UsersGetResponse {
1035
- count: number;
1036
- organisation?: OrganisationDetail;
1037
- unit?: UnitDetail;
1038
- /** The list of Organisation Users
968
+ /**
969
+ * An object name
1039
970
  */
1040
- users: UserDetail[];
1041
- }
971
+ export type QNameParameter = string;
1042
972
 
1043
- export interface OrganisationPostResponse {
1044
- /** The Organisation's unique ID */
1045
- id: string;
1046
- }
973
+ /**
974
+ * A Unit Identity
975
+ */
976
+ export type QUnitIdParameter = string;
1047
977
 
1048
- export interface StateGetVersionResponse {
1049
- /** The Account Server version. This is guaranteed to be a valid semantic version for official (tagged) images. The version value format for unofficial images is a string but otherwise undefined
978
+ /**
979
+ * A Product Identity
1050
980
  */
1051
- version: string;
1052
- }
981
+ export type QProductIdParameter = string;
1053
982
 
1054
983
  /**
1055
- * The Event Stream protocol, used to inform the client how to connect to given locations and handle events. At the moment the AS only supports web-sockets.
984
+ * A User Identity
1056
985
  */
1057
- export type EventStreamVersionGetResponseProtocol = typeof EventStreamVersionGetResponseProtocol[keyof typeof EventStreamVersionGetResponseProtocol];
986
+ export type QUserIdParameter = string;
1058
987
 
988
+ /**
989
+ * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
990
+ */
991
+ export type QFromParameter = string;
1059
992
 
1060
- // eslint-disable-next-line @typescript-eslint/no-redeclare
1061
- export const EventStreamVersionGetResponseProtocol = {
1062
- SERVICE_NOT_PRESENT: 'SERVICE_NOT_PRESENT',
1063
- WEBSOCKET: 'WEBSOCKET',
1064
- } as const;
993
+ /**
994
+ * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
995
+ */
996
+ export type QUntilParameter = string;
1065
997
 
1066
- export interface EventStreamVersionGetResponse {
1067
- /** The EventStream implementation version */
1068
- version: string;
1069
- /** The Event Stream protocol, used to inform the client how to connect to given locations and handle events. At the moment the AS only supports web-sockets. */
1070
- protocol: EventStreamVersionGetResponseProtocol;
1071
- /** The name of the Event Stream implementation, often used to identify the service origin and implementation. */
1072
- name: string;
1073
- }
998
+ export type GetChargesParams = {
999
+ /**
1000
+ * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
1001
+ */
1002
+ from?: QFromParameter;
1003
+ /**
1004
+ * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
1005
+ */
1006
+ until?: QUntilParameter;
1007
+ /**
1008
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
1009
+ * @minimum -23
1010
+ * @maximum 0
1011
+ */
1012
+ pbp?: QPbpParameter;
1013
+ };
1074
1014
 
1075
- export interface EventStreamGetPostResponse {
1076
- /** The EventStream ID */
1077
- id: number;
1078
- /** The Event Stream location. This will be a URL where events can be fetched. The protocol is typically a WebSocket, but the protocol is defined by the specific Event Stream Service that has been deployed. */
1079
- location: string;
1080
- /** The Event Stream format. */
1081
- format: string;
1082
- }
1015
+ export type GetOrganisationChargesParams = {
1016
+ /**
1017
+ * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
1018
+ */
1019
+ from?: QFromParameter;
1020
+ /**
1021
+ * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
1022
+ */
1023
+ until?: QUntilParameter;
1024
+ /**
1025
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
1026
+ * @minimum -23
1027
+ * @maximum 0
1028
+ */
1029
+ pbp?: QPbpParameter;
1030
+ };
1083
1031
 
1084
- export interface ChargesGetResponse {
1085
- coins: string;
1086
- count: number;
1087
- summary: ChargeSummary[];
1088
- organisation_charges: OrganisationChargeSummary[];
1089
- }
1032
+ export type GetProductChargesParams = {
1033
+ /**
1034
+ * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
1035
+ */
1036
+ from?: QFromParameter;
1037
+ /**
1038
+ * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
1039
+ */
1040
+ until?: QUntilParameter;
1041
+ /**
1042
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
1043
+ * @minimum -23
1044
+ * @maximum 0
1045
+ */
1046
+ pbp?: QPbpParameter;
1047
+ };
1090
1048
 
1091
- export interface AssetPostResponse {
1092
- /** The Asset ID
1093
- */
1094
- id: string;
1095
- }
1049
+ export type GetUnitChargesParams = {
1050
+ /**
1051
+ * A date from which to retrieve assets. Any asset that occurs on ar after this date will be returned. UTC is assumed if no timezone is provided
1052
+ */
1053
+ from?: QFromParameter;
1054
+ /**
1055
+ * A date where assets prior to this will be returned. Any asset that occurs prior this date will be returned. UTC is assumed if no timezone is provided
1056
+ */
1057
+ until?: QUntilParameter;
1058
+ /**
1059
+ * A charge Prior Billing Period, 0 implies "current" and -23 is for the period 23 months ago.
1060
+ * @minimum -23
1061
+ * @maximum 0
1062
+ */
1063
+ pbp?: QPbpParameter;
1064
+ };
1096
1065
 
1097
- export interface AssetGetResponse {
1098
- /** A list of Assets
1099
- */
1100
- assets: AssetDetail[];
1101
- /** The number of Assets returned
1102
- */
1103
- count: number;
1104
- }
1066
+ export type GetOrganisationsParams = {
1067
+ /**
1068
+ * An object name
1069
+ */
1070
+ name?: QNameParameter;
1071
+ };
1105
1072
 
1106
- export type AssetGetByIdResponse = AssetDetail;
1073
+ export type GetUnitsParams = {
1074
+ /**
1075
+ * An object name
1076
+ */
1077
+ name?: QNameParameter;
1078
+ };
1107
1079
 
1108
- export interface AsError {
1109
- /** Brief error text that can be presented to the user */
1110
- error: string;
1111
- }
1080
+ export type GetAssetParams = {
1081
+ /**
1082
+ * A User Identity
1083
+ * @minLength 3
1084
+ * @maxLength 80
1085
+ * @pattern ^\w(?:\w*(?:[@.-]\w+)?)*$
1086
+ */
1087
+ user_id?: QUserIdParameter;
1088
+ /**
1089
+ * A Product Identity
1090
+ * @pattern ^product-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
1091
+ */
1092
+ product_id?: QProductIdParameter;
1093
+ /**
1094
+ * A Unit Identity
1095
+ * @pattern ^unit-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
1096
+ */
1097
+ unit_id?: QUnitIdParameter;
1098
+ /**
1099
+ * An Organisation Identity
1100
+ * @pattern ^org-[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$
1101
+ */
1102
+ org_id?: QOrgIdParameter;
1103
+ };
1104
+
1105
+ export type AttachAssetParams = {
1106
+ /**
1107
+ * A Merchant Identity
1108
+ * @minimum 1
1109
+ */
1110
+ m_id?: QMIdParameter;
1111
+ };
1112
1112
 
1113
+ export type DetachAssetParams = {
1114
+ /**
1115
+ * A Merchant Identity
1116
+ * @minimum 1
1117
+ */
1118
+ m_id?: QMIdParameter;
1119
+ };