@scaleway/sdk 3.0.0-alpha.0 → 3.1.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 (214) hide show
  1. package/dist/index.gen.d.ts +362 -0
  2. package/dist/index.gen.js +323 -0
  3. package/package.json +71 -25
  4. package/README.md +0 -46
  5. package/dist/api/account/index.js +0 -4
  6. package/dist/api/account/v2/api.gen.js +0 -147
  7. package/dist/api/account/v2/index.gen.js +0 -4
  8. package/dist/api/account/v2/marshalling.gen.js +0 -39
  9. package/dist/api/account/v3/api.gen.js +0 -129
  10. package/dist/api/account/v3/index.gen.js +0 -6
  11. package/dist/api/account/v3/marshalling.gen.js +0 -39
  12. package/dist/api/account/v3/validation-rules.gen.js +0 -39
  13. package/dist/api/applesilicon/index.js +0 -2
  14. package/dist/api/applesilicon/v1alpha1/api.gen.js +0 -220
  15. package/dist/api/applesilicon/v1alpha1/content.gen.js +0 -7
  16. package/dist/api/applesilicon/v1alpha1/index.gen.js +0 -5
  17. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +0 -113
  18. package/dist/api/baremetal/index.js +0 -2
  19. package/dist/api/baremetal/v1/api.gen.js +0 -523
  20. package/dist/api/baremetal/v1/api.utils.js +0 -27
  21. package/dist/api/baremetal/v1/content.gen.js +0 -13
  22. package/dist/api/baremetal/v1/index.js +0 -5
  23. package/dist/api/baremetal/v1/marshalling.gen.js +0 -395
  24. package/dist/api/baremetal/v1/validation-rules.gen.js +0 -109
  25. package/dist/api/billing/index.js +0 -2
  26. package/dist/api/billing/v2alpha1/api.gen.js +0 -80
  27. package/dist/api/billing/v2alpha1/index.gen.js +0 -4
  28. package/dist/api/billing/v2alpha1/marshalling.gen.js +0 -53
  29. package/dist/api/block/index.js +0 -2
  30. package/dist/api/block/v1alpha1/api.gen.js +0 -245
  31. package/dist/api/block/v1alpha1/content.gen.js +0 -13
  32. package/dist/api/block/v1alpha1/index.gen.js +0 -7
  33. package/dist/api/block/v1alpha1/marshalling.gen.js +0 -175
  34. package/dist/api/block/v1alpha1/validation-rules.gen.js +0 -42
  35. package/dist/api/cockpit/index.js +0 -2
  36. package/dist/api/cockpit/v1beta1/api.gen.js +0 -448
  37. package/dist/api/cockpit/v1beta1/content.gen.js +0 -7
  38. package/dist/api/cockpit/v1beta1/index.gen.js +0 -5
  39. package/dist/api/cockpit/v1beta1/marshalling.gen.js +0 -220
  40. package/dist/api/container/index.js +0 -2
  41. package/dist/api/container/v1beta1/api.gen.js +0 -549
  42. package/dist/api/container/v1beta1/content.gen.js +0 -22
  43. package/dist/api/container/v1beta1/index.gen.js +0 -5
  44. package/dist/api/container/v1beta1/marshalling.gen.js +0 -330
  45. package/dist/api/document_db/index.js +0 -2
  46. package/dist/api/document_db/v1beta1/api.gen.js +0 -830
  47. package/dist/api/document_db/v1beta1/content.gen.js +0 -19
  48. package/dist/api/document_db/v1beta1/index.gen.js +0 -7
  49. package/dist/api/document_db/v1beta1/marshalling.gen.js +0 -580
  50. package/dist/api/document_db/v1beta1/validation-rules.gen.js +0 -10
  51. package/dist/api/domain/index.js +0 -2
  52. package/dist/api/domain/v2beta1/api.gen.js +0 -875
  53. package/dist/api/domain/v2beta1/content.gen.js +0 -28
  54. package/dist/api/domain/v2beta1/index.gen.js +0 -7
  55. package/dist/api/domain/v2beta1/marshalling.gen.js +0 -958
  56. package/dist/api/flexibleip/index.js +0 -2
  57. package/dist/api/flexibleip/v1alpha1/api.gen.js +0 -203
  58. package/dist/api/flexibleip/v1alpha1/content.gen.js +0 -10
  59. package/dist/api/flexibleip/v1alpha1/index.gen.js +0 -7
  60. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -97
  61. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +0 -14
  62. package/dist/api/function/index.js +0 -2
  63. package/dist/api/function/v1beta1/api.gen.js +0 -560
  64. package/dist/api/function/v1beta1/content.gen.js +0 -22
  65. package/dist/api/function/v1beta1/index.gen.js +0 -5
  66. package/dist/api/function/v1beta1/marshalling.gen.js +0 -368
  67. package/dist/api/iam/index.js +0 -2
  68. package/dist/api/iam/v1alpha1/api.gen.js +0 -799
  69. package/dist/api/iam/v1alpha1/index.gen.js +0 -6
  70. package/dist/api/iam/v1alpha1/marshalling.gen.js +0 -373
  71. package/dist/api/iam/v1alpha1/validation-rules.gen.js +0 -207
  72. package/dist/api/instance/index.js +0 -2
  73. package/dist/api/instance/v1/api.gen.js +0 -1003
  74. package/dist/api/instance/v1/api.utils.js +0 -369
  75. package/dist/api/instance/v1/content.gen.js +0 -31
  76. package/dist/api/instance/v1/index.js +0 -2
  77. package/dist/api/instance/v1/marshalling.gen.js +0 -1206
  78. package/dist/api/instance/v1/marshalling.utils.js +0 -63
  79. package/dist/api/iot/index.js +0 -2
  80. package/dist/api/iot/v1/api.gen.js +0 -581
  81. package/dist/api/iot/v1/content.gen.js +0 -7
  82. package/dist/api/iot/v1/index.gen.js +0 -5
  83. package/dist/api/iot/v1/marshalling.gen.js +0 -388
  84. package/dist/api/ipfs/index.js +0 -2
  85. package/dist/api/ipfs/v1alpha1/api.gen.js +0 -197
  86. package/dist/api/ipfs/v1alpha1/content.gen.js +0 -7
  87. package/dist/api/ipfs/v1alpha1/index.gen.js +0 -5
  88. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +0 -121
  89. package/dist/api/k8s/index.js +0 -2
  90. package/dist/api/k8s/v1/api.gen.js +0 -454
  91. package/dist/api/k8s/v1/api.utils.js +0 -13
  92. package/dist/api/k8s/v1/content.gen.js +0 -13
  93. package/dist/api/k8s/v1/index.js +0 -4
  94. package/dist/api/k8s/v1/marshalling.gen.js +0 -333
  95. package/dist/api/k8s/v1/validation-rules.gen.js +0 -101
  96. package/dist/api/lb/index.js +0 -2
  97. package/dist/api/lb/v1/api.gen.js +0 -1669
  98. package/dist/api/lb/v1/api.utils.js +0 -81
  99. package/dist/api/lb/v1/content.gen.js +0 -16
  100. package/dist/api/lb/v1/index.js +0 -2
  101. package/dist/api/lb/v1/marshalling.gen.js +0 -923
  102. package/dist/api/marketplace/index.js +0 -4
  103. package/dist/api/marketplace/v1/api.gen.js +0 -60
  104. package/dist/api/marketplace/v1/index.gen.js +0 -4
  105. package/dist/api/marketplace/v1/marshalling.gen.js +0 -92
  106. package/dist/api/marketplace/v2/api.gen.js +0 -162
  107. package/dist/api/marketplace/v2/index.gen.js +0 -4
  108. package/dist/api/marketplace/v2/marshalling.gen.js +0 -94
  109. package/dist/api/mnq/index.js +0 -2
  110. package/dist/api/mnq/v1alpha1/api.gen.js +0 -205
  111. package/dist/api/mnq/v1alpha1/index.gen.js +0 -4
  112. package/dist/api/mnq/v1alpha1/marshalling.gen.js +0 -121
  113. package/dist/api/rdb/index.js +0 -2
  114. package/dist/api/rdb/v1/api.gen.js +0 -972
  115. package/dist/api/rdb/v1/content.gen.js +0 -22
  116. package/dist/api/rdb/v1/index.gen.js +0 -7
  117. package/dist/api/rdb/v1/marshalling.gen.js +0 -636
  118. package/dist/api/rdb/v1/validation-rules.gen.js +0 -10
  119. package/dist/api/redis/index.js +0 -2
  120. package/dist/api/redis/v1/api.gen.js +0 -389
  121. package/dist/api/redis/v1/content.gen.js +0 -7
  122. package/dist/api/redis/v1/index.gen.js +0 -5
  123. package/dist/api/redis/v1/marshalling.gen.js +0 -259
  124. package/dist/api/registry/index.js +0 -2
  125. package/dist/api/registry/v1/api.gen.js +0 -252
  126. package/dist/api/registry/v1/content.gen.js +0 -13
  127. package/dist/api/registry/v1/index.gen.js +0 -5
  128. package/dist/api/registry/v1/marshalling.gen.js +0 -106
  129. package/dist/api/secret/index.js +0 -2
  130. package/dist/api/secret/v1alpha1/api.gen.js +0 -415
  131. package/dist/api/secret/v1alpha1/index.gen.js +0 -4
  132. package/dist/api/secret/v1alpha1/marshalling.gen.js +0 -143
  133. package/dist/api/tem/index.js +0 -2
  134. package/dist/api/tem/v1alpha1/api.gen.js +0 -229
  135. package/dist/api/tem/v1alpha1/content.gen.js +0 -10
  136. package/dist/api/tem/v1alpha1/index.gen.js +0 -5
  137. package/dist/api/tem/v1alpha1/marshalling.gen.js +0 -159
  138. package/dist/api/test/index.js +0 -2
  139. package/dist/api/test/v1/api.gen.js +0 -152
  140. package/dist/api/test/v1/content.gen.js +0 -7
  141. package/dist/api/test/v1/index.gen.js +0 -5
  142. package/dist/api/test/v1/marshalling.gen.js +0 -79
  143. package/dist/api/vpc/index.js +0 -4
  144. package/dist/api/vpc/v1/api.gen.js +0 -110
  145. package/dist/api/vpc/v1/index.gen.js +0 -4
  146. package/dist/api/vpc/v1/marshalling.gen.js +0 -44
  147. package/dist/api/vpc/v2/api.gen.js +0 -276
  148. package/dist/api/vpc/v2/index.gen.js +0 -4
  149. package/dist/api/vpc/v2/marshalling.gen.js +0 -135
  150. package/dist/api/vpcgw/index.js +0 -2
  151. package/dist/api/vpcgw/v1/api.gen.js +0 -669
  152. package/dist/api/vpcgw/v1/content.gen.js +0 -10
  153. package/dist/api/vpcgw/v1/index.gen.js +0 -5
  154. package/dist/api/vpcgw/v1/marshalling.gen.js +0 -336
  155. package/dist/api/webhosting/index.js +0 -2
  156. package/dist/api/webhosting/v1alpha1/api.gen.js +0 -210
  157. package/dist/api/webhosting/v1alpha1/content.gen.js +0 -7
  158. package/dist/api/webhosting/v1alpha1/index.gen.js +0 -7
  159. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +0 -173
  160. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +0 -23
  161. package/dist/helpers/is-browser.js +0 -5
  162. package/dist/helpers/is-response.js +0 -10
  163. package/dist/helpers/json.js +0 -11
  164. package/dist/helpers/marshalling.js +0 -130
  165. package/dist/index.cjs +0 -24364
  166. package/dist/index.d.ts +0 -27584
  167. package/dist/index.js +0 -69
  168. package/dist/internal/async/interval-retrier.js +0 -105
  169. package/dist/internal/async/sleep.js +0 -13
  170. package/dist/internal/interceptors/composer.js +0 -46
  171. package/dist/internal/interceptors/helpers.js +0 -32
  172. package/dist/internal/logger/console-logger.js +0 -38
  173. package/dist/internal/logger/index.js +0 -41
  174. package/dist/internal/logger/level-resolver.js +0 -13
  175. package/dist/internal/validations/string-validation.js +0 -38
  176. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -13
  177. package/dist/scw/api.js +0 -12
  178. package/dist/scw/auth.js +0 -68
  179. package/dist/scw/client-ini-factory.js +0 -174
  180. package/dist/scw/client-ini-profile.js +0 -54
  181. package/dist/scw/client-settings.js +0 -78
  182. package/dist/scw/client.js +0 -98
  183. package/dist/scw/constants.js +0 -4
  184. package/dist/scw/custom-marshalling.js +0 -131
  185. package/dist/scw/errors/error-parser.js +0 -107
  186. package/dist/scw/errors/non-standard/invalid-request-mapper.js +0 -36
  187. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +0 -27
  188. package/dist/scw/errors/scw-error.js +0 -66
  189. package/dist/scw/errors/standard/already-exists-error.js +0 -26
  190. package/dist/scw/errors/standard/denied-authentication-error.js +0 -52
  191. package/dist/scw/errors/standard/index.js +0 -13
  192. package/dist/scw/errors/standard/invalid-arguments-error.js +0 -67
  193. package/dist/scw/errors/standard/out-of-stock-error.js +0 -22
  194. package/dist/scw/errors/standard/permissions-denied-error.js +0 -48
  195. package/dist/scw/errors/standard/precondition-failed-error.js +0 -42
  196. package/dist/scw/errors/standard/quotas-exceeded-error.js +0 -68
  197. package/dist/scw/errors/standard/resource-expired-error.js +0 -26
  198. package/dist/scw/errors/standard/resource-locked-error.js +0 -25
  199. package/dist/scw/errors/standard/resource-not-found-error.js +0 -25
  200. package/dist/scw/errors/standard/too-many-requests-error.js +0 -70
  201. package/dist/scw/errors/standard/transient-state-error.js +0 -26
  202. package/dist/scw/errors/types.js +0 -23
  203. package/dist/scw/fetch/build-fetcher.js +0 -72
  204. package/dist/scw/fetch/http-dumper.js +0 -54
  205. package/dist/scw/fetch/http-interceptors.js +0 -99
  206. package/dist/scw/fetch/resource-paginator.js +0 -84
  207. package/dist/scw/fetch/response-parser.js +0 -72
  208. package/node_modules/@scaleway/random-name/.npmignore +0 -4
  209. package/node_modules/@scaleway/random-name/CHANGELOG.md +0 -129
  210. package/node_modules/@scaleway/random-name/LICENSE.md +0 -21
  211. package/node_modules/@scaleway/random-name/README.md +0 -26
  212. package/node_modules/@scaleway/random-name/dist/index.d.ts +0 -3
  213. package/node_modules/@scaleway/random-name/dist/index.js +0 -13
  214. package/node_modules/@scaleway/random-name/package.json +0 -23
@@ -1,22 +0,0 @@
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
- /** Lists transient statutes of the enum {@link DatabaseBackupStatus}. */
5
- const DATABASE_BACKUP_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting', 'exporting'];
6
-
7
- /** Lists transient statutes of the enum {@link InstanceLogStatus}. */
8
- const INSTANCE_LOG_TRANSIENT_STATUSES = ['creating'];
9
-
10
- /** Lists transient statutes of the enum {@link InstanceStatus}. */
11
- const INSTANCE_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting'];
12
-
13
- /** Lists transient statutes of the enum {@link MaintenanceStatus}. */
14
- const MAINTENANCE_TRANSIENT_STATUSES = ['pending'];
15
-
16
- /** Lists transient statutes of the enum {@link ReadReplicaStatus}. */
17
- const READ_REPLICA_TRANSIENT_STATUSES = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting'];
18
-
19
- /** Lists transient statutes of the enum {@link SnapshotStatus}. */
20
- const SNAPSHOT_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting'];
21
-
22
- export { DATABASE_BACKUP_TRANSIENT_STATUSES, INSTANCE_LOG_TRANSIENT_STATUSES, INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, READ_REPLICA_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES };
@@ -1,7 +0,0 @@
1
- export { API } from './api.gen.js';
2
- export { DATABASE_BACKUP_TRANSIENT_STATUSES, INSTANCE_LOG_TRANSIENT_STATUSES, INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, READ_REPLICA_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES } from './content.gen.js';
3
- import * as validationRules_gen from './validation-rules.gen.js';
4
- export { validationRules_gen as ValidationRules };
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
@@ -1,636 +0,0 @@
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 { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
- import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
5
-
6
- // This file was automatically generated. DO NOT EDIT.
7
- // If you have any remark or suggestion do not hesitate to open an issue.
8
- const unmarshalEndpointDirectAccessDetails = data => {
9
- if (!isJSONObject(data)) {
10
- throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`);
11
- }
12
- return {};
13
- };
14
- const unmarshalEndpointLoadBalancerDetails = data => {
15
- if (!isJSONObject(data)) {
16
- throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`);
17
- }
18
- return {};
19
- };
20
- const unmarshalEndpointPrivateNetworkDetails = data => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
23
- }
24
- return {
25
- privateNetworkId: data.private_network_id,
26
- serviceIp: data.service_ip,
27
- zone: data.zone
28
- };
29
- };
30
- const unmarshalEndpoint = data => {
31
- if (!isJSONObject(data)) {
32
- throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
33
- }
34
- return {
35
- directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : undefined,
36
- hostname: data.hostname ? data.hostname : undefined,
37
- id: data.id,
38
- ip: data.ip ? data.ip : undefined,
39
- loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : undefined,
40
- name: data.name ? data.name : undefined,
41
- port: data.port,
42
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined
43
- };
44
- };
45
- const unmarshalReadReplica = data => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`);
48
- }
49
- return {
50
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
51
- id: data.id,
52
- region: data.region,
53
- sameZone: data.same_zone,
54
- status: data.status
55
- };
56
- };
57
- const unmarshalDatabaseBackup = data => {
58
- if (!isJSONObject(data)) {
59
- throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`);
60
- }
61
- return {
62
- createdAt: unmarshalDate(data.created_at),
63
- databaseName: data.database_name,
64
- downloadUrl: data.download_url ? data.download_url : undefined,
65
- downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
66
- expiresAt: unmarshalDate(data.expires_at),
67
- id: data.id,
68
- instanceId: data.instance_id,
69
- instanceName: data.instance_name,
70
- name: data.name,
71
- region: data.region,
72
- sameRegion: data.same_region,
73
- size: data.size ? data.size : undefined,
74
- status: data.status,
75
- updatedAt: unmarshalDate(data.updated_at)
76
- };
77
- };
78
- const unmarshalDatabase = data => {
79
- if (!isJSONObject(data)) {
80
- throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
81
- }
82
- return {
83
- managed: data.managed,
84
- name: data.name,
85
- owner: data.owner,
86
- size: data.size
87
- };
88
- };
89
- const unmarshalInstanceLog = data => {
90
- if (!isJSONObject(data)) {
91
- throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`);
92
- }
93
- return {
94
- createdAt: unmarshalDate(data.created_at),
95
- downloadUrl: data.download_url ? data.download_url : undefined,
96
- expiresAt: unmarshalDate(data.expires_at),
97
- id: data.id,
98
- nodeName: data.node_name,
99
- region: data.region,
100
- status: data.status
101
- };
102
- };
103
- const unmarshalMaintenance = data => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
106
- }
107
- return {
108
- closedAt: unmarshalDate(data.closed_at),
109
- reason: data.reason,
110
- startsAt: unmarshalDate(data.starts_at),
111
- status: data.status,
112
- stopsAt: unmarshalDate(data.stops_at)
113
- };
114
- };
115
- const unmarshalLogsPolicy = data => {
116
- if (!isJSONObject(data)) {
117
- throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
118
- }
119
- return {
120
- maxAgeRetention: data.max_age_retention ? data.max_age_retention : undefined,
121
- totalDiskRetention: data.total_disk_retention ? data.total_disk_retention : undefined
122
- };
123
- };
124
- const unmarshalBackupSchedule = data => {
125
- if (!isJSONObject(data)) {
126
- throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
127
- }
128
- return {
129
- disabled: data.disabled,
130
- frequency: data.frequency,
131
- nextRunAt: unmarshalDate(data.next_run_at),
132
- retention: data.retention
133
- };
134
- };
135
- const unmarshalInstanceSetting = data => {
136
- if (!isJSONObject(data)) {
137
- throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
138
- }
139
- return {
140
- name: data.name,
141
- value: data.value
142
- };
143
- };
144
- const unmarshalUpgradableVersion = data => {
145
- if (!isJSONObject(data)) {
146
- throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
147
- }
148
- return {
149
- id: data.id,
150
- minorVersion: data.minor_version,
151
- name: data.name,
152
- version: data.version
153
- };
154
- };
155
- const unmarshalVolume = data => {
156
- if (!isJSONObject(data)) {
157
- throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
158
- }
159
- return {
160
- size: data.size,
161
- type: data.type
162
- };
163
- };
164
- const unmarshalInstance = data => {
165
- if (!isJSONObject(data)) {
166
- throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
167
- }
168
- return {
169
- backupSameRegion: data.backup_same_region,
170
- backupSchedule: unmarshalBackupSchedule(data.backup_schedule),
171
- createdAt: unmarshalDate(data.created_at),
172
- endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined,
173
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
174
- engine: data.engine,
175
- id: data.id,
176
- initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting),
177
- isHaCluster: data.is_ha_cluster,
178
- logsPolicy: unmarshalLogsPolicy(data.logs_policy),
179
- maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
180
- name: data.name,
181
- nodeType: data.node_type,
182
- organizationId: data.organization_id,
183
- projectId: data.project_id,
184
- readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica),
185
- region: data.region,
186
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
187
- status: data.status,
188
- tags: data.tags,
189
- upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
190
- volume: unmarshalVolume(data.volume)
191
- };
192
- };
193
- const unmarshalPrivilege = data => {
194
- if (!isJSONObject(data)) {
195
- throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`);
196
- }
197
- return {
198
- databaseName: data.database_name,
199
- permission: data.permission,
200
- userName: data.user_name
201
- };
202
- };
203
- const unmarshalSnapshot = data => {
204
- if (!isJSONObject(data)) {
205
- throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
206
- }
207
- return {
208
- createdAt: unmarshalDate(data.created_at),
209
- expiresAt: unmarshalDate(data.expires_at),
210
- id: data.id,
211
- instanceId: data.instance_id,
212
- instanceName: data.instance_name,
213
- name: data.name,
214
- nodeType: data.node_type,
215
- region: data.region,
216
- size: data.size ? data.size : undefined,
217
- status: data.status,
218
- updatedAt: unmarshalDate(data.updated_at)
219
- };
220
- };
221
- const unmarshalUser = data => {
222
- if (!isJSONObject(data)) {
223
- throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
224
- }
225
- return {
226
- isAdmin: data.is_admin,
227
- name: data.name
228
- };
229
- };
230
- const unmarshalACLRule = data => {
231
- if (!isJSONObject(data)) {
232
- throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
233
- }
234
- return {
235
- action: data.action,
236
- description: data.description,
237
- direction: data.direction,
238
- ip: data.ip,
239
- port: data.port ? data.port : undefined,
240
- protocol: data.protocol
241
- };
242
- };
243
- const unmarshalAddInstanceACLRulesResponse = data => {
244
- if (!isJSONObject(data)) {
245
- throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`);
246
- }
247
- return {
248
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
249
- };
250
- };
251
- const unmarshalAddInstanceSettingsResponse = data => {
252
- if (!isJSONObject(data)) {
253
- throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`);
254
- }
255
- return {
256
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
257
- };
258
- };
259
- const unmarshalDeleteInstanceACLRulesResponse = data => {
260
- if (!isJSONObject(data)) {
261
- throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`);
262
- }
263
- return {
264
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
265
- };
266
- };
267
- const unmarshalDeleteInstanceSettingsResponse = data => {
268
- if (!isJSONObject(data)) {
269
- throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`);
270
- }
271
- return {
272
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
273
- };
274
- };
275
- const unmarshalInstanceMetrics = data => {
276
- if (!isJSONObject(data)) {
277
- throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`);
278
- }
279
- return {
280
- timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
281
- };
282
- };
283
- const unmarshalListDatabaseBackupsResponse = data => {
284
- if (!isJSONObject(data)) {
285
- throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`);
286
- }
287
- return {
288
- databaseBackups: unmarshalArrayOfObject(data.database_backups, unmarshalDatabaseBackup),
289
- totalCount: data.total_count
290
- };
291
- };
292
- const unmarshalEngineSetting = data => {
293
- if (!isJSONObject(data)) {
294
- throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`);
295
- }
296
- return {
297
- defaultValue: data.default_value,
298
- description: data.description,
299
- floatMax: data.float_max ? data.float_max : undefined,
300
- floatMin: data.float_min ? data.float_min : undefined,
301
- hotConfigurable: data.hot_configurable,
302
- intMax: data.int_max ? data.int_max : undefined,
303
- intMin: data.int_min ? data.int_min : undefined,
304
- name: data.name,
305
- propertyType: data.property_type,
306
- stringConstraint: data.string_constraint ? data.string_constraint : undefined,
307
- unit: data.unit ? data.unit : undefined
308
- };
309
- };
310
- const unmarshalEngineVersion = data => {
311
- if (!isJSONObject(data)) {
312
- throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`);
313
- }
314
- return {
315
- availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting),
316
- availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting),
317
- beta: data.beta,
318
- disabled: data.disabled,
319
- endOfLife: unmarshalDate(data.end_of_life),
320
- name: data.name,
321
- version: data.version
322
- };
323
- };
324
- const unmarshalDatabaseEngine = data => {
325
- if (!isJSONObject(data)) {
326
- throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`);
327
- }
328
- return {
329
- logoUrl: data.logo_url,
330
- name: data.name,
331
- region: data.region,
332
- versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)
333
- };
334
- };
335
- const unmarshalListDatabaseEnginesResponse = data => {
336
- if (!isJSONObject(data)) {
337
- throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`);
338
- }
339
- return {
340
- engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),
341
- totalCount: data.total_count
342
- };
343
- };
344
- const unmarshalListDatabasesResponse = data => {
345
- if (!isJSONObject(data)) {
346
- throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
347
- }
348
- return {
349
- databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
350
- totalCount: data.total_count
351
- };
352
- };
353
- const unmarshalListInstanceACLRulesResponse = data => {
354
- if (!isJSONObject(data)) {
355
- throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`);
356
- }
357
- return {
358
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
359
- totalCount: data.total_count
360
- };
361
- };
362
- const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = data => {
363
- if (!isJSONObject(data)) {
364
- throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`);
365
- }
366
- return {
367
- logName: data.log_name,
368
- size: data.size
369
- };
370
- };
371
- const unmarshalListInstanceLogsDetailsResponse = data => {
372
- if (!isJSONObject(data)) {
373
- throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`);
374
- }
375
- return {
376
- details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail)
377
- };
378
- };
379
- const unmarshalListInstanceLogsResponse = data => {
380
- if (!isJSONObject(data)) {
381
- throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`);
382
- }
383
- return {
384
- instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
385
- };
386
- };
387
- const unmarshalListInstancesResponse = data => {
388
- if (!isJSONObject(data)) {
389
- throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
390
- }
391
- return {
392
- instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
393
- totalCount: data.total_count
394
- };
395
- };
396
- const unmarshalNodeTypeVolumeType = data => {
397
- if (!isJSONObject(data)) {
398
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
399
- }
400
- return {
401
- chunkSize: data.chunk_size,
402
- description: data.description,
403
- maxSize: data.max_size,
404
- minSize: data.min_size,
405
- type: data.type
406
- };
407
- };
408
- const unmarshalNodeTypeVolumeConstraintSizes = data => {
409
- if (!isJSONObject(data)) {
410
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
411
- }
412
- return {
413
- maxSize: data.max_size,
414
- minSize: data.min_size
415
- };
416
- };
417
- const unmarshalNodeType = data => {
418
- if (!isJSONObject(data)) {
419
- throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
420
- }
421
- return {
422
- availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
423
- beta: data.beta,
424
- description: data.description,
425
- disabled: data.disabled,
426
- generation: data.generation,
427
- instanceRange: data.instance_range,
428
- isBssdCompatible: data.is_bssd_compatible ? data.is_bssd_compatible : undefined,
429
- isHaRequired: data.is_ha_required,
430
- memory: data.memory,
431
- name: data.name,
432
- region: data.region,
433
- stockStatus: data.stock_status,
434
- vcpus: data.vcpus,
435
- volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : undefined
436
- };
437
- };
438
- const unmarshalListNodeTypesResponse = data => {
439
- if (!isJSONObject(data)) {
440
- throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
441
- }
442
- return {
443
- nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
444
- totalCount: data.total_count
445
- };
446
- };
447
- const unmarshalListPrivilegesResponse = data => {
448
- if (!isJSONObject(data)) {
449
- throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`);
450
- }
451
- return {
452
- privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),
453
- totalCount: data.total_count
454
- };
455
- };
456
- const unmarshalListSnapshotsResponse = data => {
457
- if (!isJSONObject(data)) {
458
- throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
459
- }
460
- return {
461
- snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
462
- totalCount: data.total_count
463
- };
464
- };
465
- const unmarshalListUsersResponse = data => {
466
- if (!isJSONObject(data)) {
467
- throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
468
- }
469
- return {
470
- totalCount: data.total_count,
471
- users: unmarshalArrayOfObject(data.users, unmarshalUser)
472
- };
473
- };
474
- const unmarshalPrepareInstanceLogsResponse = data => {
475
- if (!isJSONObject(data)) {
476
- throw new TypeError(`Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`);
477
- }
478
- return {
479
- instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
480
- };
481
- };
482
- const unmarshalSetInstanceACLRulesResponse = data => {
483
- if (!isJSONObject(data)) {
484
- throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`);
485
- }
486
- return {
487
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
488
- };
489
- };
490
- const unmarshalSetInstanceSettingsResponse = data => {
491
- if (!isJSONObject(data)) {
492
- throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`);
493
- }
494
- return {
495
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
496
- };
497
- };
498
- const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
499
- rules: request.rules
500
- });
501
- const marshalAddInstanceSettingsRequest = (request, defaults) => ({
502
- settings: request.settings
503
- });
504
- const marshalCloneInstanceRequest = (request, defaults) => ({
505
- name: request.name,
506
- node_type: request.nodeType
507
- });
508
- const marshalCreateDatabaseBackupRequest = (request, defaults) => ({
509
- database_name: request.databaseName,
510
- expires_at: request.expiresAt,
511
- instance_id: request.instanceId,
512
- name: request.name || randomName('bkp')
513
- });
514
- const marshalCreateDatabaseRequest = (request, defaults) => ({
515
- name: request.name
516
- });
517
- const marshalCreateEndpointRequest = (request, defaults) => ({
518
- endpoint_spec: request.endpointSpec
519
- });
520
- const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
521
- instance_name: request.instanceName,
522
- is_ha_cluster: request.isHaCluster,
523
- node_type: request.nodeType
524
- });
525
- const marshalCreateInstanceRequest = (request, defaults) => ({
526
- backup_same_region: request.backupSameRegion,
527
- disable_backup: request.disableBackup,
528
- engine: request.engine,
529
- init_endpoints: request.initEndpoints,
530
- init_settings: request.initSettings,
531
- is_ha_cluster: request.isHaCluster,
532
- name: request.name || randomName('ins'),
533
- node_type: request.nodeType,
534
- password: request.password,
535
- tags: request.tags,
536
- user_name: request.userName,
537
- volume_size: request.volumeSize,
538
- volume_type: request.volumeType,
539
- ...resolveOneOf([{
540
- param: 'organization_id',
541
- value: request.organizationId
542
- }, {
543
- param: 'project_id',
544
- value: request.projectId
545
- }])
546
- });
547
- const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
548
- endpoint_spec: request.endpointSpec
549
- });
550
- const marshalCreateReadReplicaRequest = (request, defaults) => ({
551
- endpoint_spec: request.endpointSpec,
552
- instance_id: request.instanceId,
553
- same_zone: request.sameZone
554
- });
555
- const marshalCreateSnapshotRequest = (request, defaults) => ({
556
- expires_at: request.expiresAt,
557
- name: request.name || randomName('snp')
558
- });
559
- const marshalCreateUserRequest = (request, defaults) => ({
560
- is_admin: request.isAdmin,
561
- name: request.name,
562
- password: request.password
563
- });
564
- const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({
565
- acl_rule_ips: request.aclRuleIps
566
- });
567
- const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({
568
- setting_names: request.settingNames
569
- });
570
- const marshalMigrateEndpointRequest = (request, defaults) => ({
571
- instance_id: request.instanceId
572
- });
573
- const marshalPrepareInstanceLogsRequest = (request, defaults) => ({
574
- end_date: request.endDate,
575
- start_date: request.startDate
576
- });
577
- const marshalPurgeInstanceLogsRequest = (request, defaults) => ({
578
- log_name: request.logName
579
- });
580
- const marshalRestoreDatabaseBackupRequest = (request, defaults) => ({
581
- database_name: request.databaseName,
582
- instance_id: request.instanceId
583
- });
584
- const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
585
- rules: request.rules
586
- });
587
- const marshalSetInstanceSettingsRequest = (request, defaults) => ({
588
- settings: request.settings
589
- });
590
- const marshalSetPrivilegeRequest = (request, defaults) => ({
591
- database_name: request.databaseName,
592
- permission: request.permission,
593
- user_name: request.userName
594
- });
595
- const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({
596
- expires_at: request.expiresAt,
597
- name: request.name
598
- });
599
- const marshalUpdateInstanceRequest = (request, defaults) => ({
600
- backup_same_region: request.backupSameRegion,
601
- backup_schedule_frequency: request.backupScheduleFrequency,
602
- backup_schedule_retention: request.backupScheduleRetention,
603
- backup_schedule_start_hour: request.backupScheduleStartHour,
604
- is_backup_schedule_disabled: request.isBackupScheduleDisabled,
605
- logs_policy: request.logsPolicy,
606
- name: request.name,
607
- tags: request.tags
608
- });
609
- const marshalUpdateSnapshotRequest = (request, defaults) => ({
610
- expires_at: request.expiresAt,
611
- name: request.name
612
- });
613
- const marshalUpdateUserRequest = (request, defaults) => ({
614
- is_admin: request.isAdmin,
615
- password: request.password
616
- });
617
- const marshalUpgradeInstanceRequest = (request, defaults) => ({
618
- ...resolveOneOf([{
619
- param: 'enable_ha',
620
- value: request.enableHa
621
- }, {
622
- param: 'node_type',
623
- value: request.nodeType
624
- }, {
625
- param: 'upgradable_version_id',
626
- value: request.upgradableVersionId
627
- }, {
628
- param: 'volume_size',
629
- value: request.volumeSize
630
- }, {
631
- param: 'volume_type',
632
- value: request.volumeType
633
- }])
634
- });
635
-
636
- export { marshalAddInstanceACLRulesRequest, marshalAddInstanceSettingsRequest, marshalCloneInstanceRequest, marshalCreateDatabaseBackupRequest, marshalCreateDatabaseRequest, marshalCreateEndpointRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateInstanceRequest, marshalCreateReadReplicaEndpointRequest, marshalCreateReadReplicaRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalDeleteInstanceACLRulesRequest, marshalDeleteInstanceSettingsRequest, marshalMigrateEndpointRequest, marshalPrepareInstanceLogsRequest, marshalPurgeInstanceLogsRequest, marshalRestoreDatabaseBackupRequest, marshalSetInstanceACLRulesRequest, marshalSetInstanceSettingsRequest, marshalSetPrivilegeRequest, marshalUpdateDatabaseBackupRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalAddInstanceACLRulesResponse, unmarshalAddInstanceSettingsResponse, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalDeleteInstanceACLRulesResponse, unmarshalDeleteInstanceSettingsResponse, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceLog, unmarshalInstanceMetrics, unmarshalListDatabaseBackupsResponse, unmarshalListDatabaseEnginesResponse, unmarshalListDatabasesResponse, unmarshalListInstanceACLRulesResponse, unmarshalListInstanceLogsDetailsResponse, unmarshalListInstanceLogsResponse, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListPrivilegesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalPrepareInstanceLogsResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };
@@ -1,10 +0,0 @@
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 UpdateInstanceRequest = {
5
- backupScheduleStartHour: {
6
- lessThanOrEqual: 23
7
- }
8
- };
9
-
10
- export { UpdateInstanceRequest };
@@ -1,2 +0,0 @@
1
- import * as index_gen from './v1/index.gen.js';
2
- export { index_gen as v1 };