@squonk/account-server-client 4.2.5 → 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 +44 -44
  24. package/event-stream/event-stream.d.ts +44 -44
  25. package/event-stream/event-stream.js +58 -66
  26. package/event-stream/event-stream.js.map +1 -1
  27. package/index.cjs +49 -58
  28. package/index.cjs.map +1 -1
  29. package/index.d.cts +783 -765
  30. package/index.d.ts +783 -765
  31. package/index.js +48 -57
  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 +862 -860
  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 +530 -344
  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,653 +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;
76
+ version: string;
77
+ }
249
78
 
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`.
79
+ export interface OrganisationPostResponse {
80
+ /** The Organisation's unique ID */
81
+ id: string;
82
+ }
254
83
 
255
- Whether the privacy can be honoured will depend on the organisation's value */
256
- default_product_privacy?: UnitPatchBodyBodyDefaultProductPrivacy;
257
- };
84
+ export interface UsersGetResponse {
85
+ count: number;
86
+ organisation?: OrganisationDetail;
87
+ unit?: UnitDetail;
88
+ /** The list of Organisation Users
89
+ */
90
+ users: UserDetail[];
91
+ }
258
92
 
259
93
  /**
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
94
+ * The Organisation's default product privacy setting
263
95
  */
264
- export type OrganisationPatchBodyBodyDefaultProductPrivacy = typeof OrganisationPatchBodyBodyDefaultProductPrivacy[keyof typeof OrganisationPatchBodyBodyDefaultProductPrivacy];
265
-
96
+ export type OrganisationGetDefaultResponseDefaultProductPrivacy =
97
+ (typeof OrganisationGetDefaultResponseDefaultProductPrivacy)[keyof typeof OrganisationGetDefaultResponseDefaultProductPrivacy];
266
98
 
267
99
  // 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',
100
+ export const OrganisationGetDefaultResponseDefaultProductPrivacy = {
101
+ ALWAYS_PUBLIC: "ALWAYS_PUBLIC",
102
+ ALWAYS_PRIVATE: "ALWAYS_PRIVATE",
103
+ DEFAULT_PUBLIC: "DEFAULT_PUBLIC",
104
+ DEFAULT_PRIVATE: "DEFAULT_PRIVATE",
273
105
  } as const;
274
106
 
275
- export type OrganisationPatchBodyBody = {
276
- /** The new name for the Organisational */
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
111
+ */
112
+ id?: string;
113
+ /** The Default Organisation Name
114
+ */
277
115
  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`.
279
-
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
- };
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
117
+ */
118
+ private?: boolean;
119
+ created?: string;
120
+ /** The Organisation's default product privacy setting */
121
+ default_product_privacy?: OrganisationGetDefaultResponseDefaultProductPrivacy;
122
+ }
283
123
 
284
- /**
285
- * The default product privacy setting for products in the unit. Whether the privacy can be honoured will depend on the organisation's value
286
- */
287
- export type OrganisationUnitPostBodyBodyDefaultProductPrivacy = typeof OrganisationUnitPostBodyBodyDefaultProductPrivacy[keyof typeof OrganisationUnitPostBodyBodyDefaultProductPrivacy];
124
+ export interface OrganisationUnitPostResponse {
125
+ /** The unit's unique ID */
126
+ id: string;
127
+ }
288
128
 
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
+ }
289
135
 
290
- // 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',
296
- } as const;
136
+ export interface OrganisationChargeSummary {
137
+ organisation_id: string;
138
+ name: string;
139
+ summary: ChargeSummary[];
140
+ }
297
141
 
298
- export type OrganisationUnitPostBodyBody = {
299
- /**
300
- * The name of the unit
301
- * @maxLength 80
142
+ export interface OrganisationUnitsGetResponse {
143
+ count?: number;
144
+ organisation: OrganisationAllDetail;
145
+ /** A list of Units
302
146
  */
147
+ units: UnitAllDetail[];
148
+ }
149
+
150
+ export interface OrganisationChargesGetResponse {
151
+ organisation_id: string;
303
152
  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
308
- */
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
- };
153
+ coins: string;
154
+ summary: ChargeSummary[];
155
+ unit_charges: OrganisationUnitChargeSummary[];
156
+ }
313
157
 
314
- export type PersonalUnitPutBodyBody = {
158
+ export interface OrganisationUnitChargeSummary {
159
+ unit_id: string;
160
+ name: string;
315
161
  /**
316
- * The day you would like to be billed for the Unit's Products (a value from 1 and 28)
317
162
  * @minimum 1
318
163
  * @maximum 28
319
164
  */
320
165
  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];
327
-
328
-
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;
336
-
337
- export type OrganisationPostBodyBody = {
338
- /**
339
- * The name of the organisation
340
- * @maxLength 80
341
- */
342
- 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
- /**
363
- * 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.
364
- */
365
- export type AssetPostBodyBodyScope = typeof AssetPostBodyBodyScope[keyof typeof AssetPostBodyBodyScope];
366
-
367
-
368
- // eslint-disable-next-line @typescript-eslint/no-redeclare
369
- export const AssetPostBodyBodyScope = {
370
- USER: 'USER',
371
- PRODUCT: 'PRODUCT',
372
- UNIT: 'UNIT',
373
- ORGANISATION: 'ORGANISATION',
374
- GLOBAL: 'GLOBAL',
375
- } as const;
376
-
377
- export type AssetPostBodyBody = {
378
- /**
379
- * 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
380
- * @maxLength 80
381
- * @pattern ^[a-z0-9-]{1,63}$
382
- */
383
- name: string;
384
- /** A file containing the content for the asset. You must provide a value here or in **content_string** but not both */
385
- content_file?: Blob;
386
- /** The textual content of the asset. You must provide a value here or in **content_file** but not both */
387
- content_string?: string;
388
- /** 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. */
389
- scope: AssetPostBodyBodyScope;
390
- /** 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. */
391
- scope_id?: string;
392
- /** Is this a secret asset? Secret assets are not revealed in a subsequent **GET** but are revealed to merchants they are connected to. */
393
- secret: boolean;
394
- /** An optional description for the Asset */
395
- description?: string;
396
- };
397
-
398
- export type AssetPatchBodyBody = {
399
- /** A file containing the content for the asset. You must provide a value here or in content_string */
400
- content_file?: Blob;
401
- /** The textual content of the asset. You must provide a value here or in content_file */
402
- content_string?: string;
403
- /** An optional description for the Asset */
404
- description?: string;
405
- };
406
-
407
- export interface UserDetail {
408
- /** The user identity (username) */
409
- id: string;
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[];
410
171
  }
411
172
 
412
- export interface UserAccountDetail {
413
- user: UserDetail;
414
- /** Whether the caller has admin privilege */
415
- caller_has_admin_privilege: boolean;
416
- /** The roles assigned to the user recognised by the Account Server */
417
- account_server_roles: string[];
173
+ export interface OrganisationsGetResponse {
174
+ count: number;
175
+ /** A list of Organisations */
176
+ organisations: OrganisationAllDetail[];
418
177
  }
419
178
 
420
- /**
421
- * The Unit's default product privacy setting
422
- */
423
- export type UnitDetailDefaultProductPrivacy = typeof UnitDetailDefaultProductPrivacy[keyof typeof UnitDetailDefaultProductPrivacy];
179
+ export type OrganisationGetResponse = OrganisationAllDetail;
424
180
 
181
+ export type ProductChargesGetResponseProductType =
182
+ (typeof ProductChargesGetResponseProductType)[keyof typeof ProductChargesGetResponseProductType];
425
183
 
426
184
  // eslint-disable-next-line @typescript-eslint/no-redeclare
427
- export const UnitDetailDefaultProductPrivacy = {
428
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
429
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
430
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
431
- 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",
432
188
  } as const;
433
189
 
434
- export interface UnitDetail {
435
- /** Whether the user making the API call is a member of the Unit */
436
- caller_is_member: boolean;
437
- /** The Unit's unique identity */
438
- id: string;
439
- /** The Unit's name */
440
- name: string;
441
- /** The Unit's owner (a username) */
442
- owner_id: string;
443
- /** True if the Unit is private */
444
- private: boolean;
445
- created: string;
446
- /** 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
+ */
447
197
  billing_day: number;
448
- /** The Unit's default product privacy setting */
449
- 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[];
450
235
  }
451
236
 
452
237
  /**
453
- * The Unit's default product privacy setting
238
+ * The Unit's Product
454
239
  */
455
- export type UnitAllDetailDefaultProductPrivacy = typeof UnitAllDetailDefaultProductPrivacy[keyof typeof UnitAllDetailDefaultProductPrivacy];
456
-
240
+ export type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;
457
241
 
458
- // eslint-disable-next-line @typescript-eslint/no-redeclare
459
- export const UnitAllDetailDefaultProductPrivacy = {
460
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
461
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
462
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
463
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
464
- } as const;
242
+ export interface ProductUnitGetResponse {
243
+ /** The Unit's Product */
244
+ product: ProductUnitGetResponseProduct;
245
+ }
465
246
 
466
- export interface UnitAllDetail {
247
+ export interface UnitChargesGetResponse {
467
248
  /** Whether the user making the API call is a member of the Unit */
468
249
  caller_is_member: boolean;
469
- /** The Unit's unique identity */
470
- id: string;
471
- /** The Unit's name */
472
- name: string;
250
+ unit_id: string;
251
+ name?: string;
473
252
  /** The Unit's owner (a username) */
474
253
  owner_id: string;
475
254
  /** True if the Unit is private */
476
255
  private: boolean;
477
256
  created: string;
478
- /** The Unit's billing day */
257
+ coins: string;
258
+ count: number;
259
+ /**
260
+ * @minimum 1
261
+ * @maximum 28
262
+ */
479
263
  billing_day: number;
480
- /** The Unit's default product privacy setting */
481
- default_product_privacy: UnitAllDetailDefaultProductPrivacy;
482
- /** A list of users that are members of the Unit */
483
- 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[];
270
+ }
271
+
272
+ export interface UnitChargeSummary {
273
+ charges: ChargeSummary[];
274
+ }
275
+
276
+ export interface UnitProductChargeSummary {
277
+ product_id: string;
278
+ product_type: string;
279
+ charges: ChargeSummary[];
484
280
  }
485
281
 
486
282
  /**
487
- * The kind of Service
283
+ * The type of charge
488
284
  */
489
- export type MerchantDetailKind = typeof MerchantDetailKind[keyof typeof MerchantDetailKind];
490
-
285
+ export type ChargeSummaryType = (typeof ChargeSummaryType)[keyof typeof ChargeSummaryType];
491
286
 
492
287
  // eslint-disable-next-line @typescript-eslint/no-redeclare
493
- export const MerchantDetailKind = {
494
- DATA_MANAGER: 'DATA_MANAGER',
495
- } as const;
288
+ export const ChargeSummaryType = { PROCESSING: "PROCESSING", STORAGE: "STORAGE" } as const;
496
289
 
497
- export interface MerchantDetail {
498
- /** The unique ID of the Service */
499
- id: number;
500
- created: string;
501
- /** The kind of Service */
502
- kind: MerchantDetailKind;
503
- /** The name assigned to the Service */
504
- name: string;
505
- /** The hostname used by the Service */
506
- api_hostname: string;
290
+ export interface ChargeSummary {
291
+ /** The type of charge */
292
+ type: ChargeSummaryType;
293
+ /** The cost, in coins of the charge */
294
+ coins: string;
507
295
  }
508
296
 
509
- export type MerchantGetResponse = MerchantDetail;
297
+ export interface UnitProductPostResponse {
298
+ /** The Product's unique ID */
299
+ id: string;
300
+ }
510
301
 
511
- export interface MerchantsGetResponse {
512
- count?: number;
513
- /** The list of known Merchants
514
- */
515
- merchants: MerchantDetail[];
302
+ export type UnitGetResponse = UnitAllDetail;
303
+
304
+ export interface UnitsGetResponse {
305
+ /** A list of Units
306
+ */
307
+ units: OrganisationUnitsGetResponse[];
516
308
  }
517
309
 
518
- /**
519
- * The Organisation's default product privacy setting
520
- */
521
- export type OrganisationDetailDefaultProductPrivacy = typeof OrganisationDetailDefaultProductPrivacy[keyof typeof OrganisationDetailDefaultProductPrivacy];
310
+ export type UserAccountGetResponse = UserAccountDetail;
522
311
 
312
+ export type AssetDetailScope = (typeof AssetDetailScope)[keyof typeof AssetDetailScope];
523
313
 
524
314
  // eslint-disable-next-line @typescript-eslint/no-redeclare
525
- export const OrganisationDetailDefaultProductPrivacy = {
526
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
527
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
528
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
529
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
315
+ export const AssetDetailScope = {
316
+ USER: "USER",
317
+ PRODUCT: "PRODUCT",
318
+ UNIT: "UNIT",
319
+ ORGANISATION: "ORGANISATION",
320
+ GLOBAL: "GLOBAL",
530
321
  } as const;
531
322
 
532
- export interface OrganisationDetail {
533
- /** Whether the user making the API call is a member of the Unit */
534
- caller_is_member: boolean;
535
- /** The Organisation's unique ID */
323
+ export interface AssetDetail {
324
+ creator: string;
536
325
  id: string;
537
- /** The Organisation's name */
538
326
  name: string;
539
- /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
540
- owner_id?: string;
541
- /** True if the Unit is private */
542
- private: boolean;
327
+ scope: AssetDetailScope;
328
+ scope_id: string;
329
+ secret: boolean;
330
+ disabled: boolean;
331
+ content: string;
543
332
  created: string;
544
- /** The Organisation's default product privacy setting */
545
- default_product_privacy: OrganisationDetailDefaultProductPrivacy;
333
+ content_modified?: string;
334
+ description?: string;
335
+ merchants: MerchantDetail[];
546
336
  }
547
337
 
548
- /**
549
- * The Organisation's default product privacy setting
550
- */
551
- export type OrganisationAllDetailDefaultProductPrivacy = typeof OrganisationAllDetailDefaultProductPrivacy[keyof typeof OrganisationAllDetailDefaultProductPrivacy];
552
-
338
+ export type ProcessingChargesMerchantKind =
339
+ (typeof ProcessingChargesMerchantKind)[keyof typeof ProcessingChargesMerchantKind];
553
340
 
554
341
  // eslint-disable-next-line @typescript-eslint/no-redeclare
555
- export const OrganisationAllDetailDefaultProductPrivacy = {
556
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
557
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
558
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
559
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
560
- } as const;
342
+ export const ProcessingChargesMerchantKind = { DATA_MANAGER: "DATA_MANAGER" } as const;
561
343
 
562
- export interface OrganisationAllDetail {
563
- /** Whether the user making the API call is a member of the Unit */
564
- caller_is_member: boolean;
565
- /** The Organisation's unique ID */
566
- id: string;
567
- /** The Organisation's name */
568
- name: string;
569
- /** The username of the Organisation's owner. Not all Organisations have an owner. The Default Organisation has no owner. */
570
- owner_id?: string;
571
- /** True if the Unit is private */
572
- private: boolean;
573
- created: string;
574
- /** The Organisation's default product privacy setting */
575
- default_product_privacy: OrganisationAllDetailDefaultProductPrivacy;
576
- /** A list of users that are members of the Organisation */
577
- users: UserDetail[];
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;
578
355
  }
579
356
 
580
- /**
581
- * The kind of service that can use the Product
582
- */
583
- export type ProductTypeServiceKind = typeof ProductTypeServiceKind[keyof typeof ProductTypeServiceKind];
584
-
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;
369
+ }
585
370
 
586
- // eslint-disable-next-line @typescript-eslint/no-redeclare
587
- export const ProductTypeServiceKind = {
588
- DATA_MANAGER: 'DATA_MANAGER',
589
- } as const;
371
+ export interface StorageCharges {
372
+ num_items: number;
373
+ items: StorageChargeItem[];
374
+ }
590
375
 
591
- export interface ProductType {
592
- /** A product type, this is a unique string amongst all types known to the Account Server */
593
- type: string;
594
- /** A product flavour. Not all types have a flavour, those that do have a type-specific flavour string */
595
- flavour?: string;
596
- /** The kind of service that can use the Product */
597
- service_kind?: ProductTypeServiceKind;
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;
598
387
  }
599
388
 
600
- export type ProductInstanceDetailCoins = {
601
- /** The number of coins used
602
- */
603
- used: number;
604
- };
605
-
606
- export interface ProductInstanceDetail {
607
- coins: ProductInstanceDetailCoins;
389
+ export interface ChargeAdditionalData {
390
+ [key: string]: unknown;
608
391
  }
609
392
 
610
- /**
611
- * The Product Type flavour. Not all products have flavours
612
-
613
- */
614
- export type ProductDetailFlavour = typeof ProductDetailFlavour[keyof typeof ProductDetailFlavour];
615
-
616
-
617
- // eslint-disable-next-line @typescript-eslint/no-redeclare
618
- export const ProductDetailFlavour = {
619
- EVALUATION: 'EVALUATION',
620
- BRONZE: 'BRONZE',
621
- SILVER: 'SILVER',
622
- GOLD: 'GOLD',
623
- } 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
+ }
624
402
 
625
- /**
626
- * 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
+ }
627
414
 
628
- */
629
- 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
+ };
630
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
+ };
631
432
 
632
- // eslint-disable-next-line @typescript-eslint/no-redeclare
633
- export const ProductDetailType = {
634
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
635
- DATA_MANAGER_STORAGE_SUBSCRIPTION: 'DATA_MANAGER_STORAGE_SUBSCRIPTION',
636
- } as const;
433
+ export interface ProductDmStorageDetail {
434
+ size: ProductDmStorageDetailSize;
435
+ coins: ProductDmStorageDetailCoins;
436
+ }
637
437
 
638
- export interface ProductDetail {
639
- /** The Product ID
640
- */
438
+ export interface ProductClaimDetail {
439
+ /** The service-specific ID that is using this Subscription
440
+ */
641
441
  id: string;
642
- created: string;
643
- /** The Product Type
644
- */
645
- type: ProductDetailType;
646
- /** The Product Type flavour. Not all products have flavours
647
- */
648
- flavour?: ProductDetailFlavour;
649
- /** The name of the Product
650
- */
442
+ /** A name for the service-specific ID
443
+ */
651
444
  name?: string;
652
445
  }
653
446
 
@@ -676,442 +469,651 @@ export interface ProductCoinsDetail {
676
469
  remaining_days: number;
677
470
  }
678
471
 
679
- export interface ProductClaimDetail {
680
- /** The service-specific ID that is using this Subscription
681
- */
682
- id: string;
683
- /** A name for the service-specific ID
472
+ /**
473
+ * The Product Type
474
+
684
475
  */
685
- name?: string;
686
- }
476
+ export type ProductDetailType = (typeof ProductDetailType)[keyof typeof ProductDetailType];
687
477
 
688
- export type ProductDmStorageDetailCoins = {
689
- /** The number of coins currently committed for the current day. This is added to the accumulated coins at the start of each day */
690
- used: number;
691
- /** The coin cost of a 'unit' of storage or part thereof. The unit size is defined in the storage section of the response */
692
- unit_cost: number;
693
- };
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;
694
483
 
695
- export type ProductDmStorageDetailSize = {
696
- /** The humanised size of the peak storage used for the current day. The value is reset at the start of each day */
697
- peak: string;
698
- /** The humanised size of the current storage used for the current day and used to calculate the 'burn rate' */
699
- current: string;
700
- /** The humanised storage unit. The cost of storage is based on the daily peak of the number of units (or part thereof) used */
701
- unit_size: string;
702
- /** The peak number of storage units used today */
703
- units_used: number;
704
- };
484
+ /**
485
+ * The Product Type flavour. Not all products have flavours
705
486
 
706
- export interface ProductDmStorageDetail {
707
- size: ProductDmStorageDetailSize;
708
- coins: ProductDmStorageDetailCoins;
709
- }
487
+ */
488
+ export type ProductDetailFlavour = (typeof ProductDetailFlavour)[keyof typeof ProductDetailFlavour];
710
489
 
711
- export interface ProductDmProjectTier {
712
- product: ProductDetail;
713
- organisation: OrganisationAllDetail;
714
- unit: UnitAllDetail;
715
- storage: ProductDmStorageDetail;
716
- coins: ProductCoinsDetail;
717
- instance: ProductInstanceDetail;
718
- /** True if the product can be (needs to be) claimed. */
719
- claimable: boolean;
720
- claim?: ProductClaimDetail;
721
- }
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;
722
497
 
723
- export interface ProductDmStorage {
724
- product: ProductDetail;
725
- organisation: OrganisationAllDetail;
726
- unit: UnitAllDetail;
727
- storage: ProductDmStorageDetail;
728
- coins: ProductCoinsDetail;
729
- /** True if the product can be (needs to be) claimed. */
730
- 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;
731
512
  }
732
513
 
733
- export interface ChargeAdditionalData { [key: string]: unknown }
514
+ export type ProductInstanceDetailCoins = {
515
+ /** The number of coins used
516
+ */
517
+ used: number;
518
+ };
734
519
 
735
- export interface StorageChargeItem {
736
- item_number: number;
737
- /** The date and time of the processing charge */
738
- date: string;
739
- /** The coin-cost of the storage */
740
- coins: string;
741
- /** The current burn rate, the approximate amount of coins you are currently consuming each day */
742
- current_burn_rate?: string;
743
- /** The date when the charges concluded */
744
- closed?: string;
745
- additional_data?: ChargeAdditionalData;
520
+ export interface ProductInstanceDetail {
521
+ coins: ProductInstanceDetailCoins;
746
522
  }
747
523
 
748
- export interface StorageCharges {
749
- num_items: number;
750
- items: StorageChargeItem[];
751
- }
524
+ /**
525
+ * The kind of service that can use the Product
526
+ */
527
+ export type ProductTypeServiceKind =
528
+ (typeof ProductTypeServiceKind)[keyof typeof ProductTypeServiceKind];
752
529
 
753
- export interface ProcessingChargeItem {
754
- /** The charge record number */
755
- id: number;
756
- /** The most recent sequence number for this charge */
757
- sqn: number;
758
- name?: string;
759
- username: string;
760
- /** The date and time of the processing charge */
761
- timestamp: string;
762
- /** The coin-cost of the storage */
763
- coins: string;
764
- additional_data?: ChargeAdditionalData;
765
- }
530
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
531
+ export const ProductTypeServiceKind = { DATA_MANAGER: "DATA_MANAGER" } as const;
766
532
 
767
- 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
+ }
768
541
 
542
+ /**
543
+ * The Organisation's default product privacy setting
544
+ */
545
+ export type OrganisationAllDetailDefaultProductPrivacy =
546
+ (typeof OrganisationAllDetailDefaultProductPrivacy)[keyof typeof OrganisationAllDetailDefaultProductPrivacy];
769
547
 
770
548
  // eslint-disable-next-line @typescript-eslint/no-redeclare
771
- export const ProcessingChargesMerchantKind = {
772
- 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",
773
554
  } as const;
774
555
 
775
- export interface ProcessingCharges {
776
- merchant_name: string;
777
- merchant_kind: ProcessingChargesMerchantKind;
778
- merchant_api_hostname: string;
779
- /** The date when the process stopped */
780
- closed?: string;
781
- /** 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. */
782
- final: boolean;
783
- /** True if charges were received after the charge record was finalised */
784
- post_final_charges?: boolean;
785
- 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[];
786
572
  }
787
573
 
788
- export type AssetDetailScope = typeof AssetDetailScope[keyof typeof AssetDetailScope];
789
-
574
+ /**
575
+ * The Organisation's default product privacy setting
576
+ */
577
+ export type OrganisationDetailDefaultProductPrivacy =
578
+ (typeof OrganisationDetailDefaultProductPrivacy)[keyof typeof OrganisationDetailDefaultProductPrivacy];
790
579
 
791
580
  // eslint-disable-next-line @typescript-eslint/no-redeclare
792
- export const AssetDetailScope = {
793
- USER: 'USER',
794
- PRODUCT: 'PRODUCT',
795
- UNIT: 'UNIT',
796
- ORGANISATION: 'ORGANISATION',
797
- 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",
798
586
  } as const;
799
587
 
800
- export interface AssetDetail {
801
- 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 */
802
592
  id: string;
593
+ /** The Organisation's name */
803
594
  name: string;
804
- scope: AssetDetailScope;
805
- scope_id: string;
806
- secret: boolean;
807
- disabled: boolean;
808
- 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;
809
599
  created: string;
810
- content_modified?: string;
811
- 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
+ */
812
608
  merchants: MerchantDetail[];
813
609
  }
814
610
 
815
- export type UserAccountGetResponse = UserAccountDetail;
611
+ export type MerchantGetResponse = MerchantDetail;
816
612
 
817
- export interface UnitsGetResponse {
818
- /** A list of Units
613
+ /**
614
+ * The kind of Service
819
615
  */
820
- units: OrganisationUnitsGetResponse[];
821
- }
616
+ export type MerchantDetailKind = (typeof MerchantDetailKind)[keyof typeof MerchantDetailKind];
822
617
 
823
- export type UnitGetResponse = UnitAllDetail;
618
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
619
+ export const MerchantDetailKind = { DATA_MANAGER: "DATA_MANAGER" } as const;
824
620
 
825
- export interface UnitProductPostResponse {
826
- /** The Product's unique ID */
827
- 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;
828
631
  }
829
632
 
830
633
  /**
831
- * The type of charge
634
+ * The Unit's default product privacy setting
832
635
  */
833
- export type ChargeSummaryType = typeof ChargeSummaryType[keyof typeof ChargeSummaryType];
834
-
636
+ export type UnitAllDetailDefaultProductPrivacy =
637
+ (typeof UnitAllDetailDefaultProductPrivacy)[keyof typeof UnitAllDetailDefaultProductPrivacy];
835
638
 
836
639
  // eslint-disable-next-line @typescript-eslint/no-redeclare
837
- export const ChargeSummaryType = {
838
- PROCESSING: 'PROCESSING',
839
- 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",
840
645
  } as const;
841
646
 
842
- export interface ChargeSummary {
843
- /** The type of charge */
844
- type: ChargeSummaryType;
845
- /** The cost, in coins of the charge */
846
- 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[];
847
665
  }
848
666
 
849
- export interface UnitProductChargeSummary {
850
- product_id: string;
851
- product_type: string;
852
- charges: ChargeSummary[];
853
- }
667
+ /**
668
+ * The Unit's default product privacy setting
669
+ */
670
+ export type UnitDetailDefaultProductPrivacy =
671
+ (typeof UnitDetailDefaultProductPrivacy)[keyof typeof UnitDetailDefaultProductPrivacy];
854
672
 
855
- export interface UnitChargeSummary {
856
- charges: ChargeSummary[];
857
- }
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;
858
680
 
859
- export interface UnitChargesGetResponse {
681
+ export interface UnitDetail {
860
682
  /** Whether the user making the API call is a member of the Unit */
861
683
  caller_is_member: boolean;
862
- unit_id: string;
863
- name?: string;
684
+ /** The Unit's unique identity */
685
+ id: string;
686
+ /** The Unit's name */
687
+ name: string;
864
688
  /** The Unit's owner (a username) */
865
689
  owner_id: string;
866
690
  /** True if the Unit is private */
867
691
  private: boolean;
868
692
  created: string;
869
- coins: string;
870
- count: number;
871
- /**
872
- * @minimum 1
873
- * @maximum 28
874
- */
693
+ /** The Unit's billing day */
875
694
  billing_day: number;
876
- /** The start of the charge period */
877
- from: string;
878
- /** The date where of first day after the charge period */
879
- until: string;
880
- summary: UnitChargeSummary;
881
- products: UnitProductChargeSummary[];
695
+ /** The Unit's default product privacy setting */
696
+ default_product_privacy: UnitDetailDefaultProductPrivacy;
882
697
  }
883
698
 
884
- /**
885
- * The Unit's Product
886
- */
887
- export type ProductUnitGetResponseProduct = ProductDmStorage | ProductDmProjectTier;
888
-
889
- export interface ProductUnitGetResponse {
890
- /** The Unit's Product */
891
- 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[];
892
705
  }
893
706
 
894
- export interface ProductsGetTypesResponse {
895
- /** The number of Product Types */
896
- count: number;
897
- /** All the Product Types you have access to */
898
- product_types: ProductType[];
707
+ export interface UserDetail {
708
+ /** The user identity (username) */
709
+ id: string;
899
710
  }
900
711
 
901
- export type ProductsGetDefaultStorageCostDefaultStorageCost = {
902
- cost: string;
903
- units: string;
904
- 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;
905
719
  };
906
720
 
907
- export interface ProductsGetDefaultStorageCost {
908
- default_storage_cost: ProductsGetDefaultStorageCostDefaultStorageCost;
909
- }
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];
910
726
 
911
- 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;
912
735
 
913
- export interface ProductsGetResponse {
914
- count: number;
915
- /** All the Products you have access to */
916
- products: ProductsGetResponseProductsItem[];
917
- }
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;
918
765
 
919
- export type ProductChargesGetResponseProductType = typeof ProductChargesGetResponseProductType[keyof typeof ProductChargesGetResponseProductType];
766
+ export type EventStreamPostBodyBody = { format?: EventStreamPostBodyBodyFormat };
920
767
 
768
+ /**
769
+ * The default product privacy setting for the Organisation
770
+ */
771
+ export type OrganisationPostBodyBodyDefaultProductPrivacy =
772
+ (typeof OrganisationPostBodyBodyDefaultProductPrivacy)[keyof typeof OrganisationPostBodyBodyDefaultProductPrivacy];
921
773
 
922
774
  // eslint-disable-next-line @typescript-eslint/no-redeclare
923
- export const ProductChargesGetResponseProductType = {
924
- DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION: 'DATA_MANAGER_PROJECT_TIER_SUBSCRIPTION',
925
- 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",
926
780
  } as const;
927
781
 
928
- export interface ProductChargesGetResponse {
929
- product_id: string;
930
- product_type: ProductChargesGetResponseProductType;
782
+ export type OrganisationPostBodyBody = {
931
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)
932
797
  * @minimum 1
933
798
  * @maximum 28
934
799
  */
935
800
  billing_day: number;
936
- /** True if the product can be (needs to be) claimed. */
937
- claimable: boolean;
938
- claim?: ProductClaimDetail;
939
- count: number;
940
- /** The start of the charge period */
941
- from: string;
942
- /** The date where of first day after the charge period */
943
- until: string;
944
- /** The total number of coins consumed by this product for the invoice period */
945
- coins: string;
946
- processing_charges: ProcessingCharges[];
947
- storage_charges: StorageCharges;
948
- }
801
+ };
949
802
 
950
- 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];
951
808
 
952
- export interface OrganisationsGetResponse {
953
- count: number;
954
- /** A list of Organisations */
955
- organisations: OrganisationAllDetail[];
956
- }
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;
957
816
 
958
- export interface OrganisationUnitChargeSummary {
959
- unit_id: string;
817
+ export type OrganisationUnitPostBodyBody = {
818
+ /**
819
+ * The name of the unit
820
+ * @maxLength 80
821
+ */
960
822
  name: string;
961
823
  /**
824
+ * The day you would like to be billed for the Unit's Products (a value from 1 and 28)
962
825
  * @minimum 1
963
826
  * @maximum 28
964
827
  */
965
828
  billing_day: number;
966
- /** The start of the charge period */
967
- from: string;
968
- /** The date where of first day after the charge period */
969
- until: string;
970
- summary: ChargeSummary[];
971
- }
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
+ };
972
832
 
973
- export interface OrganisationChargesGetResponse {
974
- organisation_id: string;
975
- name: string;
976
- coins: string;
977
- summary: ChargeSummary[];
978
- unit_charges: OrganisationUnitChargeSummary[];
979
- }
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
+ };
980
857
 
981
- export interface OrganisationUnitsGetResponse {
982
- count?: number;
983
- organisation: OrganisationAllDetail;
984
- /** 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
985
862
  */
986
- units: UnitAllDetail[];
987
- }
863
+ export type UnitPatchBodyBodyDefaultProductPrivacy =
864
+ (typeof UnitPatchBodyBodyDefaultProductPrivacy)[keyof typeof UnitPatchBodyBodyDefaultProductPrivacy];
988
865
 
989
- export interface OrganisationChargeSummary {
990
- organisation_id: string;
991
- name: string;
992
- summary: ChargeSummary[];
993
- }
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;
994
873
 
995
- export interface PersonalUnitPutResponse {
996
- /** The unit's Organisation. Used to identify the Default organisation */
997
- organisation_id: string;
998
- /** The unit's unique ID */
999
- id: string;
1000
- }
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`.
1001
878
 
1002
- export interface OrganisationUnitPostResponse {
1003
- /** The unit's unique ID */
1004
- id: string;
1005
- }
879
+ Whether the privacy can be honoured will depend on the organisation's value */
880
+ default_product_privacy?: UnitPatchBodyBodyDefaultProductPrivacy;
881
+ };
1006
882
 
1007
883
  /**
1008
- * 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
1009
887
  */
1010
- export type OrganisationGetDefaultResponseDefaultProductPrivacy = typeof OrganisationGetDefaultResponseDefaultProductPrivacy[keyof typeof OrganisationGetDefaultResponseDefaultProductPrivacy];
888
+ export type UnitProductPostBodyBodyType =
889
+ (typeof UnitProductPostBodyBodyType)[keyof typeof UnitProductPostBodyBodyType];
1011
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];
1012
902
 
1013
903
  // eslint-disable-next-line @typescript-eslint/no-redeclare
1014
- export const OrganisationGetDefaultResponseDefaultProductPrivacy = {
1015
- ALWAYS_PUBLIC: 'ALWAYS_PUBLIC',
1016
- ALWAYS_PRIVATE: 'ALWAYS_PRIVATE',
1017
- DEFAULT_PUBLIC: 'DEFAULT_PUBLIC',
1018
- DEFAULT_PRIVATE: 'DEFAULT_PRIVATE',
904
+ export const UnitProductPostBodyBodyFlavour = {
905
+ EVALUATION: "EVALUATION",
906
+ BRONZE: "BRONZE",
907
+ SILVER: "SILVER",
908
+ GOLD: "GOLD",
1019
909
  } as const;
1020
910
 
1021
- export interface OrganisationGetDefaultResponse {
1022
- /** Whether the user making the API call is a member of the Default Organisation. Only admin users are members of the Default organisation */
1023
- caller_is_member?: boolean;
1024
- /** 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.
1025
955
  */
1026
- id?: string;
1027
- /** The Default Organisation Name
956
+ export type QPbpParameter = number;
957
+
958
+ /**
959
+ * An Organisation Identity
1028
960
  */
1029
- name?: string;
1030
- /** 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
1031
965
  */
1032
- private?: boolean;
1033
- created?: string;
1034
- /** The Organisation's default product privacy setting */
1035
- default_product_privacy?: OrganisationGetDefaultResponseDefaultProductPrivacy;
1036
- }
966
+ export type QMIdParameter = number;
1037
967
 
1038
- export interface UsersGetResponse {
1039
- count: number;
1040
- organisation?: OrganisationDetail;
1041
- unit?: UnitDetail;
1042
- /** The list of Organisation Users
968
+ /**
969
+ * An object name
1043
970
  */
1044
- users: UserDetail[];
1045
- }
971
+ export type QNameParameter = string;
1046
972
 
1047
- export interface OrganisationPostResponse {
1048
- /** The Organisation's unique ID */
1049
- id: string;
1050
- }
973
+ /**
974
+ * A Unit Identity
975
+ */
976
+ export type QUnitIdParameter = string;
1051
977
 
1052
- export interface StateGetVersionResponse {
1053
- /** 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
1054
980
  */
1055
- version: string;
1056
- }
981
+ export type QProductIdParameter = string;
1057
982
 
1058
983
  /**
1059
- * 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
1060
985
  */
1061
- export type EventStreamVersionGetResponseProtocol = typeof EventStreamVersionGetResponseProtocol[keyof typeof EventStreamVersionGetResponseProtocol];
986
+ export type QUserIdParameter = string;
1062
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;
1063
992
 
1064
- // eslint-disable-next-line @typescript-eslint/no-redeclare
1065
- export const EventStreamVersionGetResponseProtocol = {
1066
- ERROR_INTERNAL: 'ERROR_INTERNAL',
1067
- SERVICE_NOT_PRESENT: 'SERVICE_NOT_PRESENT',
1068
- WEBSOCKET: 'WEBSOCKET',
1069
- } 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;
1070
997
 
1071
- export interface EventStreamVersionGetResponse {
1072
- /** The EventStream implementation version */
1073
- version: string;
1074
- /** 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. */
1075
- protocol: EventStreamVersionGetResponseProtocol;
1076
- /** The name of the Event Stream implementation, often used to identify the service origin and implementation. */
1077
- name: string;
1078
- }
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
+ };
1079
1014
 
1080
- export interface EventStreamGetPostResponse {
1081
- /** The EventStream ID */
1082
- id: number;
1083
- /** 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. */
1084
- location: string;
1085
- /** The Event Stream format. */
1086
- format: string;
1087
- }
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
+ };
1088
1031
 
1089
- export interface ChargesGetResponse {
1090
- coins: string;
1091
- count: number;
1092
- summary: ChargeSummary[];
1093
- organisation_charges: OrganisationChargeSummary[];
1094
- }
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
+ };
1095
1048
 
1096
- export interface AssetPostResponse {
1097
- /** The Asset ID
1098
- */
1099
- id: string;
1100
- }
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
+ };
1101
1065
 
1102
- export interface AssetGetResponse {
1103
- /** A list of Assets
1104
- */
1105
- assets: AssetDetail[];
1106
- /** The number of Assets returned
1107
- */
1108
- count: number;
1109
- }
1066
+ export type GetOrganisationsParams = {
1067
+ /**
1068
+ * An object name
1069
+ */
1070
+ name?: QNameParameter;
1071
+ };
1110
1072
 
1111
- export type AssetGetByIdResponse = AssetDetail;
1073
+ export type GetUnitsParams = {
1074
+ /**
1075
+ * An object name
1076
+ */
1077
+ name?: QNameParameter;
1078
+ };
1112
1079
 
1113
- export interface AsError {
1114
- /** Brief error text that can be presented to the user */
1115
- error: string;
1116
- }
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
+ };
1117
1112
 
1113
+ export type DetachAssetParams = {
1114
+ /**
1115
+ * A Merchant Identity
1116
+ * @minimum 1
1117
+ */
1118
+ m_id?: QMIdParameter;
1119
+ };