@scaleway/sdk 1.14.0 → 1.16.0

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 (54) hide show
  1. package/dist/api/account/v2/api.gen.js +77 -60
  2. package/dist/api/applesilicon/v1alpha1/api.gen.js +174 -152
  3. package/dist/api/baremetal/v1/api.gen.js +434 -378
  4. package/dist/api/baremetal/v1/api.utils.js +19 -22
  5. package/dist/api/billing/v2alpha1/api.gen.js +21 -17
  6. package/dist/api/cockpit/v1beta1/api.gen.js +308 -232
  7. package/dist/api/container/v1beta1/api.gen.js +384 -337
  8. package/dist/api/domain/v2beta1/api.gen.js +754 -668
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +164 -151
  10. package/dist/api/function/v1beta1/api.gen.js +467 -407
  11. package/dist/api/iam/v1alpha1/api.gen.js +641 -557
  12. package/dist/api/instance/v1/api.gen.js +803 -677
  13. package/dist/api/instance/v1/api.utils.js +337 -325
  14. package/dist/api/instance/v1/content.gen.js +4 -1
  15. package/dist/api/instance/v1/index.js +1 -1
  16. package/dist/api/instance/v1/marshalling.gen.js +27 -4
  17. package/dist/api/iot/v1/api.gen.js +508 -452
  18. package/dist/api/ipfs/index.js +2 -0
  19. package/dist/api/ipfs/v1alpha1/api.gen.js +197 -0
  20. package/dist/api/ipfs/v1alpha1/content.gen.js +7 -0
  21. package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
  22. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +125 -0
  23. package/dist/api/k8s/v1/api.gen.js +403 -342
  24. package/dist/api/k8s/v1/api.utils.js +7 -10
  25. package/dist/api/k8s/v1/marshalling.gen.js +19 -1
  26. package/dist/api/k8s/v1/validation-rules.gen.js +10 -1
  27. package/dist/api/lb/v1/api.gen.js +1501 -1363
  28. package/dist/api/lb/v1/api.utils.js +71 -75
  29. package/dist/api/lb/v1/marshalling.gen.js +6 -0
  30. package/dist/api/marketplace/v1/api.gen.js +35 -32
  31. package/dist/api/marketplace/v2/api.gen.js +117 -102
  32. package/dist/api/mnq/v1alpha1/api.gen.js +154 -137
  33. package/dist/api/rdb/v1/api.gen.js +897 -819
  34. package/dist/api/redis/v1/api.gen.js +358 -333
  35. package/dist/api/redis/v1/marshalling.gen.js +1 -0
  36. package/dist/api/registry/v1/api.gen.js +211 -189
  37. package/dist/api/secret/v1alpha1/api.gen.js +295 -246
  38. package/dist/api/secret/v1alpha1/marshalling.gen.js +10 -1
  39. package/dist/api/tem/v1alpha1/api.gen.js +182 -147
  40. package/dist/api/tem/v1alpha1/marshalling.gen.js +32 -1
  41. package/dist/api/test/v1/api.gen.js +116 -104
  42. package/dist/api/vpc/v1/api.gen.js +74 -65
  43. package/dist/api/vpc/v2/api.gen.js +200 -178
  44. package/dist/api/vpc/v2/marshalling.gen.js +1 -0
  45. package/dist/api/vpcgw/v1/api.gen.js +575 -501
  46. package/dist/api/webhosting/v1alpha1/api.gen.js +127 -117
  47. package/dist/api/webhosting/v1alpha1/content.gen.js +1 -1
  48. package/dist/index.cjs +924 -453
  49. package/dist/index.d.ts +2152 -1558
  50. package/dist/index.js +28 -26
  51. package/dist/internal/logger/console-logger.js +4 -5
  52. package/dist/scw/constants.js +1 -1
  53. package/dist/scw/errors/scw-error.js +2 -2
  54. package/package.json +2 -2
@@ -13,11 +13,11 @@ const jsonContentHeaders = {
13
13
 
14
14
  /** Public Gateways API. */
15
15
  class API extends API$1 {
16
- constructor() {
17
- var _this;
18
- super(...arguments);
19
- _this = this;
20
- this.pageOfListGateways = function (request) {
16
+ /** Lists the available zones of the API. */
17
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
18
+ pageOfListGateways = (() => {
19
+ var _this = this;
20
+ return function (request) {
21
21
  if (request === void 0) {
22
22
  request = {};
23
23
  }
@@ -27,569 +27,643 @@ class API extends API$1 {
27
27
  urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['tags', request.tags], ['type', request.type])
28
28
  }, unmarshalListGatewaysResponse);
29
29
  };
30
- /**
31
- * List Public Gateways. List Public Gateways in a given Scaleway Organization
32
- * or Project. By default, results are displayed in ascending order of
33
- * creation date.
34
- *
35
- * @param request - The request {@link ListGatewaysRequest}
36
- * @returns A Promise of ListGatewaysResponse
37
- */
38
- this.listGateways = function (request) {
30
+ })();
31
+
32
+ /**
33
+ * List Public Gateways. List Public Gateways in a given Scaleway Organization
34
+ * or Project. By default, results are displayed in ascending order of
35
+ * creation date.
36
+ *
37
+ * @param request - The request {@link ListGatewaysRequest}
38
+ * @returns A Promise of ListGatewaysResponse
39
+ */
40
+ listGateways = (() => {
41
+ var _this2 = this;
42
+ return function (request) {
39
43
  if (request === void 0) {
40
44
  request = {};
41
45
  }
42
- return enrichForPagination('gateways', _this.pageOfListGateways, request);
46
+ return enrichForPagination('gateways', _this2.pageOfListGateways, request);
43
47
  };
44
- /**
45
- * Get a Public Gateway. Get details of a Public Gateway, specified by its
46
- * gateway ID. The response object contains full details of the gateway,
47
- * including its **name**, **type**, **status** and more.
48
- *
49
- * @param request - The request {@link GetGatewayRequest}
50
- * @returns A Promise of Gateway
51
- */
52
- this.getGateway = request => this.client.fetch({
53
- method: 'GET',
54
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`
55
- }, unmarshalGateway);
56
- /**
57
- * Waits for {@link Gateway} to be in a final state.
58
- *
59
- * @param request - The request {@link GetGatewayRequest}
60
- * @param options - The waiting options
61
- * @returns A Promise of Gateway
62
- */
63
- this.waitForGateway = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options);
64
- /**
65
- * Create a Public Gateway. Create a new Public Gateway in the specified
66
- * Scaleway Project, defining its **name**, **type** and other configuration
67
- * details such as whether to enable SSH bastion.
68
- *
69
- * @param request - The request {@link CreateGatewayRequest}
70
- * @returns A Promise of Gateway
71
- */
72
- this.createGateway = request => this.client.fetch({
73
- body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)),
74
- headers: jsonContentHeaders,
75
- method: 'POST',
76
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways`
77
- }, unmarshalGateway);
78
- /**
79
- * Update a Public Gateway. Update the parameters of an existing Public
80
- * Gateway, for example, its **name**, **tags**, **SSH bastion
81
- * configuration**, and **DNS servers**.
82
- *
83
- * @param request - The request {@link UpdateGatewayRequest}
84
- * @returns A Promise of Gateway
85
- */
86
- this.updateGateway = request => this.client.fetch({
87
- body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)),
88
- headers: jsonContentHeaders,
89
- method: 'PATCH',
90
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`
91
- }, unmarshalGateway);
92
- /**
93
- * Delete a Public Gateway. Delete an existing Public Gateway, specified by
94
- * its gateway ID. This action is irreversible.
95
- *
96
- * @param request - The request {@link DeleteGatewayRequest}
97
- */
98
- this.deleteGateway = request => this.client.fetch({
99
- method: 'DELETE',
100
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`,
101
- urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp])
102
- });
103
- /**
104
- * Upgrade a Public Gateway to the latest version. Upgrade a given Public
105
- * Gateway to the newest software version. This applies the latest bugfixes
106
- * and features to your Public Gateway, but its service will be interrupted
107
- * during the update.
108
- *
109
- * @param request - The request {@link UpgradeGatewayRequest}
110
- * @returns A Promise of Gateway
111
- */
112
- this.upgradeGateway = request => this.client.fetch({
113
- body: '{}',
114
- headers: jsonContentHeaders,
115
- method: 'POST',
116
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade`
117
- }, unmarshalGateway);
118
- this.pageOfListGatewayNetworks = function (request) {
48
+ })();
49
+
50
+ /**
51
+ * Get a Public Gateway. Get details of a Public Gateway, specified by its
52
+ * gateway ID. The response object contains full details of the gateway,
53
+ * including its **name**, **type**, **status** and more.
54
+ *
55
+ * @param request - The request {@link GetGatewayRequest}
56
+ * @returns A Promise of Gateway
57
+ */
58
+ getGateway = request => this.client.fetch({
59
+ method: 'GET',
60
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`
61
+ }, unmarshalGateway);
62
+
63
+ /**
64
+ * Waits for {@link Gateway} to be in a final state.
65
+ *
66
+ * @param request - The request {@link GetGatewayRequest}
67
+ * @param options - The waiting options
68
+ * @returns A Promise of Gateway
69
+ */
70
+ waitForGateway = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options);
71
+
72
+ /**
73
+ * Create a Public Gateway. Create a new Public Gateway in the specified
74
+ * Scaleway Project, defining its **name**, **type** and other configuration
75
+ * details such as whether to enable SSH bastion.
76
+ *
77
+ * @param request - The request {@link CreateGatewayRequest}
78
+ * @returns A Promise of Gateway
79
+ */
80
+ createGateway = request => this.client.fetch({
81
+ body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)),
82
+ headers: jsonContentHeaders,
83
+ method: 'POST',
84
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways`
85
+ }, unmarshalGateway);
86
+
87
+ /**
88
+ * Update a Public Gateway. Update the parameters of an existing Public
89
+ * Gateway, for example, its **name**, **tags**, **SSH bastion
90
+ * configuration**, and **DNS servers**.
91
+ *
92
+ * @param request - The request {@link UpdateGatewayRequest}
93
+ * @returns A Promise of Gateway
94
+ */
95
+ updateGateway = request => this.client.fetch({
96
+ body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)),
97
+ headers: jsonContentHeaders,
98
+ method: 'PATCH',
99
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`
100
+ }, unmarshalGateway);
101
+
102
+ /**
103
+ * Delete a Public Gateway. Delete an existing Public Gateway, specified by
104
+ * its gateway ID. This action is irreversible.
105
+ *
106
+ * @param request - The request {@link DeleteGatewayRequest}
107
+ */
108
+ deleteGateway = request => this.client.fetch({
109
+ method: 'DELETE',
110
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`,
111
+ urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp])
112
+ });
113
+
114
+ /**
115
+ * Upgrade a Public Gateway to the latest version. Upgrade a given Public
116
+ * Gateway to the newest software version. This applies the latest bugfixes
117
+ * and features to your Public Gateway, but its service will be interrupted
118
+ * during the update.
119
+ *
120
+ * @param request - The request {@link UpgradeGatewayRequest}
121
+ * @returns A Promise of Gateway
122
+ */
123
+ upgradeGateway = request => this.client.fetch({
124
+ body: '{}',
125
+ headers: jsonContentHeaders,
126
+ method: 'POST',
127
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade`
128
+ }, unmarshalGateway);
129
+ pageOfListGatewayNetworks = (() => {
130
+ var _this3 = this;
131
+ return function (request) {
119
132
  if (request === void 0) {
120
133
  request = {};
121
134
  }
122
- return _this.client.fetch({
135
+ return _this3.client.fetch({
123
136
  method: 'GET',
124
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/gateway-networks`,
125
- urlParams: urlParams(['dhcp_id', request.dhcpId], ['enable_masquerade', request.enableMasquerade], ['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['status', request.status ?? 'unknown'])
137
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this3.client.settings.defaultZone)}/gateway-networks`,
138
+ urlParams: urlParams(['dhcp_id', request.dhcpId], ['enable_masquerade', request.enableMasquerade], ['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['status', request.status ?? 'unknown'])
126
139
  }, unmarshalListGatewayNetworksResponse);
127
140
  };
128
- /**
129
- * List Public Gateway connections to Private Networks. List the connections
130
- * between Public Gateways and Private Networks (a connection = a
131
- * GatewayNetwork). You can choose to filter by `gateway-id` to list all
132
- * Private Networks attached to the specified Public Gateway, or by
133
- * `private_network_id` to list all Public Gateways attached to the specified
134
- * Private Network. Other query parameters are also available. The result is
135
- * an array of GatewayNetwork objects, each giving details of the connection
136
- * between a given Public Gateway and a given Private Network.
137
- *
138
- * @param request - The request {@link ListGatewayNetworksRequest}
139
- * @returns A Promise of ListGatewayNetworksResponse
140
- */
141
- this.listGatewayNetworks = function (request) {
141
+ })();
142
+
143
+ /**
144
+ * List Public Gateway connections to Private Networks. List the connections
145
+ * between Public Gateways and Private Networks (a connection = a
146
+ * GatewayNetwork). You can choose to filter by `gateway-id` to list all
147
+ * Private Networks attached to the specified Public Gateway, or by
148
+ * `private_network_id` to list all Public Gateways attached to the specified
149
+ * Private Network. Other query parameters are also available. The result is
150
+ * an array of GatewayNetwork objects, each giving details of the connection
151
+ * between a given Public Gateway and a given Private Network.
152
+ *
153
+ * @param request - The request {@link ListGatewayNetworksRequest}
154
+ * @returns A Promise of ListGatewayNetworksResponse
155
+ */
156
+ listGatewayNetworks = (() => {
157
+ var _this4 = this;
158
+ return function (request) {
142
159
  if (request === void 0) {
143
160
  request = {};
144
161
  }
145
- return enrichForPagination('gatewayNetworks', _this.pageOfListGatewayNetworks, request);
162
+ return enrichForPagination('gatewayNetworks', _this4.pageOfListGatewayNetworks, request);
146
163
  };
147
- /**
148
- * Get a Public Gateway connection to a Private Network. Get details of a
149
- * given connection between a Public Gateway and a Private Network (this
150
- * connection = a GatewayNetwork), specified by its `gateway_network_id`. The
151
- * response object contains details of the connection including the IDs of the
152
- * Public Gateway and Private Network, the dates the connection was
153
- * created/updated and its configuration settings.
154
- *
155
- * @param request - The request {@link GetGatewayNetworkRequest}
156
- * @returns A Promise of GatewayNetwork
157
- */
158
- this.getGatewayNetwork = request => this.client.fetch({
159
- method: 'GET',
160
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`
161
- }, unmarshalGatewayNetwork);
162
- /**
163
- * Waits for {@link GatewayNetwork} to be in a final state.
164
- *
165
- * @param request - The request {@link GetGatewayNetworkRequest}
166
- * @param options - The waiting options
167
- * @returns A Promise of GatewayNetwork
168
- */
169
- this.waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options);
170
- /**
171
- * Attach a Public Gateway to a Private Network. Attach a specific Public
172
- * Gateway to a specific Private Network (create a GatewayNetwork). You can
173
- * configure parameters for the connection including DHCP settings, whether to
174
- * enable masquerade (dynamic NAT), and more.
175
- *
176
- * @param request - The request {@link CreateGatewayNetworkRequest}
177
- * @returns A Promise of GatewayNetwork
178
- */
179
- this.createGatewayNetwork = request => this.client.fetch({
180
- body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)),
181
- headers: jsonContentHeaders,
182
- method: 'POST',
183
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
184
- }, unmarshalGatewayNetwork);
185
- /**
186
- * Update a Public Gateway's connection to a Private Network. Update the
187
- * configuration parameters of a connection between a given Public Gateway and
188
- * Private Network (the connection = a GatewayNetwork). Updatable parameters
189
- * include DHCP settings and whether to enable traffic masquerade (dynamic
190
- * NAT).
191
- *
192
- * @param request - The request {@link UpdateGatewayNetworkRequest}
193
- * @returns A Promise of GatewayNetwork
194
- */
195
- this.updateGatewayNetwork = request => this.client.fetch({
196
- body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)),
197
- headers: jsonContentHeaders,
198
- method: 'PATCH',
199
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`
200
- }, unmarshalGatewayNetwork);
201
- /**
202
- * Detach a Public Gateway from a Private Network. Detach a given Public
203
- * Gateway from a given Private Network, i.e. delete a GatewayNetwork
204
- * specified by a gateway_network_id.
205
- *
206
- * @param request - The request {@link DeleteGatewayNetworkRequest}
207
- */
208
- this.deleteGatewayNetwork = request => this.client.fetch({
209
- method: 'DELETE',
210
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`,
211
- urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp])
212
- });
213
- this.pageOfListDHCPs = function (request) {
164
+ })();
165
+
166
+ /**
167
+ * Get a Public Gateway connection to a Private Network. Get details of a
168
+ * given connection between a Public Gateway and a Private Network (this
169
+ * connection = a GatewayNetwork), specified by its `gateway_network_id`. The
170
+ * response object contains details of the connection including the IDs of the
171
+ * Public Gateway and Private Network, the dates the connection was
172
+ * created/updated and its configuration settings.
173
+ *
174
+ * @param request - The request {@link GetGatewayNetworkRequest}
175
+ * @returns A Promise of GatewayNetwork
176
+ */
177
+ getGatewayNetwork = request => this.client.fetch({
178
+ method: 'GET',
179
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`
180
+ }, unmarshalGatewayNetwork);
181
+
182
+ /**
183
+ * Waits for {@link GatewayNetwork} to be in a final state.
184
+ *
185
+ * @param request - The request {@link GetGatewayNetworkRequest}
186
+ * @param options - The waiting options
187
+ * @returns A Promise of GatewayNetwork
188
+ */
189
+ waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options);
190
+
191
+ /**
192
+ * Attach a Public Gateway to a Private Network. Attach a specific Public
193
+ * Gateway to a specific Private Network (create a GatewayNetwork). You can
194
+ * configure parameters for the connection including DHCP settings, whether to
195
+ * enable masquerade (dynamic NAT), and more.
196
+ *
197
+ * @param request - The request {@link CreateGatewayNetworkRequest}
198
+ * @returns A Promise of GatewayNetwork
199
+ */
200
+ createGatewayNetwork = request => this.client.fetch({
201
+ body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)),
202
+ headers: jsonContentHeaders,
203
+ method: 'POST',
204
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`
205
+ }, unmarshalGatewayNetwork);
206
+
207
+ /**
208
+ * Update a Public Gateway's connection to a Private Network. Update the
209
+ * configuration parameters of a connection between a given Public Gateway and
210
+ * Private Network (the connection = a GatewayNetwork). Updatable parameters
211
+ * include DHCP settings and whether to enable traffic masquerade (dynamic
212
+ * NAT).
213
+ *
214
+ * @param request - The request {@link UpdateGatewayNetworkRequest}
215
+ * @returns A Promise of GatewayNetwork
216
+ */
217
+ updateGatewayNetwork = request => this.client.fetch({
218
+ body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)),
219
+ headers: jsonContentHeaders,
220
+ method: 'PATCH',
221
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`
222
+ }, unmarshalGatewayNetwork);
223
+
224
+ /**
225
+ * Detach a Public Gateway from a Private Network. Detach a given Public
226
+ * Gateway from a given Private Network, i.e. delete a GatewayNetwork
227
+ * specified by a gateway_network_id.
228
+ *
229
+ * @param request - The request {@link DeleteGatewayNetworkRequest}
230
+ */
231
+ deleteGatewayNetwork = request => this.client.fetch({
232
+ method: 'DELETE',
233
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`,
234
+ urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp])
235
+ });
236
+ pageOfListDHCPs = (() => {
237
+ var _this5 = this;
238
+ return function (request) {
214
239
  if (request === void 0) {
215
240
  request = {};
216
241
  }
217
- return _this.client.fetch({
242
+ return _this5.client.fetch({
218
243
  method: 'GET',
219
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/dhcps`,
220
- urlParams: urlParams(['address', request.address], ['has_address', request.hasAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
244
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this5.client.settings.defaultZone)}/dhcps`,
245
+ urlParams: urlParams(['address', request.address], ['has_address', request.hasAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this5.client.settings.defaultPageSize], ['project_id', request.projectId])
221
246
  }, unmarshalListDHCPsResponse);
222
247
  };
223
- /**
224
- * List DHCP configurations. List DHCP configurations, optionally filtering by
225
- * Organization, Project, Public Gateway IP address or more. The response is
226
- * an array of DHCP configuration objects, each identified by a DHCP ID and
227
- * containing configuration settings for the assignment of IP addresses to
228
- * devices on a Private Network attached to a Public Gateway. Note that the
229
- * response does not contain the IDs of any Private Network / Public Gateway
230
- * the configuration is attached to. Use the `List Public Gateway connections
231
- * to Private Networks` method for that purpose, filtering on DHCP ID.
232
- *
233
- * @param request - The request {@link ListDHCPsRequest}
234
- * @returns A Promise of ListDHCPsResponse
235
- */
236
- this.listDHCPs = function (request) {
248
+ })();
249
+
250
+ /**
251
+ * List DHCP configurations. List DHCP configurations, optionally filtering by
252
+ * Organization, Project, Public Gateway IP address or more. The response is
253
+ * an array of DHCP configuration objects, each identified by a DHCP ID and
254
+ * containing configuration settings for the assignment of IP addresses to
255
+ * devices on a Private Network attached to a Public Gateway. Note that the
256
+ * response does not contain the IDs of any Private Network / Public Gateway
257
+ * the configuration is attached to. Use the `List Public Gateway connections
258
+ * to Private Networks` method for that purpose, filtering on DHCP ID.
259
+ *
260
+ * @param request - The request {@link ListDHCPsRequest}
261
+ * @returns A Promise of ListDHCPsResponse
262
+ */
263
+ listDHCPs = (() => {
264
+ var _this6 = this;
265
+ return function (request) {
237
266
  if (request === void 0) {
238
267
  request = {};
239
268
  }
240
- return enrichForPagination('dhcps', _this.pageOfListDHCPs, request);
269
+ return enrichForPagination('dhcps', _this6.pageOfListDHCPs, request);
241
270
  };
242
- /**
243
- * Get a DHCP configuration. Get a DHCP configuration object, identified by
244
- * its DHCP ID. The response object contains configuration settings for the
245
- * assignment of IP addresses to devices on a Private Network attached to a
246
- * Public Gateway. Note that the response does not contain the IDs of any
247
- * Private Network / Public Gateway the configuration is attached to. Use the
248
- * `List Public Gateway connections to Private Networks` method for that
249
- * purpose, filtering on DHCP ID.
250
- *
251
- * @param request - The request {@link GetDHCPRequest}
252
- * @returns A Promise of DHCP
253
- */
254
- this.getDHCP = request => this.client.fetch({
255
- method: 'GET',
256
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`
257
- }, unmarshalDHCP);
258
- /**
259
- * Create a DHCP configuration. Create a new DHCP configuration object,
260
- * containing settings for the assignment of IP addresses to devices on a
261
- * Private Network attached to a Public Gateway. The response object includes
262
- * the ID of the DHCP configuration object. You can use this ID as part of a
263
- * call to `Create a Public Gateway connection to a Private Network` or
264
- * `Update a Public Gateway connection to a Private Network` to directly apply
265
- * this DHCP configuration.
266
- *
267
- * @param request - The request {@link CreateDHCPRequest}
268
- * @returns A Promise of DHCP
269
- */
270
- this.createDHCP = request => this.client.fetch({
271
- body: JSON.stringify(marshalCreateDHCPRequest(request, this.client.settings)),
272
- headers: jsonContentHeaders,
273
- method: 'POST',
274
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps`
275
- }, unmarshalDHCP);
276
- /**
277
- * Update a DHCP configuration. Update a DHCP configuration object, identified
278
- * by its DHCP ID.
279
- *
280
- * @param request - The request {@link UpdateDHCPRequest}
281
- * @returns A Promise of DHCP
282
- */
283
- this.updateDHCP = request => this.client.fetch({
284
- body: JSON.stringify(marshalUpdateDHCPRequest(request, this.client.settings)),
285
- headers: jsonContentHeaders,
286
- method: 'PATCH',
287
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`
288
- }, unmarshalDHCP);
289
- /**
290
- * Delete a DHCP configuration. Delete a DHCP configuration object, identified
291
- * by its DHCP ID. Note that you cannot delete a DHCP configuration object
292
- * that is currently being used by a Gateway Network.
293
- *
294
- * @param request - The request {@link DeleteDHCPRequest}
295
- */
296
- this.deleteDHCP = request => this.client.fetch({
297
- method: 'DELETE',
298
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`
299
- });
300
- this.pageOfListDHCPEntries = function (request) {
271
+ })();
272
+
273
+ /**
274
+ * Get a DHCP configuration. Get a DHCP configuration object, identified by
275
+ * its DHCP ID. The response object contains configuration settings for the
276
+ * assignment of IP addresses to devices on a Private Network attached to a
277
+ * Public Gateway. Note that the response does not contain the IDs of any
278
+ * Private Network / Public Gateway the configuration is attached to. Use the
279
+ * `List Public Gateway connections to Private Networks` method for that
280
+ * purpose, filtering on DHCP ID.
281
+ *
282
+ * @param request - The request {@link GetDHCPRequest}
283
+ * @returns A Promise of DHCP
284
+ */
285
+ getDHCP = request => this.client.fetch({
286
+ method: 'GET',
287
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`
288
+ }, unmarshalDHCP);
289
+
290
+ /**
291
+ * Create a DHCP configuration. Create a new DHCP configuration object,
292
+ * containing settings for the assignment of IP addresses to devices on a
293
+ * Private Network attached to a Public Gateway. The response object includes
294
+ * the ID of the DHCP configuration object. You can use this ID as part of a
295
+ * call to `Create a Public Gateway connection to a Private Network` or
296
+ * `Update a Public Gateway connection to a Private Network` to directly apply
297
+ * this DHCP configuration.
298
+ *
299
+ * @param request - The request {@link CreateDHCPRequest}
300
+ * @returns A Promise of DHCP
301
+ */
302
+ createDHCP = request => this.client.fetch({
303
+ body: JSON.stringify(marshalCreateDHCPRequest(request, this.client.settings)),
304
+ headers: jsonContentHeaders,
305
+ method: 'POST',
306
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps`
307
+ }, unmarshalDHCP);
308
+
309
+ /**
310
+ * Update a DHCP configuration. Update a DHCP configuration object, identified
311
+ * by its DHCP ID.
312
+ *
313
+ * @param request - The request {@link UpdateDHCPRequest}
314
+ * @returns A Promise of DHCP
315
+ */
316
+ updateDHCP = request => this.client.fetch({
317
+ body: JSON.stringify(marshalUpdateDHCPRequest(request, this.client.settings)),
318
+ headers: jsonContentHeaders,
319
+ method: 'PATCH',
320
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`
321
+ }, unmarshalDHCP);
322
+
323
+ /**
324
+ * Delete a DHCP configuration. Delete a DHCP configuration object, identified
325
+ * by its DHCP ID. Note that you cannot delete a DHCP configuration object
326
+ * that is currently being used by a Gateway Network.
327
+ *
328
+ * @param request - The request {@link DeleteDHCPRequest}
329
+ */
330
+ deleteDHCP = request => this.client.fetch({
331
+ method: 'DELETE',
332
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`
333
+ });
334
+ pageOfListDHCPEntries = (() => {
335
+ var _this7 = this;
336
+ return function (request) {
301
337
  if (request === void 0) {
302
338
  request = {};
303
339
  }
304
- return _this.client.fetch({
340
+ return _this7.client.fetch({
305
341
  method: 'GET',
306
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/dhcp-entries`,
307
- urlParams: urlParams(['gateway_network_id', request.gatewayNetworkId], ['hostname', request.hostname], ['ip_address', request.ipAddress], ['mac_address', request.macAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['type', request.type ?? 'unknown'])
342
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this7.client.settings.defaultZone)}/dhcp-entries`,
343
+ urlParams: urlParams(['gateway_network_id', request.gatewayNetworkId], ['hostname', request.hostname], ['ip_address', request.ipAddress], ['mac_address', request.macAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['type', request.type ?? 'unknown'])
308
344
  }, unmarshalListDHCPEntriesResponse);
309
345
  };
310
- /**
311
- * List DHCP entries. List DHCP entries, whether dynamically assigned and/or
312
- * statically reserved. DHCP entries can be filtered by the Gateway Network
313
- * they are on, their MAC address, IP address, type or hostname.
314
- *
315
- * @param request - The request {@link ListDHCPEntriesRequest}
316
- * @returns A Promise of ListDHCPEntriesResponse
317
- */
318
- this.listDHCPEntries = function (request) {
346
+ })();
347
+
348
+ /**
349
+ * List DHCP entries. List DHCP entries, whether dynamically assigned and/or
350
+ * statically reserved. DHCP entries can be filtered by the Gateway Network
351
+ * they are on, their MAC address, IP address, type or hostname.
352
+ *
353
+ * @param request - The request {@link ListDHCPEntriesRequest}
354
+ * @returns A Promise of ListDHCPEntriesResponse
355
+ */
356
+ listDHCPEntries = (() => {
357
+ var _this8 = this;
358
+ return function (request) {
319
359
  if (request === void 0) {
320
360
  request = {};
321
361
  }
322
- return enrichForPagination('dhcpEntries', _this.pageOfListDHCPEntries, request);
362
+ return enrichForPagination('dhcpEntries', _this8.pageOfListDHCPEntries, request);
323
363
  };
324
- /**
325
- * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.
326
- *
327
- * @param request - The request {@link GetDHCPEntryRequest}
328
- * @returns A Promise of DHCPEntry
329
- */
330
- this.getDHCPEntry = request => this.client.fetch({
331
- method: 'GET',
332
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`
333
- }, unmarshalDHCPEntry);
334
- /**
335
- * Create a DHCP entry. Create a static DHCP reservation, specifying the
336
- * Gateway Network for the reservation, the MAC address of the target device
337
- * and the IP address to assign this device. The response is a DHCP entry
338
- * object, confirming the ID and configuration details of the static DHCP
339
- * reservation.
340
- *
341
- * @param request - The request {@link CreateDHCPEntryRequest}
342
- * @returns A Promise of DHCPEntry
343
- */
344
- this.createDHCPEntry = request => this.client.fetch({
345
- body: JSON.stringify(marshalCreateDHCPEntryRequest(request, this.client.settings)),
346
- headers: jsonContentHeaders,
347
- method: 'POST',
348
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
349
- }, unmarshalDHCPEntry);
350
- /**
351
- * Update a DHCP entry. Update the IP address for a DHCP entry, specified by
352
- * its DHCP entry ID. You can update an existing DHCP entry of any type
353
- * (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually
354
- * updating the IP address the entry will necessarily be of type `reservation`
355
- * after the update.
356
- *
357
- * @param request - The request {@link UpdateDHCPEntryRequest}
358
- * @returns A Promise of DHCPEntry
359
- */
360
- this.updateDHCPEntry = request => this.client.fetch({
361
- body: JSON.stringify(marshalUpdateDHCPEntryRequest(request, this.client.settings)),
362
- headers: jsonContentHeaders,
363
- method: 'PATCH',
364
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`
365
- }, unmarshalDHCPEntry);
366
- /**
367
- * Set all DHCP reservations on a Gateway Network. Set the list of DHCP
368
- * reservations attached to a Gateway Network. Reservations are identified by
369
- * their MAC address, and will sync the current DHCP entry list to the given
370
- * list, creating, updating or deleting DHCP entries accordingly.
371
- *
372
- * @param request - The request {@link SetDHCPEntriesRequest}
373
- * @returns A Promise of SetDHCPEntriesResponse
374
- */
375
- this.setDHCPEntries = request => this.client.fetch({
376
- body: JSON.stringify(marshalSetDHCPEntriesRequest(request, this.client.settings)),
377
- headers: jsonContentHeaders,
378
- method: 'PUT',
379
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
380
- }, unmarshalSetDHCPEntriesResponse);
381
- /**
382
- * Delete a DHCP entry. Delete a static DHCP reservation, identified by its
383
- * DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`,
384
- * these are deleted automatically when their time-to-live expires.
385
- *
386
- * @param request - The request {@link DeleteDHCPEntryRequest}
387
- */
388
- this.deleteDHCPEntry = request => this.client.fetch({
389
- method: 'DELETE',
390
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`
391
- });
392
- this.pageOfListPATRules = function (request) {
364
+ })();
365
+
366
+ /**
367
+ * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.
368
+ *
369
+ * @param request - The request {@link GetDHCPEntryRequest}
370
+ * @returns A Promise of DHCPEntry
371
+ */
372
+ getDHCPEntry = request => this.client.fetch({
373
+ method: 'GET',
374
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`
375
+ }, unmarshalDHCPEntry);
376
+
377
+ /**
378
+ * Create a DHCP entry. Create a static DHCP reservation, specifying the
379
+ * Gateway Network for the reservation, the MAC address of the target device
380
+ * and the IP address to assign this device. The response is a DHCP entry
381
+ * object, confirming the ID and configuration details of the static DHCP
382
+ * reservation.
383
+ *
384
+ * @param request - The request {@link CreateDHCPEntryRequest}
385
+ * @returns A Promise of DHCPEntry
386
+ */
387
+ createDHCPEntry = request => this.client.fetch({
388
+ body: JSON.stringify(marshalCreateDHCPEntryRequest(request, this.client.settings)),
389
+ headers: jsonContentHeaders,
390
+ method: 'POST',
391
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
392
+ }, unmarshalDHCPEntry);
393
+
394
+ /**
395
+ * Update a DHCP entry. Update the IP address for a DHCP entry, specified by
396
+ * its DHCP entry ID. You can update an existing DHCP entry of any type
397
+ * (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually
398
+ * updating the IP address the entry will necessarily be of type `reservation`
399
+ * after the update.
400
+ *
401
+ * @param request - The request {@link UpdateDHCPEntryRequest}
402
+ * @returns A Promise of DHCPEntry
403
+ */
404
+ updateDHCPEntry = request => this.client.fetch({
405
+ body: JSON.stringify(marshalUpdateDHCPEntryRequest(request, this.client.settings)),
406
+ headers: jsonContentHeaders,
407
+ method: 'PATCH',
408
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`
409
+ }, unmarshalDHCPEntry);
410
+
411
+ /**
412
+ * Set all DHCP reservations on a Gateway Network. Set the list of DHCP
413
+ * reservations attached to a Gateway Network. Reservations are identified by
414
+ * their MAC address, and will sync the current DHCP entry list to the given
415
+ * list, creating, updating or deleting DHCP entries accordingly.
416
+ *
417
+ * @param request - The request {@link SetDHCPEntriesRequest}
418
+ * @returns A Promise of SetDHCPEntriesResponse
419
+ */
420
+ setDHCPEntries = request => this.client.fetch({
421
+ body: JSON.stringify(marshalSetDHCPEntriesRequest(request, this.client.settings)),
422
+ headers: jsonContentHeaders,
423
+ method: 'PUT',
424
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`
425
+ }, unmarshalSetDHCPEntriesResponse);
426
+
427
+ /**
428
+ * Delete a DHCP entry. Delete a static DHCP reservation, identified by its
429
+ * DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`,
430
+ * these are deleted automatically when their time-to-live expires.
431
+ *
432
+ * @param request - The request {@link DeleteDHCPEntryRequest}
433
+ */
434
+ deleteDHCPEntry = request => this.client.fetch({
435
+ method: 'DELETE',
436
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`
437
+ });
438
+ pageOfListPATRules = (() => {
439
+ var _this9 = this;
440
+ return function (request) {
393
441
  if (request === void 0) {
394
442
  request = {};
395
443
  }
396
- return _this.client.fetch({
444
+ return _this9.client.fetch({
397
445
  method: 'GET',
398
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/pat-rules`,
399
- urlParams: urlParams(['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['protocol', request.protocol ?? 'unknown'])
446
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this9.client.settings.defaultZone)}/pat-rules`,
447
+ urlParams: urlParams(['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['protocol', request.protocol ?? 'unknown'])
400
448
  }, unmarshalListPATRulesResponse);
401
449
  };
402
- /**
403
- * List PAT rules. List PAT rules. You can filter by gateway ID to list all
404
- * PAT rules for a particular gateway, or filter for PAT rules targeting a
405
- * specific IP address or using a specific protocol.
406
- *
407
- * @param request - The request {@link ListPATRulesRequest}
408
- * @returns A Promise of ListPATRulesResponse
409
- */
410
- this.listPATRules = function (request) {
450
+ })();
451
+
452
+ /**
453
+ * List PAT rules. List PAT rules. You can filter by gateway ID to list all
454
+ * PAT rules for a particular gateway, or filter for PAT rules targeting a
455
+ * specific IP address or using a specific protocol.
456
+ *
457
+ * @param request - The request {@link ListPATRulesRequest}
458
+ * @returns A Promise of ListPATRulesResponse
459
+ */
460
+ listPATRules = (() => {
461
+ var _this10 = this;
462
+ return function (request) {
411
463
  if (request === void 0) {
412
464
  request = {};
413
465
  }
414
- return enrichForPagination('patRules', _this.pageOfListPATRules, request);
466
+ return enrichForPagination('patRules', _this10.pageOfListPATRules, request);
415
467
  };
416
- /**
417
- * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response
418
- * object gives full details of the PAT rule, including the Public Gateway it
419
- * belongs to and the configuration settings in terms of public / private
420
- * ports, private IP and protocol.
421
- *
422
- * @param request - The request {@link GetPATRuleRequest}
423
- * @returns A Promise of PATRule
424
- */
425
- this.getPATRule = request => this.client.fetch({
426
- method: 'GET',
427
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`
428
- }, unmarshalPATRule);
429
- /**
430
- * Create a PAT rule. Create a new PAT rule on a specified Public Gateway,
431
- * defining the protocol to use, public port to listen on, and private port /
432
- * IP address to map to.
433
- *
434
- * @param request - The request {@link CreatePATRuleRequest}
435
- * @returns A Promise of PATRule
436
- */
437
- this.createPATRule = request => this.client.fetch({
438
- body: JSON.stringify(marshalCreatePATRuleRequest(request, this.client.settings)),
439
- headers: jsonContentHeaders,
440
- method: 'POST',
441
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`
442
- }, unmarshalPATRule);
443
- /**
444
- * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID.
445
- * Configuration settings including private/public port, private IP address
446
- * and protocol can all be updated.
447
- *
448
- * @param request - The request {@link UpdatePATRuleRequest}
449
- * @returns A Promise of PATRule
450
- */
451
- this.updatePATRule = request => this.client.fetch({
452
- body: JSON.stringify(marshalUpdatePATRuleRequest(request, this.client.settings)),
453
- headers: jsonContentHeaders,
454
- method: 'PATCH',
455
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`
456
- }, unmarshalPATRule);
457
- /**
458
- * Set all PAT rules. Set a definitive list of PAT rules attached to a Public
459
- * Gateway. Each rule is identified by its public port and protocol. This will
460
- * sync the current PAT rule list on the gateway with the new list, creating,
461
- * updating or deleting PAT rules accordingly.
462
- *
463
- * @param request - The request {@link SetPATRulesRequest}
464
- * @returns A Promise of SetPATRulesResponse
465
- */
466
- this.setPATRules = request => this.client.fetch({
467
- body: JSON.stringify(marshalSetPATRulesRequest(request, this.client.settings)),
468
- headers: jsonContentHeaders,
469
- method: 'PUT',
470
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`
471
- }, unmarshalSetPATRulesResponse);
472
- /**
473
- * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This
474
- * action is irreversible.
475
- *
476
- * @param request - The request {@link DeletePATRuleRequest}
477
- */
478
- this.deletePATRule = request => this.client.fetch({
479
- method: 'DELETE',
480
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`
481
- });
482
- /**
483
- * List Public Gateway types. List the different Public Gateway commercial
484
- * offer types available at Scaleway. The response is an array of objects
485
- * describing the name and technical details of each available gateway type.
486
- *
487
- * @param request - The request {@link ListGatewayTypesRequest}
488
- * @returns A Promise of ListGatewayTypesResponse
489
- */
490
- this.listGatewayTypes = function (request) {
468
+ })();
469
+
470
+ /**
471
+ * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response
472
+ * object gives full details of the PAT rule, including the Public Gateway it
473
+ * belongs to and the configuration settings in terms of public / private
474
+ * ports, private IP and protocol.
475
+ *
476
+ * @param request - The request {@link GetPATRuleRequest}
477
+ * @returns A Promise of PATRule
478
+ */
479
+ getPATRule = request => this.client.fetch({
480
+ method: 'GET',
481
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`
482
+ }, unmarshalPATRule);
483
+
484
+ /**
485
+ * Create a PAT rule. Create a new PAT rule on a specified Public Gateway,
486
+ * defining the protocol to use, public port to listen on, and private port /
487
+ * IP address to map to.
488
+ *
489
+ * @param request - The request {@link CreatePATRuleRequest}
490
+ * @returns A Promise of PATRule
491
+ */
492
+ createPATRule = request => this.client.fetch({
493
+ body: JSON.stringify(marshalCreatePATRuleRequest(request, this.client.settings)),
494
+ headers: jsonContentHeaders,
495
+ method: 'POST',
496
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`
497
+ }, unmarshalPATRule);
498
+
499
+ /**
500
+ * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID.
501
+ * Configuration settings including private/public port, private IP address
502
+ * and protocol can all be updated.
503
+ *
504
+ * @param request - The request {@link UpdatePATRuleRequest}
505
+ * @returns A Promise of PATRule
506
+ */
507
+ updatePATRule = request => this.client.fetch({
508
+ body: JSON.stringify(marshalUpdatePATRuleRequest(request, this.client.settings)),
509
+ headers: jsonContentHeaders,
510
+ method: 'PATCH',
511
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`
512
+ }, unmarshalPATRule);
513
+
514
+ /**
515
+ * Set all PAT rules. Set a definitive list of PAT rules attached to a Public
516
+ * Gateway. Each rule is identified by its public port and protocol. This will
517
+ * sync the current PAT rule list on the gateway with the new list, creating,
518
+ * updating or deleting PAT rules accordingly.
519
+ *
520
+ * @param request - The request {@link SetPATRulesRequest}
521
+ * @returns A Promise of SetPATRulesResponse
522
+ */
523
+ setPATRules = request => this.client.fetch({
524
+ body: JSON.stringify(marshalSetPATRulesRequest(request, this.client.settings)),
525
+ headers: jsonContentHeaders,
526
+ method: 'PUT',
527
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`
528
+ }, unmarshalSetPATRulesResponse);
529
+
530
+ /**
531
+ * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This
532
+ * action is irreversible.
533
+ *
534
+ * @param request - The request {@link DeletePATRuleRequest}
535
+ */
536
+ deletePATRule = request => this.client.fetch({
537
+ method: 'DELETE',
538
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`
539
+ });
540
+
541
+ /**
542
+ * List Public Gateway types. List the different Public Gateway commercial
543
+ * offer types available at Scaleway. The response is an array of objects
544
+ * describing the name and technical details of each available gateway type.
545
+ *
546
+ * @param request - The request {@link ListGatewayTypesRequest}
547
+ * @returns A Promise of ListGatewayTypesResponse
548
+ */
549
+ listGatewayTypes = (() => {
550
+ var _this11 = this;
551
+ return function (request) {
491
552
  if (request === void 0) {
492
553
  request = {};
493
554
  }
494
- return _this.client.fetch({
555
+ return _this11.client.fetch({
495
556
  method: 'GET',
496
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/gateway-types`
557
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this11.client.settings.defaultZone)}/gateway-types`
497
558
  }, unmarshalListGatewayTypesResponse);
498
559
  };
499
- this.pageOfListIPs = function (request) {
560
+ })();
561
+ pageOfListIPs = (() => {
562
+ var _this12 = this;
563
+ return function (request) {
500
564
  if (request === void 0) {
501
565
  request = {};
502
566
  }
503
- return _this.client.fetch({
567
+ return _this12.client.fetch({
504
568
  method: 'GET',
505
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/ips`,
506
- urlParams: urlParams(['is_free', request.isFree], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags])
569
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this12.client.settings.defaultZone)}/ips`,
570
+ urlParams: urlParams(['is_free', request.isFree], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this12.client.settings.defaultPageSize], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags])
507
571
  }, unmarshalListIPsResponse);
508
572
  };
509
- /**
510
- * List IPs. List Public Gateway flexible IP addresses. A number of filter
511
- * options are available for limiting results in the response.
512
- *
513
- * @param request - The request {@link ListIPsRequest}
514
- * @returns A Promise of ListIPsResponse
515
- */
516
- this.listIPs = function (request) {
573
+ })();
574
+
575
+ /**
576
+ * List IPs. List Public Gateway flexible IP addresses. A number of filter
577
+ * options are available for limiting results in the response.
578
+ *
579
+ * @param request - The request {@link ListIPsRequest}
580
+ * @returns A Promise of ListIPsResponse
581
+ */
582
+ listIPs = (() => {
583
+ var _this13 = this;
584
+ return function (request) {
517
585
  if (request === void 0) {
518
586
  request = {};
519
587
  }
520
- return enrichForPagination('ips', _this.pageOfListIPs, request);
588
+ return enrichForPagination('ips', _this13.pageOfListIPs, request);
521
589
  };
522
- /**
523
- * Get an IP. Get details of a Public Gateway flexible IP address, identified
524
- * by its IP ID. The response object contains information including which (if
525
- * any) Public Gateway using this IP address, the reverse and various other
526
- * metadata.
527
- *
528
- * @param request - The request {@link GetIPRequest}
529
- * @returns A Promise of IP
530
- */
531
- this.getIP = request => this.client.fetch({
532
- method: 'GET',
533
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
534
- }, unmarshalIP);
535
- /**
536
- * Reserve an IP. Create (reserve) a new flexible IP address that can be used
537
- * for a Public Gateway in a specified Scaleway Project.
538
- *
539
- * @param request - The request {@link CreateIPRequest}
540
- * @returns A Promise of IP
541
- */
542
- this.createIP = function (request) {
590
+ })();
591
+
592
+ /**
593
+ * Get an IP. Get details of a Public Gateway flexible IP address, identified
594
+ * by its IP ID. The response object contains information including which (if
595
+ * any) Public Gateway using this IP address, the reverse and various other
596
+ * metadata.
597
+ *
598
+ * @param request - The request {@link GetIPRequest}
599
+ * @returns A Promise of IP
600
+ */
601
+ getIP = request => this.client.fetch({
602
+ method: 'GET',
603
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
604
+ }, unmarshalIP);
605
+
606
+ /**
607
+ * Reserve an IP. Create (reserve) a new flexible IP address that can be used
608
+ * for a Public Gateway in a specified Scaleway Project.
609
+ *
610
+ * @param request - The request {@link CreateIPRequest}
611
+ * @returns A Promise of IP
612
+ */
613
+ createIP = (() => {
614
+ var _this14 = this;
615
+ return function (request) {
543
616
  if (request === void 0) {
544
617
  request = {};
545
618
  }
546
- return _this.client.fetch({
547
- body: JSON.stringify(marshalCreateIPRequest(request, _this.client.settings)),
619
+ return _this14.client.fetch({
620
+ body: JSON.stringify(marshalCreateIPRequest(request, _this14.client.settings)),
548
621
  headers: jsonContentHeaders,
549
622
  method: 'POST',
550
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this.client.settings.defaultZone)}/ips`
623
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? _this14.client.settings.defaultZone)}/ips`
551
624
  }, unmarshalIP);
552
625
  };
553
- /**
554
- * Update an IP. Update details of an existing flexible IP address, including
555
- * its tags, reverse and the Public Gateway it is assigned to.
556
- *
557
- * @param request - The request {@link UpdateIPRequest}
558
- * @returns A Promise of IP
559
- */
560
- this.updateIP = request => this.client.fetch({
561
- body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
562
- headers: jsonContentHeaders,
563
- method: 'PATCH',
564
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
565
- }, unmarshalIP);
566
- /**
567
- * Delete an IP. Delete a flexible IP address from your account. This action
568
- * is irreversible.
569
- *
570
- * @param request - The request {@link DeleteIPRequest}
571
- */
572
- this.deleteIP = request => this.client.fetch({
573
- method: 'DELETE',
574
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
575
- });
576
- /**
577
- * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public
578
- * Gateway, specified by its gateway ID. This adds any new SSH keys in the
579
- * gateway's Scaleway Project to the gateway itself.
580
- *
581
- * @param request - The request {@link RefreshSSHKeysRequest}
582
- * @returns A Promise of Gateway
583
- */
584
- this.refreshSSHKeys = request => this.client.fetch({
585
- body: '{}',
586
- headers: jsonContentHeaders,
587
- method: 'POST',
588
- path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/refresh-ssh-keys`
589
- }, unmarshalGateway);
590
- }
626
+ })();
627
+
628
+ /**
629
+ * Update an IP. Update details of an existing flexible IP address, including
630
+ * its tags, reverse and the Public Gateway it is assigned to.
631
+ *
632
+ * @param request - The request {@link UpdateIPRequest}
633
+ * @returns A Promise of IP
634
+ */
635
+ updateIP = request => this.client.fetch({
636
+ body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),
637
+ headers: jsonContentHeaders,
638
+ method: 'PATCH',
639
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
640
+ }, unmarshalIP);
641
+
642
+ /**
643
+ * Delete an IP. Delete a flexible IP address from your account. This action
644
+ * is irreversible.
645
+ *
646
+ * @param request - The request {@link DeleteIPRequest}
647
+ */
648
+ deleteIP = request => this.client.fetch({
649
+ method: 'DELETE',
650
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`
651
+ });
652
+
653
+ /**
654
+ * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public
655
+ * Gateway, specified by its gateway ID. This adds any new SSH keys in the
656
+ * gateway's Scaleway Project to the gateway itself.
657
+ *
658
+ * @param request - The request {@link RefreshSSHKeysRequest}
659
+ * @returns A Promise of Gateway
660
+ */
661
+ refreshSSHKeys = request => this.client.fetch({
662
+ body: '{}',
663
+ headers: jsonContentHeaders,
664
+ method: 'POST',
665
+ path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/refresh-ssh-keys`
666
+ }, unmarshalGateway);
591
667
  }
592
- /** Lists the available zones of the API. */
593
- API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];
594
668
 
595
669
  export { API };