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

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,19 @@
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 InstanceLogStatus}. */
5
+ const INSTANCE_LOG_TRANSIENT_STATUSES = ['creating'];
6
+
7
+ /** Lists transient statutes of the enum {@link InstanceStatus}. */
8
+ const INSTANCE_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting'];
9
+
10
+ /** Lists transient statutes of the enum {@link MaintenanceStatus}. */
11
+ const MAINTENANCE_TRANSIENT_STATUSES = ['pending'];
12
+
13
+ /** Lists transient statutes of the enum {@link ReadReplicaStatus}. */
14
+ const READ_REPLICA_TRANSIENT_STATUSES = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting'];
15
+
16
+ /** Lists transient statutes of the enum {@link SnapshotStatus}. */
17
+ const SNAPSHOT_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting'];
18
+
19
+ export { INSTANCE_LOG_TRANSIENT_STATUSES, INSTANCE_TRANSIENT_STATUSES, MAINTENANCE_TRANSIENT_STATUSES, READ_REPLICA_TRANSIENT_STATUSES, SNAPSHOT_TRANSIENT_STATUSES };
@@ -0,0 +1,7 @@
1
+ export { API } from './api.gen.js';
2
+ export { 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.
@@ -0,0 +1,636 @@
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,
37
+ id: data.id,
38
+ ip: data.ip,
39
+ loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : undefined,
40
+ name: data.name,
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 unmarshalDatabase = data => {
58
+ if (!isJSONObject(data)) {
59
+ throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
60
+ }
61
+ return {
62
+ managed: data.managed,
63
+ name: data.name,
64
+ owner: data.owner,
65
+ size: data.size
66
+ };
67
+ };
68
+ const unmarshalInstanceLog = data => {
69
+ if (!isJSONObject(data)) {
70
+ throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`);
71
+ }
72
+ return {
73
+ createdAt: unmarshalDate(data.created_at),
74
+ downloadUrl: data.download_url,
75
+ expiresAt: unmarshalDate(data.expires_at),
76
+ id: data.id,
77
+ nodeName: data.node_name,
78
+ region: data.region,
79
+ status: data.status
80
+ };
81
+ };
82
+ const unmarshalBackupSchedule = data => {
83
+ if (!isJSONObject(data)) {
84
+ throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
85
+ }
86
+ return {
87
+ disabled: data.disabled,
88
+ frequency: data.frequency,
89
+ nextRunAt: unmarshalDate(data.next_run_at),
90
+ retention: data.retention
91
+ };
92
+ };
93
+ const unmarshalInstanceSetting = data => {
94
+ if (!isJSONObject(data)) {
95
+ throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
96
+ }
97
+ return {
98
+ name: data.name,
99
+ value: data.value
100
+ };
101
+ };
102
+ const unmarshalLogsPolicy = data => {
103
+ if (!isJSONObject(data)) {
104
+ throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
105
+ }
106
+ return {
107
+ maxAgeRetention: data.max_age_retention,
108
+ totalDiskRetention: data.total_disk_retention
109
+ };
110
+ };
111
+ const unmarshalMaintenance = data => {
112
+ if (!isJSONObject(data)) {
113
+ throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
114
+ }
115
+ return {
116
+ closedAt: unmarshalDate(data.closed_at),
117
+ reason: data.reason,
118
+ startsAt: unmarshalDate(data.starts_at),
119
+ status: data.status,
120
+ stopsAt: unmarshalDate(data.stops_at)
121
+ };
122
+ };
123
+ const unmarshalUpgradableVersion = data => {
124
+ if (!isJSONObject(data)) {
125
+ throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
126
+ }
127
+ return {
128
+ id: data.id,
129
+ minorVersion: data.minor_version,
130
+ name: data.name,
131
+ version: data.version
132
+ };
133
+ };
134
+ const unmarshalVolume = data => {
135
+ if (!isJSONObject(data)) {
136
+ throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
137
+ }
138
+ return {
139
+ size: data.size,
140
+ type: data.type
141
+ };
142
+ };
143
+ const unmarshalInstance = data => {
144
+ if (!isJSONObject(data)) {
145
+ throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
146
+ }
147
+ return {
148
+ backupSameRegion: data.backup_same_region,
149
+ backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined,
150
+ createdAt: unmarshalDate(data.created_at),
151
+ endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined,
152
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
153
+ engine: data.engine,
154
+ id: data.id,
155
+ initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting),
156
+ isHaCluster: data.is_ha_cluster,
157
+ logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : undefined,
158
+ maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
159
+ name: data.name,
160
+ nodeType: data.node_type,
161
+ organizationId: data.organization_id,
162
+ projectId: data.project_id,
163
+ readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica),
164
+ region: data.region,
165
+ settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
166
+ status: data.status,
167
+ tags: data.tags,
168
+ upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
169
+ volume: data.volume ? unmarshalVolume(data.volume) : undefined
170
+ };
171
+ };
172
+ const unmarshalPrivilege = data => {
173
+ if (!isJSONObject(data)) {
174
+ throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`);
175
+ }
176
+ return {
177
+ databaseName: data.database_name,
178
+ permission: data.permission,
179
+ userName: data.user_name
180
+ };
181
+ };
182
+ const unmarshalSnapshot = data => {
183
+ if (!isJSONObject(data)) {
184
+ throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
185
+ }
186
+ return {
187
+ createdAt: unmarshalDate(data.created_at),
188
+ expiresAt: unmarshalDate(data.expires_at),
189
+ id: data.id,
190
+ instanceId: data.instance_id,
191
+ instanceName: data.instance_name,
192
+ name: data.name,
193
+ nodeType: data.node_type,
194
+ region: data.region,
195
+ size: data.size,
196
+ status: data.status,
197
+ updatedAt: unmarshalDate(data.updated_at)
198
+ };
199
+ };
200
+ const unmarshalUser = data => {
201
+ if (!isJSONObject(data)) {
202
+ throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
203
+ }
204
+ return {
205
+ isAdmin: data.is_admin,
206
+ name: data.name
207
+ };
208
+ };
209
+ const unmarshalACLRule = data => {
210
+ if (!isJSONObject(data)) {
211
+ throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
212
+ }
213
+ return {
214
+ action: data.action,
215
+ description: data.description,
216
+ direction: data.direction,
217
+ ip: data.ip,
218
+ port: data.port,
219
+ protocol: data.protocol
220
+ };
221
+ };
222
+ const unmarshalAddInstanceACLRulesResponse = data => {
223
+ if (!isJSONObject(data)) {
224
+ throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`);
225
+ }
226
+ return {
227
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
228
+ };
229
+ };
230
+ const unmarshalAddInstanceSettingsResponse = data => {
231
+ if (!isJSONObject(data)) {
232
+ throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`);
233
+ }
234
+ return {
235
+ settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
236
+ };
237
+ };
238
+ const unmarshalDeleteInstanceACLRulesResponse = data => {
239
+ if (!isJSONObject(data)) {
240
+ throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`);
241
+ }
242
+ return {
243
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
244
+ };
245
+ };
246
+ const unmarshalDeleteInstanceSettingsResponse = data => {
247
+ if (!isJSONObject(data)) {
248
+ throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`);
249
+ }
250
+ return {
251
+ settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
252
+ };
253
+ };
254
+ const unmarshalInstanceMetrics = data => {
255
+ if (!isJSONObject(data)) {
256
+ throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`);
257
+ }
258
+ return {
259
+ timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
260
+ };
261
+ };
262
+ const unmarshalEngineSetting = data => {
263
+ if (!isJSONObject(data)) {
264
+ throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`);
265
+ }
266
+ return {
267
+ defaultValue: data.default_value,
268
+ description: data.description,
269
+ floatMax: data.float_max,
270
+ floatMin: data.float_min,
271
+ hotConfigurable: data.hot_configurable,
272
+ intMax: data.int_max,
273
+ intMin: data.int_min,
274
+ name: data.name,
275
+ propertyType: data.property_type,
276
+ stringConstraint: data.string_constraint,
277
+ unit: data.unit
278
+ };
279
+ };
280
+ const unmarshalEngineVersion = data => {
281
+ if (!isJSONObject(data)) {
282
+ throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`);
283
+ }
284
+ return {
285
+ availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting),
286
+ availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting),
287
+ beta: data.beta,
288
+ disabled: data.disabled,
289
+ endOfLife: unmarshalDate(data.end_of_life),
290
+ name: data.name,
291
+ version: data.version
292
+ };
293
+ };
294
+ const unmarshalDatabaseEngine = data => {
295
+ if (!isJSONObject(data)) {
296
+ throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`);
297
+ }
298
+ return {
299
+ logoUrl: data.logo_url,
300
+ name: data.name,
301
+ region: data.region,
302
+ versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)
303
+ };
304
+ };
305
+ const unmarshalListDatabaseEnginesResponse = data => {
306
+ if (!isJSONObject(data)) {
307
+ throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`);
308
+ }
309
+ return {
310
+ engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),
311
+ totalCount: data.total_count
312
+ };
313
+ };
314
+ const unmarshalListDatabasesResponse = data => {
315
+ if (!isJSONObject(data)) {
316
+ throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
317
+ }
318
+ return {
319
+ databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
320
+ totalCount: data.total_count
321
+ };
322
+ };
323
+ const unmarshalListInstanceACLRulesResponse = data => {
324
+ if (!isJSONObject(data)) {
325
+ throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`);
326
+ }
327
+ return {
328
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
329
+ totalCount: data.total_count
330
+ };
331
+ };
332
+ const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = data => {
333
+ if (!isJSONObject(data)) {
334
+ throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`);
335
+ }
336
+ return {
337
+ logName: data.log_name,
338
+ size: data.size
339
+ };
340
+ };
341
+ const unmarshalListInstanceLogsDetailsResponse = data => {
342
+ if (!isJSONObject(data)) {
343
+ throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`);
344
+ }
345
+ return {
346
+ details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail)
347
+ };
348
+ };
349
+ const unmarshalListInstanceLogsResponse = data => {
350
+ if (!isJSONObject(data)) {
351
+ throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`);
352
+ }
353
+ return {
354
+ instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
355
+ };
356
+ };
357
+ const unmarshalListInstancesResponse = data => {
358
+ if (!isJSONObject(data)) {
359
+ throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
360
+ }
361
+ return {
362
+ instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
363
+ totalCount: data.total_count
364
+ };
365
+ };
366
+ const unmarshalNodeTypeVolumeConstraintSizes = data => {
367
+ if (!isJSONObject(data)) {
368
+ throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
369
+ }
370
+ return {
371
+ maxSize: data.max_size,
372
+ minSize: data.min_size
373
+ };
374
+ };
375
+ const unmarshalNodeTypeVolumeType = data => {
376
+ if (!isJSONObject(data)) {
377
+ throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
378
+ }
379
+ return {
380
+ chunkSize: data.chunk_size,
381
+ description: data.description,
382
+ maxSize: data.max_size,
383
+ minSize: data.min_size,
384
+ type: data.type
385
+ };
386
+ };
387
+ const unmarshalNodeType = data => {
388
+ if (!isJSONObject(data)) {
389
+ throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
390
+ }
391
+ return {
392
+ availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
393
+ beta: data.beta,
394
+ description: data.description,
395
+ disabled: data.disabled,
396
+ generation: data.generation,
397
+ instanceRange: data.instance_range,
398
+ isBssdCompatible: data.is_bssd_compatible,
399
+ isHaRequired: data.is_ha_required,
400
+ memory: data.memory,
401
+ name: data.name,
402
+ region: data.region,
403
+ stockStatus: data.stock_status,
404
+ vcpus: data.vcpus,
405
+ volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : undefined
406
+ };
407
+ };
408
+ const unmarshalListNodeTypesResponse = data => {
409
+ if (!isJSONObject(data)) {
410
+ throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
411
+ }
412
+ return {
413
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
414
+ totalCount: data.total_count
415
+ };
416
+ };
417
+ const unmarshalListPrivilegesResponse = data => {
418
+ if (!isJSONObject(data)) {
419
+ throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`);
420
+ }
421
+ return {
422
+ privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),
423
+ totalCount: data.total_count
424
+ };
425
+ };
426
+ const unmarshalListSnapshotsResponse = data => {
427
+ if (!isJSONObject(data)) {
428
+ throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
429
+ }
430
+ return {
431
+ snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
432
+ totalCount: data.total_count
433
+ };
434
+ };
435
+ const unmarshalListUsersResponse = data => {
436
+ if (!isJSONObject(data)) {
437
+ throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
438
+ }
439
+ return {
440
+ totalCount: data.total_count,
441
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
442
+ };
443
+ };
444
+ const unmarshalSetInstanceACLRulesResponse = data => {
445
+ if (!isJSONObject(data)) {
446
+ throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`);
447
+ }
448
+ return {
449
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
450
+ };
451
+ };
452
+ const unmarshalSetInstanceSettingsResponse = data => {
453
+ if (!isJSONObject(data)) {
454
+ throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`);
455
+ }
456
+ return {
457
+ settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
458
+ };
459
+ };
460
+ const marshalACLRuleRequest = (request, defaults) => ({
461
+ description: request.description,
462
+ ip: request.ip
463
+ });
464
+ const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
465
+ rules: request.rules.map(elt => marshalACLRuleRequest(elt))
466
+ });
467
+ const marshalInstanceSetting = (request, defaults) => ({
468
+ name: request.name,
469
+ value: request.value
470
+ });
471
+ const marshalAddInstanceSettingsRequest = (request, defaults) => ({
472
+ settings: request.settings.map(elt => marshalInstanceSetting(elt))
473
+ });
474
+ const marshalCloneInstanceRequest = (request, defaults) => ({
475
+ name: request.name,
476
+ node_type: request.nodeType
477
+ });
478
+ const marshalCreateDatabaseRequest = (request, defaults) => ({
479
+ name: request.name
480
+ });
481
+ const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
482
+ const marshalEndpointSpecLoadBalancer = (request, defaults) => ({});
483
+ const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
484
+ private_network_id: request.privateNetworkId,
485
+ ...resolveOneOf([{
486
+ param: 'service_ip',
487
+ value: request.serviceIp
488
+ }, {
489
+ param: 'ipam_config',
490
+ value: request.ipamConfig !== undefined ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined
491
+ }])
492
+ });
493
+ const marshalEndpointSpec = (request, defaults) => ({
494
+ ...resolveOneOf([{
495
+ param: 'load_balancer',
496
+ value: request.loadBalancer !== undefined ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : undefined
497
+ }, {
498
+ param: 'private_network',
499
+ value: request.privateNetwork !== undefined ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
500
+ }])
501
+ });
502
+ const marshalCreateEndpointRequest = (request, defaults) => ({
503
+ endpoint_spec: request.endpointSpec !== undefined ? marshalEndpointSpec(request.endpointSpec) : undefined
504
+ });
505
+ const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
506
+ instance_name: request.instanceName,
507
+ is_ha_cluster: request.isHaCluster,
508
+ node_type: request.nodeType
509
+ });
510
+ const marshalCreateInstanceRequest = (request, defaults) => ({
511
+ backup_same_region: request.backupSameRegion,
512
+ disable_backup: request.disableBackup,
513
+ engine: request.engine,
514
+ init_endpoints: request.initEndpoints !== undefined ? request.initEndpoints.map(elt => marshalEndpointSpec(elt)) : undefined,
515
+ init_settings: request.initSettings !== undefined ? request.initSettings.map(elt => marshalInstanceSetting(elt)) : undefined,
516
+ is_ha_cluster: request.isHaCluster,
517
+ name: request.name || randomName('ins'),
518
+ node_type: request.nodeType,
519
+ password: request.password,
520
+ tags: request.tags,
521
+ user_name: request.userName,
522
+ volume_size: request.volumeSize,
523
+ volume_type: request.volumeType,
524
+ ...resolveOneOf([{
525
+ default: defaults.defaultOrganizationId,
526
+ param: 'organization_id',
527
+ value: request.organizationId
528
+ }, {
529
+ default: defaults.defaultProjectId,
530
+ param: 'project_id',
531
+ value: request.projectId
532
+ }])
533
+ });
534
+ const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
535
+ const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});
536
+ const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({
537
+ private_network_id: request.privateNetworkId,
538
+ ...resolveOneOf([{
539
+ param: 'service_ip',
540
+ value: request.serviceIp
541
+ }, {
542
+ param: 'ipam_config',
543
+ value: request.ipamConfig !== undefined ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined
544
+ }])
545
+ });
546
+ const marshalReadReplicaEndpointSpec = (request, defaults) => ({
547
+ ...resolveOneOf([{
548
+ param: 'direct_access',
549
+ value: request.directAccess !== undefined ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : undefined
550
+ }, {
551
+ param: 'private_network',
552
+ value: request.privateNetwork !== undefined ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
553
+ }])
554
+ });
555
+ const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
556
+ endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt))
557
+ });
558
+ const marshalCreateReadReplicaRequest = (request, defaults) => ({
559
+ endpoint_spec: request.endpointSpec !== undefined ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt)) : undefined,
560
+ instance_id: request.instanceId,
561
+ same_zone: request.sameZone
562
+ });
563
+ const marshalCreateSnapshotRequest = (request, defaults) => ({
564
+ expires_at: request.expiresAt,
565
+ name: request.name || randomName('snp')
566
+ });
567
+ const marshalCreateUserRequest = (request, defaults) => ({
568
+ is_admin: request.isAdmin,
569
+ name: request.name,
570
+ password: request.password
571
+ });
572
+ const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({
573
+ acl_rule_ips: request.aclRuleIps
574
+ });
575
+ const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({
576
+ setting_names: request.settingNames
577
+ });
578
+ const marshalMigrateEndpointRequest = (request, defaults) => ({
579
+ instance_id: request.instanceId
580
+ });
581
+ const marshalPurgeInstanceLogsRequest = (request, defaults) => ({
582
+ log_name: request.logName
583
+ });
584
+ const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
585
+ rules: request.rules.map(elt => marshalACLRuleRequest(elt))
586
+ });
587
+ const marshalSetInstanceSettingsRequest = (request, defaults) => ({
588
+ settings: request.settings.map(elt => marshalInstanceSetting(elt))
589
+ });
590
+ const marshalSetPrivilegeRequest = (request, defaults) => ({
591
+ database_name: request.databaseName,
592
+ permission: request.permission,
593
+ user_name: request.userName
594
+ });
595
+ const marshalLogsPolicy = (request, defaults) => ({
596
+ max_age_retention: request.maxAgeRetention,
597
+ total_disk_retention: request.totalDiskRetention
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 !== undefined ? marshalLogsPolicy(request.logsPolicy) : undefined,
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: 'node_type',
620
+ value: request.nodeType
621
+ }, {
622
+ param: 'enable_ha',
623
+ value: request.enableHa
624
+ }, {
625
+ param: 'volume_size',
626
+ value: request.volumeSize
627
+ }, {
628
+ param: 'volume_type',
629
+ value: request.volumeType
630
+ }, {
631
+ param: 'upgradable_version_id',
632
+ value: request.upgradableVersionId
633
+ }])
634
+ });
635
+
636
+ export { marshalAddInstanceACLRulesRequest, marshalAddInstanceSettingsRequest, marshalCloneInstanceRequest, marshalCreateDatabaseRequest, marshalCreateEndpointRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateInstanceRequest, marshalCreateReadReplicaEndpointRequest, marshalCreateReadReplicaRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalDeleteInstanceACLRulesRequest, marshalDeleteInstanceSettingsRequest, marshalMigrateEndpointRequest, marshalPurgeInstanceLogsRequest, marshalSetInstanceACLRulesRequest, marshalSetInstanceSettingsRequest, marshalSetPrivilegeRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalAddInstanceACLRulesResponse, unmarshalAddInstanceSettingsResponse, unmarshalDatabase, unmarshalDeleteInstanceACLRulesResponse, unmarshalDeleteInstanceSettingsResponse, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceLog, unmarshalInstanceMetrics, unmarshalListDatabaseEnginesResponse, unmarshalListDatabasesResponse, unmarshalListInstanceACLRulesResponse, unmarshalListInstanceLogsDetailsResponse, unmarshalListInstanceLogsResponse, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListPrivilegesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,2 @@
1
+ import * as index_gen from './v2beta1/index.gen.js';
2
+ export { index_gen as v2beta1 };