@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,19 +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 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 };
@@ -1,7 +0,0 @@
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.
@@ -1,580 +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 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 ? data.download_url : undefined,
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 unmarshalMaintenance = data => {
83
- if (!isJSONObject(data)) {
84
- throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
85
- }
86
- return {
87
- closedAt: unmarshalDate(data.closed_at),
88
- reason: data.reason,
89
- startsAt: unmarshalDate(data.starts_at),
90
- status: data.status,
91
- stopsAt: unmarshalDate(data.stops_at)
92
- };
93
- };
94
- const unmarshalLogsPolicy = data => {
95
- if (!isJSONObject(data)) {
96
- throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
97
- }
98
- return {
99
- maxAgeRetention: data.max_age_retention ? data.max_age_retention : undefined,
100
- totalDiskRetention: data.total_disk_retention ? data.total_disk_retention : undefined
101
- };
102
- };
103
- const unmarshalBackupSchedule = data => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
106
- }
107
- return {
108
- disabled: data.disabled,
109
- frequency: data.frequency,
110
- nextRunAt: unmarshalDate(data.next_run_at),
111
- retention: data.retention
112
- };
113
- };
114
- const unmarshalInstanceSetting = data => {
115
- if (!isJSONObject(data)) {
116
- throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
117
- }
118
- return {
119
- name: data.name,
120
- value: data.value
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: unmarshalBackupSchedule(data.backup_schedule),
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: unmarshalLogsPolicy(data.logs_policy),
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: unmarshalVolume(data.volume)
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 ? data.size : undefined,
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 ? data.port : undefined,
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 ? data.float_max : undefined,
270
- floatMin: data.float_min ? data.float_min : undefined,
271
- hotConfigurable: data.hot_configurable,
272
- intMax: data.int_max ? data.int_max : undefined,
273
- intMin: data.int_min ? data.int_min : undefined,
274
- name: data.name,
275
- propertyType: data.property_type,
276
- stringConstraint: data.string_constraint ? data.string_constraint : undefined,
277
- unit: data.unit ? data.unit : undefined
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 unmarshalNodeTypeVolumeType = data => {
367
- if (!isJSONObject(data)) {
368
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
369
- }
370
- return {
371
- chunkSize: data.chunk_size,
372
- description: data.description,
373
- maxSize: data.max_size,
374
- minSize: data.min_size,
375
- type: data.type
376
- };
377
- };
378
- const unmarshalNodeTypeVolumeConstraintSizes = data => {
379
- if (!isJSONObject(data)) {
380
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
381
- }
382
- return {
383
- maxSize: data.max_size,
384
- minSize: data.min_size
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 ? data.is_bssd_compatible : undefined,
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 marshalAddInstanceACLRulesRequest = (request, defaults) => ({
461
- rules: request.rules
462
- });
463
- const marshalAddInstanceSettingsRequest = (request, defaults) => ({
464
- settings: request.settings
465
- });
466
- const marshalCloneInstanceRequest = (request, defaults) => ({
467
- name: request.name,
468
- node_type: request.nodeType
469
- });
470
- const marshalCreateDatabaseRequest = (request, defaults) => ({
471
- name: request.name
472
- });
473
- const marshalCreateEndpointRequest = (request, defaults) => ({
474
- endpoint_spec: request.endpointSpec
475
- });
476
- const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
477
- instance_name: request.instanceName,
478
- is_ha_cluster: request.isHaCluster,
479
- node_type: request.nodeType
480
- });
481
- const marshalCreateInstanceRequest = (request, defaults) => ({
482
- backup_same_region: request.backupSameRegion,
483
- disable_backup: request.disableBackup,
484
- engine: request.engine,
485
- init_endpoints: request.initEndpoints,
486
- init_settings: request.initSettings,
487
- is_ha_cluster: request.isHaCluster,
488
- name: request.name || randomName('ins'),
489
- node_type: request.nodeType,
490
- password: request.password,
491
- tags: request.tags,
492
- user_name: request.userName,
493
- volume_size: request.volumeSize,
494
- volume_type: request.volumeType,
495
- ...resolveOneOf([{
496
- param: 'organization_id',
497
- value: request.organizationId
498
- }, {
499
- param: 'project_id',
500
- value: request.projectId
501
- }])
502
- });
503
- const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
504
- endpoint_spec: request.endpointSpec
505
- });
506
- const marshalCreateReadReplicaRequest = (request, defaults) => ({
507
- endpoint_spec: request.endpointSpec,
508
- instance_id: request.instanceId,
509
- same_zone: request.sameZone
510
- });
511
- const marshalCreateSnapshotRequest = (request, defaults) => ({
512
- expires_at: request.expiresAt,
513
- name: request.name || randomName('snp')
514
- });
515
- const marshalCreateUserRequest = (request, defaults) => ({
516
- is_admin: request.isAdmin,
517
- name: request.name,
518
- password: request.password
519
- });
520
- const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({
521
- acl_rule_ips: request.aclRuleIps
522
- });
523
- const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({
524
- setting_names: request.settingNames
525
- });
526
- const marshalMigrateEndpointRequest = (request, defaults) => ({
527
- instance_id: request.instanceId
528
- });
529
- const marshalPurgeInstanceLogsRequest = (request, defaults) => ({
530
- log_name: request.logName
531
- });
532
- const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
533
- rules: request.rules
534
- });
535
- const marshalSetInstanceSettingsRequest = (request, defaults) => ({
536
- settings: request.settings
537
- });
538
- const marshalSetPrivilegeRequest = (request, defaults) => ({
539
- database_name: request.databaseName,
540
- permission: request.permission,
541
- user_name: request.userName
542
- });
543
- const marshalUpdateInstanceRequest = (request, defaults) => ({
544
- backup_same_region: request.backupSameRegion,
545
- backup_schedule_frequency: request.backupScheduleFrequency,
546
- backup_schedule_retention: request.backupScheduleRetention,
547
- backup_schedule_start_hour: request.backupScheduleStartHour,
548
- is_backup_schedule_disabled: request.isBackupScheduleDisabled,
549
- logs_policy: request.logsPolicy,
550
- name: request.name,
551
- tags: request.tags
552
- });
553
- const marshalUpdateSnapshotRequest = (request, defaults) => ({
554
- expires_at: request.expiresAt,
555
- name: request.name
556
- });
557
- const marshalUpdateUserRequest = (request, defaults) => ({
558
- is_admin: request.isAdmin,
559
- password: request.password
560
- });
561
- const marshalUpgradeInstanceRequest = (request, defaults) => ({
562
- ...resolveOneOf([{
563
- param: 'enable_ha',
564
- value: request.enableHa
565
- }, {
566
- param: 'node_type',
567
- value: request.nodeType
568
- }, {
569
- param: 'upgradable_version_id',
570
- value: request.upgradableVersionId
571
- }, {
572
- param: 'volume_size',
573
- value: request.volumeSize
574
- }, {
575
- param: 'volume_type',
576
- value: request.volumeType
577
- }])
578
- });
579
-
580
- 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 };
@@ -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 './v2beta1/index.gen.js';
2
- export { index_gen as v2beta1 };