@scaleway/sdk 2.49.1 → 2.51.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 (71) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs +1 -0
  2. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -0
  3. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +8 -0
  4. package/dist/api/baremetal/v1/marshalling.gen.cjs +3 -1
  5. package/dist/api/baremetal/v1/marshalling.gen.js +3 -1
  6. package/dist/api/baremetal/v1/types.gen.d.ts +4 -3
  7. package/dist/api/dedibox/v1/types.gen.d.ts +1 -1
  8. package/dist/api/edge_services/v1alpha1/api.gen.cjs +39 -0
  9. package/dist/api/edge_services/v1alpha1/api.gen.d.ts +16 -1
  10. package/dist/api/edge_services/v1alpha1/api.gen.js +40 -1
  11. package/dist/api/edge_services/v1alpha1/index.gen.d.ts +1 -1
  12. package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +54 -6
  13. package/dist/api/edge_services/v1alpha1/marshalling.gen.d.ts +4 -1
  14. package/dist/api/edge_services/v1alpha1/marshalling.gen.js +54 -6
  15. package/dist/api/edge_services/v1alpha1/types.gen.d.ts +64 -1
  16. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +9 -0
  17. package/dist/api/iam/v1alpha1/marshalling.gen.js +9 -0
  18. package/dist/api/iam/v1alpha1/types.gen.d.ts +18 -0
  19. package/dist/api/index.gen.d.ts +2 -1
  20. package/dist/api/inference/v1beta1/validation-rules.gen.cjs +1 -1
  21. package/dist/api/inference/v1beta1/validation-rules.gen.js +1 -1
  22. package/dist/api/instance/v1/api.gen.cjs +0 -37
  23. package/dist/api/instance/v1/api.gen.d.ts +1 -21
  24. package/dist/api/instance/v1/api.gen.js +1 -38
  25. package/dist/api/instance/v1/index.gen.d.ts +1 -1
  26. package/dist/api/instance/v1/marshalling.gen.cjs +1 -28
  27. package/dist/api/instance/v1/marshalling.gen.d.ts +1 -3
  28. package/dist/api/instance/v1/marshalling.gen.js +1 -28
  29. package/dist/api/instance/v1/types.gen.d.ts +9 -53
  30. package/dist/api/instance/v1/types.private.gen.d.ts +1 -3
  31. package/dist/api/jobs/v1alpha1/api.gen.cjs +46 -0
  32. package/dist/api/jobs/v1alpha1/api.gen.d.ts +6 -1
  33. package/dist/api/jobs/v1alpha1/api.gen.js +47 -1
  34. package/dist/api/jobs/v1alpha1/index.gen.d.ts +1 -1
  35. package/dist/api/jobs/v1alpha1/marshalling.gen.cjs +80 -0
  36. package/dist/api/jobs/v1alpha1/marshalling.gen.d.ts +6 -1
  37. package/dist/api/jobs/v1alpha1/marshalling.gen.js +81 -1
  38. package/dist/api/jobs/v1alpha1/types.gen.d.ts +81 -0
  39. package/dist/api/jobs/v1alpha1/validation-rules.gen.cjs +14 -2
  40. package/dist/api/jobs/v1alpha1/validation-rules.gen.d.ts +10 -0
  41. package/dist/api/jobs/v1alpha1/validation-rules.gen.js +15 -3
  42. package/dist/api/mongodb/index.gen.cjs +4 -0
  43. package/dist/api/mongodb/index.gen.d.ts +5 -0
  44. package/dist/api/mongodb/index.gen.js +4 -0
  45. package/dist/api/mongodb/v1alpha1/api.gen.cjs +385 -0
  46. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +195 -0
  47. package/dist/api/mongodb/v1alpha1/api.gen.js +385 -0
  48. package/dist/api/mongodb/v1alpha1/content.gen.cjs +16 -0
  49. package/dist/api/mongodb/v1alpha1/content.gen.d.ts +5 -0
  50. package/dist/api/mongodb/v1alpha1/content.gen.js +16 -0
  51. package/dist/api/mongodb/v1alpha1/index.gen.cjs +9 -0
  52. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +4 -0
  53. package/dist/api/mongodb/v1alpha1/index.gen.js +9 -0
  54. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +326 -0
  55. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +19 -0
  56. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +326 -0
  57. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +461 -0
  58. package/dist/api/mongodb/v1alpha1/validation-rules.gen.cjs +147 -0
  59. package/dist/api/mongodb/v1alpha1/validation-rules.gen.d.ts +134 -0
  60. package/dist/api/mongodb/v1alpha1/validation-rules.gen.js +147 -0
  61. package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
  62. package/dist/api/tem/v1alpha1/marshalling.gen.cjs +13 -0
  63. package/dist/api/tem/v1alpha1/marshalling.gen.js +13 -0
  64. package/dist/api/tem/v1alpha1/types.gen.d.ts +13 -2
  65. package/dist/api/webhosting/v1alpha1/types.gen.d.ts +1 -1
  66. package/dist/index.cjs +16 -14
  67. package/dist/index.js +16 -14
  68. package/dist/scw/constants.cjs +1 -1
  69. package/dist/scw/constants.d.ts +2 -2
  70. package/dist/scw/constants.js +1 -1
  71. package/package.json +2 -2
@@ -5,7 +5,7 @@ const CreateJobDefinitionRequest = {
5
5
  greaterThan: 0
6
6
  },
7
7
  imageUri: {
8
- pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
8
+ pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
9
9
  },
10
10
  localStorageCapacity: {
11
11
  greaterThan: 0
@@ -27,6 +27,11 @@ const CreateJobDefinitionRequestCronScheduleConfig = {
27
27
  minLength: 1
28
28
  }
29
29
  };
30
+ const CreateJobDefinitionSecretsRequestSecretConfig = {
31
+ secretManagerVersion: {
32
+ minLength: 1
33
+ }
34
+ };
30
35
  const CronSchedule = {
31
36
  schedule: {
32
37
  maxLength: 255,
@@ -65,7 +70,7 @@ const UpdateJobDefinitionRequest = {
65
70
  greaterThan: 0
66
71
  },
67
72
  imageUri: {
68
- pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
73
+ pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
69
74
  },
70
75
  localStorageCapacity: {
71
76
  greaterThan: 0
@@ -87,11 +92,18 @@ const UpdateJobDefinitionRequestCronScheduleConfig = {
87
92
  minLength: 1
88
93
  }
89
94
  };
95
+ const UpdateJobDefinitionSecretRequest = {
96
+ secretManagerVersion: {
97
+ minLength: 1
98
+ }
99
+ };
90
100
  exports.CreateJobDefinitionRequest = CreateJobDefinitionRequest;
91
101
  exports.CreateJobDefinitionRequestCronScheduleConfig = CreateJobDefinitionRequestCronScheduleConfig;
102
+ exports.CreateJobDefinitionSecretsRequestSecretConfig = CreateJobDefinitionSecretsRequestSecretConfig;
92
103
  exports.CronSchedule = CronSchedule;
93
104
  exports.ListJobDefinitionsRequest = ListJobDefinitionsRequest;
94
105
  exports.ListJobRunsRequest = ListJobRunsRequest;
95
106
  exports.StartJobDefinitionRequest = StartJobDefinitionRequest;
96
107
  exports.UpdateJobDefinitionRequest = UpdateJobDefinitionRequest;
97
108
  exports.UpdateJobDefinitionRequestCronScheduleConfig = UpdateJobDefinitionRequestCronScheduleConfig;
109
+ exports.UpdateJobDefinitionSecretRequest = UpdateJobDefinitionSecretRequest;
@@ -25,6 +25,11 @@ export declare const CreateJobDefinitionRequestCronScheduleConfig: {
25
25
  minLength: number;
26
26
  };
27
27
  };
28
+ export declare const CreateJobDefinitionSecretsRequestSecretConfig: {
29
+ secretManagerVersion: {
30
+ minLength: number;
31
+ };
32
+ };
28
33
  export declare const CronSchedule: {
29
34
  schedule: {
30
35
  maxLength: number;
@@ -85,3 +90,8 @@ export declare const UpdateJobDefinitionRequestCronScheduleConfig: {
85
90
  minLength: number;
86
91
  };
87
92
  };
93
+ export declare const UpdateJobDefinitionSecretRequest: {
94
+ secretManagerVersion: {
95
+ minLength: number;
96
+ };
97
+ };
@@ -3,7 +3,7 @@ const CreateJobDefinitionRequest = {
3
3
  greaterThan: 0
4
4
  },
5
5
  imageUri: {
6
- pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
6
+ pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
7
7
  },
8
8
  localStorageCapacity: {
9
9
  greaterThan: 0
@@ -25,6 +25,11 @@ const CreateJobDefinitionRequestCronScheduleConfig = {
25
25
  minLength: 1
26
26
  }
27
27
  };
28
+ const CreateJobDefinitionSecretsRequestSecretConfig = {
29
+ secretManagerVersion: {
30
+ minLength: 1
31
+ }
32
+ };
28
33
  const CronSchedule = {
29
34
  schedule: {
30
35
  maxLength: 255,
@@ -63,7 +68,7 @@ const UpdateJobDefinitionRequest = {
63
68
  greaterThan: 0
64
69
  },
65
70
  imageUri: {
66
- pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
71
+ pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::(\w[A-Za-z0-9_.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/
67
72
  },
68
73
  localStorageCapacity: {
69
74
  greaterThan: 0
@@ -85,13 +90,20 @@ const UpdateJobDefinitionRequestCronScheduleConfig = {
85
90
  minLength: 1
86
91
  }
87
92
  };
93
+ const UpdateJobDefinitionSecretRequest = {
94
+ secretManagerVersion: {
95
+ minLength: 1
96
+ }
97
+ };
88
98
  export {
89
99
  CreateJobDefinitionRequest,
90
100
  CreateJobDefinitionRequestCronScheduleConfig,
101
+ CreateJobDefinitionSecretsRequestSecretConfig,
91
102
  CronSchedule,
92
103
  ListJobDefinitionsRequest,
93
104
  ListJobRunsRequest,
94
105
  StartJobDefinitionRequest,
95
106
  UpdateJobDefinitionRequest,
96
- UpdateJobDefinitionRequestCronScheduleConfig
107
+ UpdateJobDefinitionRequestCronScheduleConfig,
108
+ UpdateJobDefinitionSecretRequest
97
109
  };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const index_gen = require("./v1alpha1/index.gen.cjs");
4
+ exports.v1alpha1 = index_gen;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated from /scripts/generate.js PLEASE DO NOT
3
+ * EDIT HERE
4
+ */
5
+ export * as v1alpha1 from './v1alpha1/index.gen';
@@ -0,0 +1,4 @@
1
+ import * as index_gen from "./v1alpha1/index.gen.js";
2
+ export {
3
+ index_gen as v1alpha1
4
+ };
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const intervalRetrier = require("../../../internal/async/interval-retrier.cjs");
4
+ const api = require("../../../scw/api.cjs");
5
+ const marshalling = require("../../../helpers/marshalling.cjs");
6
+ require("../../../vendor/base64/index.cjs");
7
+ const resourcePaginator = require("../../../scw/fetch/resource-paginator.cjs");
8
+ const content_gen = require("./content.gen.cjs");
9
+ const marshalling_gen = require("./marshalling.gen.cjs");
10
+ const jsonContentHeaders = {
11
+ "Content-Type": "application/json; charset=utf-8"
12
+ };
13
+ class API extends api.API {
14
+ /** Lists the available regions of the API. */
15
+ static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"];
16
+ pageOfListNodeTypes = (request = {}) => this.client.fetch(
17
+ {
18
+ method: "GET",
19
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
20
+ urlParams: marshalling.urlParams(
21
+ ["include_disabled_types", request.includeDisabledTypes],
22
+ ["page", request.page],
23
+ [
24
+ "page_size",
25
+ request.pageSize ?? this.client.settings.defaultPageSize
26
+ ]
27
+ )
28
+ },
29
+ marshalling_gen.unmarshalListNodeTypesResponse
30
+ );
31
+ /**
32
+ * List available node types.
33
+ *
34
+ * @param request - The request {@link ListNodeTypesRequest}
35
+ * @returns A Promise of ListNodeTypesResponse
36
+ */
37
+ listNodeTypes = (request = {}) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
38
+ pageOfListVersions = (request = {}) => this.client.fetch(
39
+ {
40
+ method: "GET",
41
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
42
+ urlParams: marshalling.urlParams(
43
+ ["page", request.page],
44
+ [
45
+ "page_size",
46
+ request.pageSize ?? this.client.settings.defaultPageSize
47
+ ],
48
+ ["version", request.version]
49
+ )
50
+ },
51
+ marshalling_gen.unmarshalListVersionsResponse
52
+ );
53
+ /**
54
+ * List available MongoDB™ versions.
55
+ *
56
+ * @param request - The request {@link ListVersionsRequest}
57
+ * @returns A Promise of ListVersionsResponse
58
+ */
59
+ listVersions = (request = {}) => resourcePaginator.enrichForPagination("versions", this.pageOfListVersions, request);
60
+ pageOfListInstances = (request = {}) => this.client.fetch(
61
+ {
62
+ method: "GET",
63
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`,
64
+ urlParams: marshalling.urlParams(
65
+ ["name", request.name],
66
+ ["order_by", request.orderBy],
67
+ [
68
+ "organization_id",
69
+ request.organizationId ?? this.client.settings.defaultOrganizationId
70
+ ],
71
+ ["page", request.page],
72
+ [
73
+ "page_size",
74
+ request.pageSize ?? this.client.settings.defaultPageSize
75
+ ],
76
+ [
77
+ "project_id",
78
+ request.projectId ?? this.client.settings.defaultProjectId
79
+ ],
80
+ ["tags", request.tags]
81
+ )
82
+ },
83
+ marshalling_gen.unmarshalListInstancesResponse
84
+ );
85
+ /**
86
+ * List MongoDB™ Database Instances. List all MongoDB™ Database Instances in
87
+ * the specified region, for a given Scaleway Project. By default, the
88
+ * MongoDB™ Database Instances returned in the list are ordered by creation
89
+ * date in ascending order, though this can be modified via the order_by
90
+ * field. You can define additional parameters for your query, such as `tags`
91
+ * and `name`. For the `name` parameter, the value you include will be checked
92
+ * against the whole name string to see if it includes the string you put in
93
+ * the parameter.
94
+ *
95
+ * @param request - The request {@link ListInstancesRequest}
96
+ * @returns A Promise of ListInstancesResponse
97
+ */
98
+ listInstances = (request = {}) => resourcePaginator.enrichForPagination("instances", this.pageOfListInstances, request);
99
+ /**
100
+ * Get a MongoDB™ Database Instance. Retrieve information about a given
101
+ * MongoDB™ Database Instance, specified by the `region` and `instance_id`
102
+ * parameters. Its full details, including name, status, IP address and port,
103
+ * are returned in the response object.
104
+ *
105
+ * @param request - The request {@link GetInstanceRequest}
106
+ * @returns A Promise of Instance
107
+ */
108
+ getInstance = (request) => this.client.fetch(
109
+ {
110
+ method: "GET",
111
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}`
112
+ },
113
+ marshalling_gen.unmarshalInstance
114
+ );
115
+ /**
116
+ * Waits for {@link Instance} to be in a final state.
117
+ *
118
+ * @param request - The request {@link GetInstanceRequest}
119
+ * @param options - The waiting options
120
+ * @returns A Promise of Instance
121
+ */
122
+ waitForInstance = (request, options) => intervalRetrier.waitForResource(
123
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status))),
124
+ this.getInstance,
125
+ request,
126
+ options
127
+ );
128
+ /**
129
+ * Create a MongoDB™ Database Instance. Create a new MongoDB™ Database
130
+ * Instance.
131
+ *
132
+ * @param request - The request {@link CreateInstanceRequest}
133
+ * @returns A Promise of Instance
134
+ */
135
+ createInstance = (request) => this.client.fetch(
136
+ {
137
+ body: JSON.stringify(
138
+ marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings)
139
+ ),
140
+ headers: jsonContentHeaders,
141
+ method: "POST",
142
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`
143
+ },
144
+ marshalling_gen.unmarshalInstance
145
+ );
146
+ /**
147
+ * Update a MongoDB™ Database Instance. Update the parameters of a MongoDB™
148
+ * Database Instance.
149
+ *
150
+ * @param request - The request {@link UpdateInstanceRequest}
151
+ * @returns A Promise of Instance
152
+ */
153
+ updateInstance = (request) => this.client.fetch(
154
+ {
155
+ body: JSON.stringify(
156
+ marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings)
157
+ ),
158
+ headers: jsonContentHeaders,
159
+ method: "PATCH",
160
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}`
161
+ },
162
+ marshalling_gen.unmarshalInstance
163
+ );
164
+ /**
165
+ * Delete a MongoDB™ Database Instance. Delete a given MongoDB™ Database
166
+ * Instance, specified by the `region` and `instance_id` parameters. Deleting
167
+ * a MongoDB™ Database Instance is permanent, and cannot be undone. Note that
168
+ * upon deletion all your data will be lost.
169
+ *
170
+ * @param request - The request {@link DeleteInstanceRequest}
171
+ * @returns A Promise of Instance
172
+ */
173
+ deleteInstance = (request) => this.client.fetch(
174
+ {
175
+ method: "DELETE",
176
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}`
177
+ },
178
+ marshalling_gen.unmarshalInstance
179
+ );
180
+ /**
181
+ * Upgrade a Database Instance. Upgrade your current Database Instance
182
+ * specifications like volume size.
183
+ *
184
+ * @param request - The request {@link UpgradeInstanceRequest}
185
+ * @returns A Promise of Instance
186
+ */
187
+ upgradeInstance = (request) => this.client.fetch(
188
+ {
189
+ body: JSON.stringify(
190
+ marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings)
191
+ ),
192
+ headers: jsonContentHeaders,
193
+ method: "POST",
194
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/upgrade`
195
+ },
196
+ marshalling_gen.unmarshalInstance
197
+ );
198
+ /**
199
+ * Get the certificate of a Database Instance. Retrieve the certificate of a
200
+ * given Database Instance, specified by the `instance_id` parameter.
201
+ *
202
+ * @param request - The request {@link GetInstanceCertificateRequest}
203
+ * @returns A Promise of Blob
204
+ */
205
+ getInstanceCertificate = (request) => this.client.fetch({
206
+ method: "GET",
207
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/certificate`,
208
+ urlParams: marshalling.urlParams(["dl", 1]),
209
+ responseType: "blob"
210
+ });
211
+ /**
212
+ * Create a Database Instance snapshot. Create a new snapshot of a Database
213
+ * Instance. You must define the `name` and `instance_id` parameters in the
214
+ * request.
215
+ *
216
+ * @param request - The request {@link CreateSnapshotRequest}
217
+ * @returns A Promise of Snapshot
218
+ */
219
+ createSnapshot = (request) => this.client.fetch(
220
+ {
221
+ body: JSON.stringify(
222
+ marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)
223
+ ),
224
+ headers: jsonContentHeaders,
225
+ method: "POST",
226
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/snapshots`
227
+ },
228
+ marshalling_gen.unmarshalSnapshot
229
+ );
230
+ /**
231
+ * Get a Database Instance snapshot. Retrieve information about a given
232
+ * snapshot of a Database Instance. You must specify, in the endpoint, the
233
+ * `snapshot_id` parameter of the snapshot you want to retrieve.
234
+ *
235
+ * @param request - The request {@link GetSnapshotRequest}
236
+ * @returns A Promise of Snapshot
237
+ */
238
+ getSnapshot = (request) => this.client.fetch(
239
+ {
240
+ method: "GET",
241
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}`
242
+ },
243
+ marshalling_gen.unmarshalSnapshot
244
+ );
245
+ /**
246
+ * Waits for {@link Snapshot} to be in a final state.
247
+ *
248
+ * @param request - The request {@link GetSnapshotRequest}
249
+ * @param options - The waiting options
250
+ * @returns A Promise of Snapshot
251
+ */
252
+ waitForSnapshot = (request, options) => intervalRetrier.waitForResource(
253
+ options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),
254
+ this.getSnapshot,
255
+ request,
256
+ options
257
+ );
258
+ updateSnapshot = (request) => this.client.fetch(
259
+ {
260
+ body: JSON.stringify(
261
+ marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)
262
+ ),
263
+ headers: jsonContentHeaders,
264
+ method: "POST",
265
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}`
266
+ },
267
+ marshalling_gen.unmarshalSnapshot
268
+ );
269
+ /**
270
+ * Restore a Database Instance snapshot. Restore a given snapshot of a
271
+ * Database Instance. You must specify, in the endpoint, the `snapshot_id`
272
+ * parameter of the snapshot you want to restore, the `instance_name` of the
273
+ * new Database Instance, `node_type` of the new Database Instance and
274
+ * `node_number` of the new Database Instance.
275
+ *
276
+ * @param request - The request {@link RestoreSnapshotRequest}
277
+ * @returns A Promise of Instance
278
+ */
279
+ restoreSnapshot = (request) => this.client.fetch(
280
+ {
281
+ body: JSON.stringify(
282
+ marshalling_gen.marshalRestoreSnapshotRequest(request, this.client.settings)
283
+ ),
284
+ headers: jsonContentHeaders,
285
+ method: "POST",
286
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}/restore`
287
+ },
288
+ marshalling_gen.unmarshalInstance
289
+ );
290
+ pageOfListSnapshots = (request = {}) => this.client.fetch(
291
+ {
292
+ method: "GET",
293
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`,
294
+ urlParams: marshalling.urlParams(
295
+ ["instance_id", request.instanceId],
296
+ ["name", request.name],
297
+ ["order_by", request.orderBy],
298
+ [
299
+ "organization_id",
300
+ request.organizationId ?? this.client.settings.defaultOrganizationId
301
+ ],
302
+ ["page", request.page],
303
+ [
304
+ "page_size",
305
+ request.pageSize ?? this.client.settings.defaultPageSize
306
+ ],
307
+ [
308
+ "project_id",
309
+ request.projectId ?? this.client.settings.defaultProjectId
310
+ ]
311
+ )
312
+ },
313
+ marshalling_gen.unmarshalListSnapshotsResponse
314
+ );
315
+ /**
316
+ * List snapshots. List snapshots. You can include the `instance_id` or
317
+ * `project_id` in your query to get the list of snapshots for specific
318
+ * Database Instances and/or Projects. By default, the details returned in the
319
+ * list are ordered by creation date in ascending order, though this can be
320
+ * modified via the `order_by` field.
321
+ *
322
+ * @param request - The request {@link ListSnapshotsRequest}
323
+ * @returns A Promise of ListSnapshotsResponse
324
+ */
325
+ listSnapshots = (request = {}) => resourcePaginator.enrichForPagination("snapshots", this.pageOfListSnapshots, request);
326
+ /**
327
+ * Delete a Database Instance snapshot. Delete a given snapshot of a Database
328
+ * Instance. You must specify, in the endpoint, the `snapshot_id` parameter of
329
+ * the snapshot you want to delete.
330
+ *
331
+ * @param request - The request {@link DeleteSnapshotRequest}
332
+ * @returns A Promise of Snapshot
333
+ */
334
+ deleteSnapshot = (request) => this.client.fetch(
335
+ {
336
+ method: "DELETE",
337
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}`
338
+ },
339
+ marshalling_gen.unmarshalSnapshot
340
+ );
341
+ pageOfListUsers = (request) => this.client.fetch(
342
+ {
343
+ method: "GET",
344
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users`,
345
+ urlParams: marshalling.urlParams(
346
+ ["name", request.name],
347
+ ["order_by", request.orderBy],
348
+ ["page", request.page],
349
+ [
350
+ "page_size",
351
+ request.pageSize ?? this.client.settings.defaultPageSize
352
+ ]
353
+ )
354
+ },
355
+ marshalling_gen.unmarshalListUsersResponse
356
+ );
357
+ /**
358
+ * List users of a Database Instance. List all users of a given Database
359
+ * Instance.
360
+ *
361
+ * @param request - The request {@link ListUsersRequest}
362
+ * @returns A Promise of ListUsersResponse
363
+ */
364
+ listUsers = (request) => resourcePaginator.enrichForPagination("users", this.pageOfListUsers, request);
365
+ /**
366
+ * Update a user on a Database Instance. Update the parameters of a user on a
367
+ * Database Instance. You can update the `password` parameter, but you cannot
368
+ * change the name of the user.
369
+ *
370
+ * @param request - The request {@link UpdateUserRequest}
371
+ * @returns A Promise of User
372
+ */
373
+ updateUser = (request) => this.client.fetch(
374
+ {
375
+ body: JSON.stringify(
376
+ marshalling_gen.marshalUpdateUserRequest(request, this.client.settings)
377
+ ),
378
+ headers: jsonContentHeaders,
379
+ method: "PATCH",
380
+ path: `/mongodb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users/${marshalling.validatePathParam("name", request.name)}`
381
+ },
382
+ marshalling_gen.unmarshalUser
383
+ );
384
+ }
385
+ exports.API = API;