@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.14

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 (215) hide show
  1. package/dist/api/account/index.js +4 -0
  2. package/dist/api/account/v2/api.gen.js +147 -0
  3. package/dist/api/account/v2/index.gen.js +4 -0
  4. package/dist/api/account/v2/marshalling.gen.js +39 -0
  5. package/dist/api/account/v3/api.gen.js +129 -0
  6. package/dist/api/account/v3/index.gen.js +6 -0
  7. package/dist/api/account/v3/marshalling.gen.js +39 -0
  8. package/dist/api/account/v3/validation-rules.gen.js +39 -0
  9. package/dist/api/applesilicon/index.js +2 -0
  10. package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
  11. package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
  12. package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
  13. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
  14. package/dist/api/baremetal/index.js +2 -0
  15. package/dist/api/baremetal/v1/api.gen.js +523 -0
  16. package/dist/api/baremetal/v1/api.utils.js +27 -0
  17. package/dist/api/baremetal/v1/content.gen.js +13 -0
  18. package/dist/api/baremetal/v1/index.js +5 -0
  19. package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
  20. package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
  21. package/dist/api/billing/index.js +2 -0
  22. package/dist/api/billing/v2alpha1/api.gen.js +80 -0
  23. package/dist/api/billing/v2alpha1/index.gen.js +4 -0
  24. package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
  25. package/dist/api/block/index.js +2 -0
  26. package/dist/api/block/v1alpha1/api.gen.js +249 -0
  27. package/dist/api/block/v1alpha1/content.gen.js +13 -0
  28. package/dist/api/block/v1alpha1/index.gen.js +7 -0
  29. package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
  30. package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
  31. package/dist/api/cockpit/index.js +2 -0
  32. package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
  33. package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
  34. package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
  35. package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
  36. package/dist/api/container/index.js +2 -0
  37. package/dist/api/container/v1beta1/api.gen.js +549 -0
  38. package/dist/api/container/v1beta1/content.gen.js +22 -0
  39. package/dist/api/container/v1beta1/index.gen.js +7 -0
  40. package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
  41. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  42. package/dist/api/document_db/index.js +2 -0
  43. package/dist/api/document_db/v1beta1/api.gen.js +830 -0
  44. package/dist/api/document_db/v1beta1/content.gen.js +19 -0
  45. package/dist/api/document_db/v1beta1/index.gen.js +7 -0
  46. package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
  47. package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
  48. package/dist/api/domain/index.js +2 -0
  49. package/dist/api/domain/v2beta1/api.gen.js +867 -0
  50. package/dist/api/domain/v2beta1/content.gen.js +28 -0
  51. package/dist/api/domain/v2beta1/index.gen.js +5 -0
  52. package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
  53. package/dist/api/flexibleip/index.js +2 -0
  54. package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
  55. package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
  56. package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
  57. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
  58. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
  59. package/dist/api/function/index.js +2 -0
  60. package/dist/api/function/v1beta1/api.gen.js +560 -0
  61. package/dist/api/function/v1beta1/content.gen.js +22 -0
  62. package/dist/api/function/v1beta1/index.gen.js +7 -0
  63. package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
  64. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  65. package/dist/api/iam/index.js +2 -0
  66. package/dist/api/iam/v1alpha1/api.gen.js +783 -0
  67. package/dist/api/iam/v1alpha1/index.gen.js +6 -0
  68. package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
  69. package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
  70. package/dist/api/instance/index.js +2 -0
  71. package/dist/api/instance/v1/api.gen.js +1003 -0
  72. package/dist/api/instance/v1/api.utils.js +369 -0
  73. package/dist/api/instance/v1/content.gen.js +31 -0
  74. package/dist/api/instance/v1/index.js +2 -0
  75. package/dist/api/instance/v1/marshalling.gen.js +1415 -0
  76. package/dist/api/instance/v1/marshalling.utils.js +63 -0
  77. package/dist/api/iot/index.js +2 -0
  78. package/dist/api/iot/v1/api.gen.js +573 -0
  79. package/dist/api/iot/v1/content.gen.js +7 -0
  80. package/dist/api/iot/v1/index.gen.js +5 -0
  81. package/dist/api/iot/v1/marshalling.gen.js +439 -0
  82. package/dist/api/ipam/index.js +2 -0
  83. package/dist/api/ipam/v1/api.gen.js +113 -0
  84. package/dist/api/ipam/v1/index.gen.js +6 -0
  85. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  86. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  87. package/dist/api/ipfs/index.js +2 -0
  88. package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
  89. package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
  90. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  91. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
  92. package/dist/api/k8s/index.js +2 -0
  93. package/dist/api/k8s/v1/api.gen.js +454 -0
  94. package/dist/api/k8s/v1/api.utils.js +13 -0
  95. package/dist/api/k8s/v1/content.gen.js +13 -0
  96. package/dist/api/k8s/v1/index.js +4 -0
  97. package/dist/api/k8s/v1/marshalling.gen.js +421 -0
  98. package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
  99. package/dist/api/lb/index.js +2 -0
  100. package/dist/api/lb/v1/api.gen.js +1669 -0
  101. package/dist/api/lb/v1/api.utils.js +81 -0
  102. package/dist/api/lb/v1/content.gen.js +16 -0
  103. package/dist/api/lb/v1/index.js +2 -0
  104. package/dist/api/lb/v1/marshalling.gen.js +1039 -0
  105. package/dist/api/marketplace/index.js +4 -0
  106. package/dist/api/marketplace/v1/api.gen.js +60 -0
  107. package/dist/api/marketplace/v1/index.gen.js +4 -0
  108. package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
  109. package/dist/api/marketplace/v2/api.gen.js +162 -0
  110. package/dist/api/marketplace/v2/index.gen.js +4 -0
  111. package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
  112. package/dist/api/mnq/index.js +4 -0
  113. package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
  114. package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
  115. package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
  116. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  117. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  118. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  119. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  120. package/dist/api/rdb/index.js +2 -0
  121. package/dist/api/rdb/v1/api.gen.js +972 -0
  122. package/dist/api/rdb/v1/content.gen.js +22 -0
  123. package/dist/api/rdb/v1/index.gen.js +7 -0
  124. package/dist/api/rdb/v1/marshalling.gen.js +694 -0
  125. package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
  126. package/dist/api/redis/index.js +2 -0
  127. package/dist/api/redis/v1/api.gen.js +389 -0
  128. package/dist/api/redis/v1/content.gen.js +7 -0
  129. package/dist/api/redis/v1/index.gen.js +5 -0
  130. package/dist/api/redis/v1/marshalling.gen.js +283 -0
  131. package/dist/api/registry/index.js +2 -0
  132. package/dist/api/registry/v1/api.gen.js +252 -0
  133. package/dist/api/registry/v1/content.gen.js +13 -0
  134. package/dist/api/registry/v1/index.gen.js +5 -0
  135. package/dist/api/registry/v1/marshalling.gen.js +108 -0
  136. package/dist/api/secret/index.js +2 -0
  137. package/dist/api/secret/v1alpha1/api.gen.js +415 -0
  138. package/dist/api/secret/v1alpha1/index.gen.js +4 -0
  139. package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
  140. package/dist/api/tem/index.js +2 -0
  141. package/dist/api/tem/v1alpha1/api.gen.js +229 -0
  142. package/dist/api/tem/v1alpha1/content.gen.js +10 -0
  143. package/dist/api/tem/v1alpha1/index.gen.js +5 -0
  144. package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
  145. package/dist/api/test/index.js +2 -0
  146. package/dist/api/test/v1/api.gen.js +152 -0
  147. package/dist/api/test/v1/content.gen.js +7 -0
  148. package/dist/api/test/v1/index.gen.js +5 -0
  149. package/dist/api/test/v1/marshalling.gen.js +81 -0
  150. package/dist/api/vpc/index.js +4 -0
  151. package/dist/api/vpc/v1/api.gen.js +110 -0
  152. package/dist/api/vpc/v1/index.gen.js +4 -0
  153. package/dist/api/vpc/v1/marshalling.gen.js +44 -0
  154. package/dist/api/vpc/v2/api.gen.js +276 -0
  155. package/dist/api/vpc/v2/index.gen.js +4 -0
  156. package/dist/api/vpc/v2/marshalling.gen.js +137 -0
  157. package/dist/api/vpcgw/index.js +2 -0
  158. package/dist/api/vpcgw/v1/api.gen.js +669 -0
  159. package/dist/api/vpcgw/v1/content.gen.js +10 -0
  160. package/dist/api/vpcgw/v1/index.gen.js +5 -0
  161. package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
  162. package/dist/api/webhosting/index.js +2 -0
  163. package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
  164. package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
  165. package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
  166. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
  167. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
  168. package/dist/helpers/is-browser.js +5 -0
  169. package/dist/helpers/is-response.js +10 -0
  170. package/dist/helpers/json.js +11 -0
  171. package/dist/helpers/marshalling.js +130 -0
  172. package/dist/index.cjs +26484 -0
  173. package/dist/index.d.ts +31184 -0
  174. package/dist/index.js +71 -0
  175. package/dist/internal/async/interval-retrier.js +105 -0
  176. package/dist/internal/async/sleep.js +13 -0
  177. package/dist/internal/interceptors/composer.js +46 -0
  178. package/dist/internal/interceptors/helpers.js +32 -0
  179. package/dist/internal/logger/console-logger.js +38 -0
  180. package/dist/internal/logger/index.js +41 -0
  181. package/dist/internal/logger/level-resolver.js +13 -0
  182. package/dist/internal/validations/string-validation.js +38 -0
  183. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
  184. package/dist/scw/api.js +12 -0
  185. package/dist/scw/auth.js +68 -0
  186. package/dist/scw/client-ini-factory.js +174 -0
  187. package/dist/scw/client-ini-profile.js +54 -0
  188. package/dist/scw/client-settings.js +78 -0
  189. package/dist/scw/client.js +98 -0
  190. package/dist/scw/constants.js +4 -0
  191. package/dist/scw/custom-marshalling.js +131 -0
  192. package/dist/scw/errors/error-parser.js +107 -0
  193. package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
  194. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
  195. package/dist/scw/errors/scw-error.js +66 -0
  196. package/dist/scw/errors/standard/already-exists-error.js +26 -0
  197. package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
  198. package/dist/scw/errors/standard/index.js +13 -0
  199. package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
  200. package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
  201. package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
  202. package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
  203. package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
  204. package/dist/scw/errors/standard/resource-expired-error.js +26 -0
  205. package/dist/scw/errors/standard/resource-locked-error.js +25 -0
  206. package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
  207. package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
  208. package/dist/scw/errors/standard/transient-state-error.js +26 -0
  209. package/dist/scw/errors/types.js +23 -0
  210. package/dist/scw/fetch/build-fetcher.js +72 -0
  211. package/dist/scw/fetch/http-dumper.js +54 -0
  212. package/dist/scw/fetch/http-interceptors.js +99 -0
  213. package/dist/scw/fetch/resource-paginator.js +84 -0
  214. package/dist/scw/fetch/response-parser.js +72 -0
  215. package/package.json +2 -2
@@ -0,0 +1,6 @@
1
+ export { API } from './api.gen.js';
2
+ import * as validationRules_gen from './validation-rules.gen.js';
3
+ export { validationRules_gen as ValidationRules };
4
+
5
+ // This file was automatically generated. DO NOT EDIT.
6
+ // If you have any remark or suggestion do not hesitate to open an issue.
@@ -0,0 +1,384 @@
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
+ import { isJSONObject } from '../../../helpers/json.js';
3
+ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
+
5
+ // This file was automatically generated. DO NOT EDIT.
6
+ // If you have any remark or suggestion do not hesitate to open an issue.
7
+ const unmarshalJWT = data => {
8
+ if (!isJSONObject(data)) {
9
+ throw new TypeError(`Unmarshalling the type 'JWT' failed as data isn't a dictionary.`);
10
+ }
11
+ return {
12
+ audienceId: data.audience_id,
13
+ createdAt: unmarshalDate(data.created_at),
14
+ expiresAt: unmarshalDate(data.expires_at),
15
+ ip: data.ip,
16
+ issuerId: data.issuer_id,
17
+ jti: data.jti,
18
+ updatedAt: unmarshalDate(data.updated_at),
19
+ userAgent: data.user_agent
20
+ };
21
+ };
22
+ const unmarshalAPIKey = data => {
23
+ if (!isJSONObject(data)) {
24
+ throw new TypeError(`Unmarshalling the type 'APIKey' failed as data isn't a dictionary.`);
25
+ }
26
+ return {
27
+ accessKey: data.access_key,
28
+ applicationId: data.application_id,
29
+ createdAt: unmarshalDate(data.created_at),
30
+ creationIp: data.creation_ip,
31
+ defaultProjectId: data.default_project_id,
32
+ description: data.description,
33
+ editable: data.editable,
34
+ expiresAt: unmarshalDate(data.expires_at),
35
+ secretKey: data.secret_key,
36
+ updatedAt: unmarshalDate(data.updated_at),
37
+ userId: data.user_id
38
+ };
39
+ };
40
+ const unmarshalApplication = data => {
41
+ if (!isJSONObject(data)) {
42
+ throw new TypeError(`Unmarshalling the type 'Application' failed as data isn't a dictionary.`);
43
+ }
44
+ return {
45
+ createdAt: unmarshalDate(data.created_at),
46
+ description: data.description,
47
+ editable: data.editable,
48
+ id: data.id,
49
+ name: data.name,
50
+ nbApiKeys: data.nb_api_keys,
51
+ organizationId: data.organization_id,
52
+ updatedAt: unmarshalDate(data.updated_at)
53
+ };
54
+ };
55
+ const unmarshalGroup = data => {
56
+ if (!isJSONObject(data)) {
57
+ throw new TypeError(`Unmarshalling the type 'Group' failed as data isn't a dictionary.`);
58
+ }
59
+ return {
60
+ applicationIds: data.application_ids,
61
+ createdAt: unmarshalDate(data.created_at),
62
+ description: data.description,
63
+ id: data.id,
64
+ name: data.name,
65
+ organizationId: data.organization_id,
66
+ updatedAt: unmarshalDate(data.updated_at),
67
+ userIds: data.user_ids
68
+ };
69
+ };
70
+ const unmarshalPolicy = data => {
71
+ if (!isJSONObject(data)) {
72
+ throw new TypeError(`Unmarshalling the type 'Policy' failed as data isn't a dictionary.`);
73
+ }
74
+ return {
75
+ applicationId: data.application_id,
76
+ createdAt: unmarshalDate(data.created_at),
77
+ description: data.description,
78
+ editable: data.editable,
79
+ groupId: data.group_id,
80
+ id: data.id,
81
+ name: data.name,
82
+ nbPermissionSets: data.nb_permission_sets,
83
+ nbRules: data.nb_rules,
84
+ nbScopes: data.nb_scopes,
85
+ noPrincipal: data.no_principal,
86
+ organizationId: data.organization_id,
87
+ updatedAt: unmarshalDate(data.updated_at),
88
+ userId: data.user_id
89
+ };
90
+ };
91
+ const unmarshalQuotum = data => {
92
+ if (!isJSONObject(data)) {
93
+ throw new TypeError(`Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`);
94
+ }
95
+ return {
96
+ limit: data.limit,
97
+ name: data.name,
98
+ unlimited: data.unlimited
99
+ };
100
+ };
101
+ const unmarshalSSHKey = data => {
102
+ if (!isJSONObject(data)) {
103
+ throw new TypeError(`Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`);
104
+ }
105
+ return {
106
+ createdAt: unmarshalDate(data.created_at),
107
+ disabled: data.disabled,
108
+ fingerprint: data.fingerprint,
109
+ id: data.id,
110
+ name: data.name,
111
+ organizationId: data.organization_id,
112
+ projectId: data.project_id,
113
+ publicKey: data.public_key,
114
+ updatedAt: unmarshalDate(data.updated_at)
115
+ };
116
+ };
117
+ const unmarshalUser = data => {
118
+ if (!isJSONObject(data)) {
119
+ throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
120
+ }
121
+ return {
122
+ accountRootUserId: data.account_root_user_id,
123
+ createdAt: unmarshalDate(data.created_at),
124
+ deletable: data.deletable,
125
+ email: data.email,
126
+ id: data.id,
127
+ lastLoginAt: unmarshalDate(data.last_login_at),
128
+ mfa: data.mfa,
129
+ organizationId: data.organization_id,
130
+ status: data.status,
131
+ twoFactorEnabled: data.two_factor_enabled,
132
+ type: data.type,
133
+ updatedAt: unmarshalDate(data.updated_at)
134
+ };
135
+ };
136
+ const unmarshalListAPIKeysResponse = data => {
137
+ if (!isJSONObject(data)) {
138
+ throw new TypeError(`Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.`);
139
+ }
140
+ return {
141
+ apiKeys: unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey),
142
+ totalCount: data.total_count
143
+ };
144
+ };
145
+ const unmarshalListApplicationsResponse = data => {
146
+ if (!isJSONObject(data)) {
147
+ throw new TypeError(`Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`);
148
+ }
149
+ return {
150
+ applications: unmarshalArrayOfObject(data.applications, unmarshalApplication),
151
+ totalCount: data.total_count
152
+ };
153
+ };
154
+ const unmarshalListGroupsResponse = data => {
155
+ if (!isJSONObject(data)) {
156
+ throw new TypeError(`Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`);
157
+ }
158
+ return {
159
+ groups: unmarshalArrayOfObject(data.groups, unmarshalGroup),
160
+ totalCount: data.total_count
161
+ };
162
+ };
163
+ const unmarshalListJWTsResponse = data => {
164
+ if (!isJSONObject(data)) {
165
+ throw new TypeError(`Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.`);
166
+ }
167
+ return {
168
+ jwts: unmarshalArrayOfObject(data.jwts, unmarshalJWT),
169
+ totalCount: data.total_count
170
+ };
171
+ };
172
+ const unmarshalPermissionSet = data => {
173
+ if (!isJSONObject(data)) {
174
+ throw new TypeError(`Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`);
175
+ }
176
+ return {
177
+ categories: data.categories,
178
+ description: data.description,
179
+ id: data.id,
180
+ name: data.name,
181
+ scopeType: data.scope_type
182
+ };
183
+ };
184
+ const unmarshalListPermissionSetsResponse = data => {
185
+ if (!isJSONObject(data)) {
186
+ throw new TypeError(`Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`);
187
+ }
188
+ return {
189
+ permissionSets: unmarshalArrayOfObject(data.permission_sets, unmarshalPermissionSet),
190
+ totalCount: data.total_count
191
+ };
192
+ };
193
+ const unmarshalListPoliciesResponse = data => {
194
+ if (!isJSONObject(data)) {
195
+ throw new TypeError(`Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.`);
196
+ }
197
+ return {
198
+ policies: unmarshalArrayOfObject(data.policies, unmarshalPolicy),
199
+ totalCount: data.total_count
200
+ };
201
+ };
202
+ const unmarshalListQuotaResponse = data => {
203
+ if (!isJSONObject(data)) {
204
+ throw new TypeError(`Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`);
205
+ }
206
+ return {
207
+ quota: unmarshalArrayOfObject(data.quota, unmarshalQuotum),
208
+ totalCount: data.total_count
209
+ };
210
+ };
211
+ const unmarshalRule = data => {
212
+ if (!isJSONObject(data)) {
213
+ throw new TypeError(`Unmarshalling the type 'Rule' failed as data isn't a dictionary.`);
214
+ }
215
+ return {
216
+ accountRootUserId: data.account_root_user_id,
217
+ id: data.id,
218
+ organizationId: data.organization_id,
219
+ permissionSetNames: data.permission_set_names,
220
+ permissionSetsScopeType: data.permission_sets_scope_type,
221
+ projectIds: data.project_ids
222
+ };
223
+ };
224
+ const unmarshalListRulesResponse = data => {
225
+ if (!isJSONObject(data)) {
226
+ throw new TypeError(`Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`);
227
+ }
228
+ return {
229
+ rules: unmarshalArrayOfObject(data.rules, unmarshalRule),
230
+ totalCount: data.total_count
231
+ };
232
+ };
233
+ const unmarshalListSSHKeysResponse = data => {
234
+ if (!isJSONObject(data)) {
235
+ throw new TypeError(`Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`);
236
+ }
237
+ return {
238
+ sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),
239
+ totalCount: data.total_count
240
+ };
241
+ };
242
+ const unmarshalListUsersResponse = data => {
243
+ if (!isJSONObject(data)) {
244
+ throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
245
+ }
246
+ return {
247
+ totalCount: data.total_count,
248
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
249
+ };
250
+ };
251
+ const unmarshalSetRulesResponse = data => {
252
+ if (!isJSONObject(data)) {
253
+ throw new TypeError(`Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.`);
254
+ }
255
+ return {
256
+ rules: unmarshalArrayOfObject(data.rules, unmarshalRule)
257
+ };
258
+ };
259
+ const marshalAddGroupMemberRequest = (request, defaults) => ({
260
+ ...resolveOneOf([{
261
+ param: 'user_id',
262
+ value: request.userId
263
+ }, {
264
+ param: 'application_id',
265
+ value: request.applicationId
266
+ }])
267
+ });
268
+ const marshalAddGroupMembersRequest = (request, defaults) => ({
269
+ application_ids: request.applicationIds,
270
+ user_ids: request.userIds
271
+ });
272
+ const marshalCreateAPIKeyRequest = (request, defaults) => ({
273
+ default_project_id: request.defaultProjectId,
274
+ description: request.description,
275
+ expires_at: request.expiresAt,
276
+ ...resolveOneOf([{
277
+ param: 'application_id',
278
+ value: request.applicationId
279
+ }, {
280
+ param: 'user_id',
281
+ value: request.userId
282
+ }])
283
+ });
284
+ const marshalCreateApplicationRequest = (request, defaults) => ({
285
+ description: request.description,
286
+ name: request.name || randomName('app'),
287
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
288
+ });
289
+ const marshalCreateGroupRequest = (request, defaults) => ({
290
+ description: request.description,
291
+ name: request.name || randomName('grp'),
292
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
293
+ });
294
+ const marshalRuleSpecs = (request, defaults) => ({
295
+ permission_set_names: request.permissionSetNames,
296
+ ...resolveOneOf([{
297
+ param: 'project_ids',
298
+ value: request.projectIds
299
+ }, {
300
+ default: defaults.defaultOrganizationId,
301
+ param: 'organization_id',
302
+ value: request.organizationId
303
+ }])
304
+ });
305
+ const marshalCreatePolicyRequest = (request, defaults) => ({
306
+ description: request.description,
307
+ name: request.name || randomName('pol'),
308
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId,
309
+ rules: request.rules !== undefined ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)) : undefined,
310
+ ...resolveOneOf([{
311
+ param: 'user_id',
312
+ value: request.userId
313
+ }, {
314
+ param: 'group_id',
315
+ value: request.groupId
316
+ }, {
317
+ param: 'application_id',
318
+ value: request.applicationId
319
+ }, {
320
+ param: 'no_principal',
321
+ value: request.noPrincipal
322
+ }])
323
+ });
324
+ const marshalCreateSSHKeyRequest = (request, defaults) => ({
325
+ name: request.name || randomName('key'),
326
+ project_id: request.projectId ?? defaults.defaultProjectId,
327
+ public_key: request.publicKey
328
+ });
329
+ const marshalCreateUserRequest = (request, defaults) => ({
330
+ email: request.email,
331
+ organization_id: request.organizationId ?? defaults.defaultOrganizationId
332
+ });
333
+ const marshalRemoveGroupMemberRequest = (request, defaults) => ({
334
+ ...resolveOneOf([{
335
+ param: 'user_id',
336
+ value: request.userId
337
+ }, {
338
+ param: 'application_id',
339
+ value: request.applicationId
340
+ }])
341
+ });
342
+ const marshalSetGroupMembersRequest = (request, defaults) => ({
343
+ application_ids: request.applicationIds,
344
+ user_ids: request.userIds
345
+ });
346
+ const marshalSetRulesRequest = (request, defaults) => ({
347
+ policy_id: request.policyId,
348
+ rules: request.rules.map(elt => marshalRuleSpecs(elt, defaults))
349
+ });
350
+ const marshalUpdateAPIKeyRequest = (request, defaults) => ({
351
+ default_project_id: request.defaultProjectId,
352
+ description: request.description
353
+ });
354
+ const marshalUpdateApplicationRequest = (request, defaults) => ({
355
+ description: request.description,
356
+ name: request.name
357
+ });
358
+ const marshalUpdateGroupRequest = (request, defaults) => ({
359
+ description: request.description,
360
+ name: request.name
361
+ });
362
+ const marshalUpdatePolicyRequest = (request, defaults) => ({
363
+ description: request.description,
364
+ name: request.name,
365
+ ...resolveOneOf([{
366
+ param: 'user_id',
367
+ value: request.userId
368
+ }, {
369
+ param: 'group_id',
370
+ value: request.groupId
371
+ }, {
372
+ param: 'application_id',
373
+ value: request.applicationId
374
+ }, {
375
+ param: 'no_principal',
376
+ value: request.noPrincipal
377
+ }])
378
+ });
379
+ const marshalUpdateSSHKeyRequest = (request, defaults) => ({
380
+ disabled: request.disabled,
381
+ name: request.name
382
+ });
383
+
384
+ export { marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalCreateAPIKeyRequest, marshalCreateApplicationRequest, marshalCreateGroupRequest, marshalCreatePolicyRequest, marshalCreateSSHKeyRequest, marshalCreateUserRequest, marshalRemoveGroupMemberRequest, marshalSetGroupMembersRequest, marshalSetRulesRequest, marshalUpdateAPIKeyRequest, marshalUpdateApplicationRequest, marshalUpdateGroupRequest, marshalUpdatePolicyRequest, marshalUpdateSSHKeyRequest, unmarshalAPIKey, unmarshalApplication, unmarshalGroup, unmarshalJWT, unmarshalListAPIKeysResponse, unmarshalListApplicationsResponse, unmarshalListGroupsResponse, unmarshalListJWTsResponse, unmarshalListPermissionSetsResponse, unmarshalListPoliciesResponse, unmarshalListQuotaResponse, unmarshalListRulesResponse, unmarshalListSSHKeysResponse, unmarshalListUsersResponse, unmarshalPolicy, unmarshalQuotum, unmarshalSSHKey, unmarshalSetRulesResponse, unmarshalUser };
@@ -0,0 +1,207 @@
1
+ // This file was automatically generated. DO NOT EDIT.
2
+ // If you have any remark or suggestion do not hesitate to open an issue.
3
+
4
+ const CreateAPIKeyRequest = {
5
+ description: {
6
+ ignoreEmpty: true,
7
+ maxLength: 200
8
+ }
9
+ };
10
+ const CreateApplicationRequest = {
11
+ description: {
12
+ ignoreEmpty: true,
13
+ maxLength: 200
14
+ },
15
+ name: {
16
+ maxLength: 64,
17
+ minLength: 1,
18
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
19
+ }
20
+ };
21
+ const CreateGroupRequest = {
22
+ description: {
23
+ ignoreEmpty: true,
24
+ maxLength: 200
25
+ },
26
+ name: {
27
+ maxLength: 64,
28
+ minLength: 1,
29
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
30
+ }
31
+ };
32
+ const CreatePolicyRequest = {
33
+ description: {
34
+ ignoreEmpty: true,
35
+ maxLength: 200
36
+ },
37
+ name: {
38
+ maxLength: 64,
39
+ minLength: 1,
40
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
41
+ }
42
+ };
43
+ const CreateSSHKeyRequest = {
44
+ name: {
45
+ ignoreEmpty: true,
46
+ maxLength: 1000
47
+ },
48
+ publicKey: {
49
+ maxLength: 65000,
50
+ minLength: 1
51
+ }
52
+ };
53
+ const GetQuotumRequest = {
54
+ quotumName: {
55
+ minLength: 1
56
+ }
57
+ };
58
+ const ListAPIKeysRequest = {
59
+ description: {
60
+ maxLength: 200
61
+ },
62
+ page: {
63
+ greaterThan: 0
64
+ },
65
+ pageSize: {
66
+ greaterThanOrEqual: 1,
67
+ lessThanOrEqual: 100
68
+ }
69
+ };
70
+ const ListApplicationsRequest = {
71
+ name: {
72
+ maxLength: 64,
73
+ minLength: 1,
74
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
75
+ },
76
+ page: {
77
+ greaterThan: 0
78
+ },
79
+ pageSize: {
80
+ greaterThanOrEqual: 1,
81
+ lessThanOrEqual: 100
82
+ }
83
+ };
84
+ const ListGroupsRequest = {
85
+ name: {
86
+ minLength: 1
87
+ },
88
+ page: {
89
+ greaterThan: 0
90
+ },
91
+ pageSize: {
92
+ greaterThanOrEqual: 1,
93
+ lessThanOrEqual: 100
94
+ }
95
+ };
96
+ const ListJWTsRequest = {
97
+ page: {
98
+ greaterThan: 0
99
+ },
100
+ pageSize: {
101
+ greaterThanOrEqual: 1,
102
+ lessThanOrEqual: 100
103
+ }
104
+ };
105
+ const ListPermissionSetsRequest = {
106
+ page: {
107
+ greaterThan: 0
108
+ },
109
+ pageSize: {
110
+ greaterThanOrEqual: 1,
111
+ lessThanOrEqual: 100
112
+ }
113
+ };
114
+ const ListPoliciesRequest = {
115
+ page: {
116
+ greaterThan: 0
117
+ },
118
+ pageSize: {
119
+ greaterThanOrEqual: 1,
120
+ lessThanOrEqual: 100
121
+ },
122
+ policyName: {
123
+ minLength: 1
124
+ }
125
+ };
126
+ const ListQuotaRequest = {
127
+ page: {
128
+ greaterThan: 0
129
+ },
130
+ pageSize: {
131
+ greaterThanOrEqual: 1,
132
+ lessThanOrEqual: 100
133
+ }
134
+ };
135
+ const ListRulesRequest = {
136
+ page: {
137
+ greaterThan: 0
138
+ },
139
+ pageSize: {
140
+ greaterThanOrEqual: 1,
141
+ lessThanOrEqual: 100
142
+ }
143
+ };
144
+ const ListSSHKeysRequest = {
145
+ name: {
146
+ maxLength: 1000,
147
+ minLength: 1
148
+ },
149
+ page: {
150
+ greaterThan: 0
151
+ },
152
+ pageSize: {
153
+ greaterThanOrEqual: 1,
154
+ lessThanOrEqual: 100
155
+ }
156
+ };
157
+ const ListUsersRequest = {
158
+ page: {
159
+ greaterThan: 0
160
+ },
161
+ pageSize: {
162
+ greaterThanOrEqual: 1,
163
+ lessThanOrEqual: 100
164
+ }
165
+ };
166
+ const UpdateAPIKeyRequest = {
167
+ description: {
168
+ maxLength: 200
169
+ }
170
+ };
171
+ const UpdateApplicationRequest = {
172
+ description: {
173
+ maxLength: 200
174
+ },
175
+ name: {
176
+ maxLength: 64,
177
+ minLength: 1,
178
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
179
+ }
180
+ };
181
+ const UpdateGroupRequest = {
182
+ description: {
183
+ maxLength: 200
184
+ },
185
+ name: {
186
+ maxLength: 64,
187
+ minLength: 1,
188
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
189
+ }
190
+ };
191
+ const UpdatePolicyRequest = {
192
+ description: {
193
+ maxLength: 200
194
+ },
195
+ name: {
196
+ maxLength: 64,
197
+ minLength: 1,
198
+ pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/
199
+ }
200
+ };
201
+ const UpdateSSHKeyRequest = {
202
+ name: {
203
+ maxLength: 1000
204
+ }
205
+ };
206
+
207
+ export { CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreatePolicyRequest, CreateSSHKeyRequest, GetQuotumRequest, ListAPIKeysRequest, ListApplicationsRequest, ListGroupsRequest, ListJWTsRequest, ListPermissionSetsRequest, ListPoliciesRequest, ListQuotaRequest, ListRulesRequest, ListSSHKeysRequest, ListUsersRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest };
@@ -0,0 +1,2 @@
1
+ import * as index from './v1/index.js';
2
+ export { index as v1 };