@scaleway/sdk 2.54.0 → 2.56.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 (50) hide show
  1. package/dist/api/applesilicon/v1alpha1/content.gen.cjs +2 -1
  2. package/dist/api/applesilicon/v1alpha1/content.gen.js +2 -1
  3. package/dist/api/applesilicon/v1alpha1/types.gen.d.ts +1 -1
  4. package/dist/api/block/v1alpha1/api.gen.cjs +1 -1
  5. package/dist/api/block/v1alpha1/api.gen.d.ts +1 -1
  6. package/dist/api/block/v1alpha1/api.gen.js +1 -1
  7. package/dist/api/block/v1alpha1/marshalling.gen.cjs +3 -2
  8. package/dist/api/block/v1alpha1/marshalling.gen.js +3 -2
  9. package/dist/api/block/v1alpha1/types.gen.d.ts +2 -2
  10. package/dist/api/cockpit/v1/marshalling.gen.cjs +5 -3
  11. package/dist/api/cockpit/v1/marshalling.gen.js +5 -3
  12. package/dist/api/cockpit/v1/types.gen.d.ts +11 -7
  13. package/dist/api/iam/v1alpha1/api.gen.cjs +14 -0
  14. package/dist/api/iam/v1alpha1/api.gen.d.ts +8 -1
  15. package/dist/api/iam/v1alpha1/api.gen.js +15 -1
  16. package/dist/api/iam/v1alpha1/index.gen.d.ts +1 -1
  17. package/dist/api/iam/v1alpha1/marshalling.gen.cjs +28 -0
  18. package/dist/api/iam/v1alpha1/marshalling.gen.d.ts +2 -1
  19. package/dist/api/iam/v1alpha1/marshalling.gen.js +28 -0
  20. package/dist/api/iam/v1alpha1/types.gen.d.ts +26 -0
  21. package/dist/api/instance/v1/api.gen.cjs +32 -14
  22. package/dist/api/instance/v1/api.gen.d.ts +32 -14
  23. package/dist/api/instance/v1/api.gen.js +32 -14
  24. package/dist/api/instance/v1/types.gen.d.ts +17 -10
  25. package/dist/api/k8s/v1/marshalling.gen.cjs +2 -1
  26. package/dist/api/k8s/v1/marshalling.gen.js +2 -1
  27. package/dist/api/k8s/v1/types.gen.d.ts +1 -0
  28. package/dist/api/mongodb/v1alpha1/api.gen.cjs +31 -0
  29. package/dist/api/mongodb/v1alpha1/api.gen.d.ts +19 -1
  30. package/dist/api/mongodb/v1alpha1/api.gen.js +32 -1
  31. package/dist/api/mongodb/v1alpha1/index.gen.d.ts +1 -1
  32. package/dist/api/mongodb/v1alpha1/marshalling.gen.cjs +10 -4
  33. package/dist/api/mongodb/v1alpha1/marshalling.gen.d.ts +3 -1
  34. package/dist/api/mongodb/v1alpha1/marshalling.gen.js +10 -4
  35. package/dist/api/mongodb/v1alpha1/types.gen.d.ts +26 -6
  36. package/dist/api/webhosting/v1/api.gen.cjs +14 -0
  37. package/dist/api/webhosting/v1/api.gen.d.ts +9 -1
  38. package/dist/api/webhosting/v1/api.gen.js +15 -1
  39. package/dist/api/webhosting/v1/index.gen.d.ts +1 -1
  40. package/dist/api/webhosting/v1/marshalling.gen.cjs +14 -0
  41. package/dist/api/webhosting/v1/marshalling.gen.d.ts +2 -1
  42. package/dist/api/webhosting/v1/marshalling.gen.js +14 -0
  43. package/dist/api/webhosting/v1/types.gen.d.ts +19 -0
  44. package/dist/scw/client.cjs +4 -1
  45. package/dist/scw/client.d.ts +1 -2
  46. package/dist/scw/client.js +5 -2
  47. package/dist/scw/constants.cjs +1 -1
  48. package/dist/scw/constants.d.ts +2 -2
  49. package/dist/scw/constants.js +1 -1
  50. package/package.json +2 -2
@@ -6,6 +6,7 @@ const SERVER_TRANSIENT_STATUSES = [
6
6
  "updating",
7
7
  "locking",
8
8
  "unlocking",
9
- "reinstalling"
9
+ "reinstalling",
10
+ "busy"
10
11
  ];
11
12
  exports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES;
@@ -4,7 +4,8 @@ const SERVER_TRANSIENT_STATUSES = [
4
4
  "updating",
5
5
  "locking",
6
6
  "unlocking",
7
- "reinstalling"
7
+ "reinstalling",
8
+ "busy"
8
9
  ];
9
10
  export {
10
11
  SERVER_TRANSIENT_STATUSES
@@ -2,7 +2,7 @@ import type { Zone } from '../../../bridge';
2
2
  export type ConnectivityDiagnosticActionType = 'reboot_server' | 'reinstall_server';
3
3
  export type ConnectivityDiagnosticDiagnosticStatus = 'unknown_status' | 'processing' | 'error' | 'completed';
4
4
  export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc';
5
- export type ServerStatus = 'unknown_status' | 'starting' | 'ready' | 'error' | 'rebooting' | 'updating' | 'locking' | 'locked' | 'unlocking' | 'reinstalling';
5
+ export type ServerStatus = 'unknown_status' | 'starting' | 'ready' | 'error' | 'rebooting' | 'updating' | 'locking' | 'locked' | 'unlocking' | 'reinstalling' | 'busy';
6
6
  export type ServerTypeStock = 'unknown_stock' | 'no_stock' | 'low_stock' | 'high_stock';
7
7
  export interface OS {
8
8
  /** Unique ID of the OS. */
@@ -85,7 +85,7 @@ class API extends api.API {
85
85
  * @param request - The request {@link CreateVolumeRequest}
86
86
  * @returns A Promise of Volume
87
87
  */
88
- createVolume = (request) => this.client.fetch(
88
+ createVolume = (request = {}) => this.client.fetch(
89
89
  {
90
90
  body: JSON.stringify(
91
91
  marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings)
@@ -45,7 +45,7 @@ export declare class API extends ParentAPI {
45
45
  * @param request - The request {@link CreateVolumeRequest}
46
46
  * @returns A Promise of Volume
47
47
  */
48
- createVolume: (request: Readonly<CreateVolumeRequest>) => Promise<Volume>;
48
+ createVolume: (request?: Readonly<CreateVolumeRequest>) => Promise<Volume>;
49
49
  /**
50
50
  * Get a volume. Retrieve technical information about a specific volume.
51
51
  * Details such as size, type, and status are returned in the response.
@@ -83,7 +83,7 @@ class API extends API$1 {
83
83
  * @param request - The request {@link CreateVolumeRequest}
84
84
  * @returns A Promise of Volume
85
85
  */
86
- createVolume = (request) => this.client.fetch(
86
+ createVolume = (request = {}) => this.client.fetch(
87
87
  {
88
88
  body: JSON.stringify(
89
89
  marshalCreateVolumeRequest(request, this.client.settings)
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const randomName = require("@scaleway/random-name");
3
4
  const json = require("../../../helpers/json.cjs");
4
5
  const customMarshalling = require("../../../scw/custom-marshalling.cjs");
5
6
  const marshalling = require("../../../helpers/marshalling.cjs");
@@ -133,7 +134,7 @@ const unmarshalListVolumesResponse = (data) => {
133
134
  };
134
135
  };
135
136
  const marshalCreateSnapshotRequest = (request, defaults) => ({
136
- name: request.name,
137
+ name: request.name || randomName("snp"),
137
138
  project_id: request.projectId ?? defaults.defaultProjectId,
138
139
  tags: request.tags,
139
140
  volume_id: request.volumeId
@@ -146,7 +147,7 @@ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
146
147
  snapshot_id: request.snapshotId
147
148
  });
148
149
  const marshalCreateVolumeRequest = (request, defaults) => ({
149
- name: request.name,
150
+ name: request.name || randomName("vol"),
150
151
  project_id: request.projectId ?? defaults.defaultProjectId,
151
152
  tags: request.tags,
152
153
  ...marshalling.resolveOneOf([
@@ -1,3 +1,4 @@
1
+ import randomName from "@scaleway/random-name";
1
2
  import { isJSONObject } from "../../../helpers/json.js";
2
3
  import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
3
4
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
@@ -131,7 +132,7 @@ const unmarshalListVolumesResponse = (data) => {
131
132
  };
132
133
  };
133
134
  const marshalCreateSnapshotRequest = (request, defaults) => ({
134
- name: request.name,
135
+ name: request.name || randomName("snp"),
135
136
  project_id: request.projectId ?? defaults.defaultProjectId,
136
137
  tags: request.tags,
137
138
  volume_id: request.volumeId
@@ -144,7 +145,7 @@ const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({
144
145
  snapshot_id: request.snapshotId
145
146
  });
146
147
  const marshalCreateVolumeRequest = (request, defaults) => ({
147
- name: request.name,
148
+ name: request.name || randomName("vol"),
148
149
  project_id: request.projectId ?? defaults.defaultProjectId,
149
150
  tags: request.tags,
150
151
  ...resolveOneOf([
@@ -134,7 +134,7 @@ export type CreateSnapshotRequest = {
134
134
  /** UUID of the volume to snapshot. */
135
135
  volumeId: string;
136
136
  /** Name of the snapshot. */
137
- name: string;
137
+ name?: string;
138
138
  /** UUID of the project to which the volume and the snapshot belong. */
139
139
  projectId?: string;
140
140
  /** List of tags assigned to the snapshot. */
@@ -144,7 +144,7 @@ export type CreateVolumeRequest = {
144
144
  /** Zone to target. If none is passed will use default zone from the config. */
145
145
  zone?: Zone;
146
146
  /** Name of the volume. */
147
- name: string;
147
+ name?: string;
148
148
  /**
149
149
  * The maximum IO/s expected, according to the different options available in
150
150
  * stock (`5000 | 15000`).
@@ -137,9 +137,11 @@ const unmarshalGetConfigResponse = (data) => {
137
137
  );
138
138
  }
139
139
  return {
140
- logsRetention: data.logs_retention ? unmarshalGetConfigResponseRetention(data.logs_retention) : void 0,
141
- metricsRetention: data.metrics_retention ? unmarshalGetConfigResponseRetention(data.metrics_retention) : void 0,
142
- tracesRetention: data.traces_retention ? unmarshalGetConfigResponseRetention(data.traces_retention) : void 0
140
+ customLogsRetention: data.custom_logs_retention ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) : void 0,
141
+ customMetricsRetention: data.custom_metrics_retention ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) : void 0,
142
+ customTracesRetention: data.custom_traces_retention ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) : void 0,
143
+ productLogsRetention: data.product_logs_retention ? unmarshalGetConfigResponseRetention(data.product_logs_retention) : void 0,
144
+ productMetricsRetention: data.product_metrics_retention ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) : void 0
143
145
  };
144
146
  };
145
147
  const unmarshalGrafana = (data) => {
@@ -135,9 +135,11 @@ const unmarshalGetConfigResponse = (data) => {
135
135
  );
136
136
  }
137
137
  return {
138
- logsRetention: data.logs_retention ? unmarshalGetConfigResponseRetention(data.logs_retention) : void 0,
139
- metricsRetention: data.metrics_retention ? unmarshalGetConfigResponseRetention(data.metrics_retention) : void 0,
140
- tracesRetention: data.traces_retention ? unmarshalGetConfigResponseRetention(data.traces_retention) : void 0
138
+ customLogsRetention: data.custom_logs_retention ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) : void 0,
139
+ customMetricsRetention: data.custom_metrics_retention ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) : void 0,
140
+ customTracesRetention: data.custom_traces_retention ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) : void 0,
141
+ productLogsRetention: data.product_logs_retention ? unmarshalGetConfigResponseRetention(data.product_logs_retention) : void 0,
142
+ productMetricsRetention: data.product_metrics_retention ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) : void 0
141
143
  };
142
144
  };
143
145
  const unmarshalGrafana = (data) => {
@@ -1,5 +1,5 @@
1
1
  import type { Region } from '../../../bridge';
2
- export type DataSourceOrigin = 'unknown_origin' | 'scaleway' | 'external';
2
+ export type DataSourceOrigin = 'unknown_origin' | 'scaleway' | 'external' | 'custom';
3
3
  export type DataSourceType = 'unknown_type' | 'metrics' | 'logs' | 'traces';
4
4
  export type GrafanaUserRole = 'unknown_role' | 'editor' | 'viewer';
5
5
  export type ListDataSourcesRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'name_asc' | 'name_desc' | 'type_asc' | 'type_desc';
@@ -158,12 +158,16 @@ export interface AlertManager {
158
158
  }
159
159
  /** Cockpit configuration. */
160
160
  export interface GetConfigResponse {
161
- /** Metrics retention configuration. */
162
- metricsRetention?: GetConfigResponseRetention;
163
- /** Logs retention configuration. */
164
- logsRetention?: GetConfigResponseRetention;
165
- /** Traces retention configuration. */
166
- tracesRetention?: GetConfigResponseRetention;
161
+ /** Custom metrics retention configuration. */
162
+ customMetricsRetention?: GetConfigResponseRetention;
163
+ /** Custom logs retention configuration. */
164
+ customLogsRetention?: GetConfigResponseRetention;
165
+ /** Custom traces retention configuration. */
166
+ customTracesRetention?: GetConfigResponseRetention;
167
+ /** Scaleway metrics retention configuration. */
168
+ productMetricsRetention?: GetConfigResponseRetention;
169
+ /** Scaleway logs retention configuration. */
170
+ productLogsRetention?: GetConfigResponseRetention;
167
171
  }
168
172
  /** Create a Grafana user. */
169
173
  export type GlobalApiCreateGrafanaUserRequest = {
@@ -244,6 +244,20 @@ class API extends api.API {
244
244
  },
245
245
  marshalling_gen.unmarshalUser
246
246
  );
247
+ /**
248
+ * List grace periods of a user. List the grace periods of a user.
249
+ *
250
+ * @param request - The request {@link ListGracePeriodsRequest}
251
+ * @returns A Promise of ListGracePeriodsResponse
252
+ */
253
+ listGracePeriods = (request = {}) => this.client.fetch(
254
+ {
255
+ method: "GET",
256
+ path: `/iam/v1alpha1/grace-periods`,
257
+ urlParams: marshalling.urlParams(["user_id", request.userId])
258
+ },
259
+ marshalling_gen.unmarshalListGracePeriodsResponse
260
+ );
247
261
  pageOfListApplications = (request = {}) => this.client.fetch(
248
262
  {
249
263
  method: "GET",
@@ -1,5 +1,5 @@
1
1
  import { API as ParentAPI } from '../../../bridge';
2
- import type { APIKey, AddGroupMemberRequest, AddGroupMembersRequest, Application, ClonePolicyRequest, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, DeleteAPIKeyRequest, DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, DeletePolicyRequest, DeleteSSHKeyRequest, DeleteUserRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, GetGroupRequest, GetJWTRequest, GetLogRequest, GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, GetUserRequest, Group, JWT, ListAPIKeysRequest, ListAPIKeysResponse, ListApplicationsRequest, ListApplicationsResponse, ListGroupsRequest, ListGroupsResponse, ListJWTsRequest, ListJWTsResponse, ListLogsRequest, ListLogsResponse, ListPermissionSetsRequest, ListPermissionSetsResponse, ListPoliciesRequest, ListPoliciesResponse, ListQuotaRequest, ListQuotaResponse, ListRulesRequest, ListRulesResponse, ListSSHKeysRequest, ListSSHKeysResponse, ListUsersRequest, ListUsersResponse, LockUserRequest, Log, Policy, Quotum, RemoveGroupMemberRequest, SSHKey, SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, User } from './types.gen';
2
+ import type { APIKey, AddGroupMemberRequest, AddGroupMembersRequest, Application, ClonePolicyRequest, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, DeleteAPIKeyRequest, DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, DeletePolicyRequest, DeleteSSHKeyRequest, DeleteUserRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, GetGroupRequest, GetJWTRequest, GetLogRequest, GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, GetUserRequest, Group, JWT, ListAPIKeysRequest, ListAPIKeysResponse, ListApplicationsRequest, ListApplicationsResponse, ListGracePeriodsRequest, ListGracePeriodsResponse, ListGroupsRequest, ListGroupsResponse, ListJWTsRequest, ListJWTsResponse, ListLogsRequest, ListLogsResponse, ListPermissionSetsRequest, ListPermissionSetsResponse, ListPoliciesRequest, ListPoliciesResponse, ListQuotaRequest, ListQuotaResponse, ListRulesRequest, ListRulesResponse, ListSSHKeysRequest, ListSSHKeysResponse, ListUsersRequest, ListUsersResponse, LockUserRequest, Log, Policy, Quotum, RemoveGroupMemberRequest, SSHKey, SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, User } from './types.gen';
3
3
  /**
4
4
  * IAM API.
5
5
  *
@@ -125,6 +125,13 @@ export declare class API extends ParentAPI {
125
125
  * @returns A Promise of User
126
126
  */
127
127
  unlockUser: (request: Readonly<UnlockUserRequest>) => Promise<User>;
128
+ /**
129
+ * List grace periods of a user. List the grace periods of a user.
130
+ *
131
+ * @param request - The request {@link ListGracePeriodsRequest}
132
+ * @returns A Promise of ListGracePeriodsResponse
133
+ */
134
+ listGracePeriods: (request?: Readonly<ListGracePeriodsRequest>) => Promise<ListGracePeriodsResponse>;
128
135
  protected pageOfListApplications: (request?: Readonly<ListApplicationsRequest>) => Promise<ListApplicationsResponse>;
129
136
  /**
130
137
  * List applications of an Organization. List the applications of an
@@ -2,7 +2,7 @@ import { API as API$1 } from "../../../scw/api.js";
2
2
  import { urlParams, validatePathParam, resolveOneOf } from "../../../helpers/marshalling.js";
3
3
  import "../../../vendor/base64/index.js";
4
4
  import { enrichForPagination } from "../../../scw/fetch/resource-paginator.js";
5
- import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, marshalUpdateUserRequest, marshalCreateUserRequest, marshalUpdateUserPasswordRequest, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest, unmarshalListQuotaResponse, unmarshalQuotum, unmarshalListJWTsResponse, marshalCreateJWTRequest, unmarshalEncodedJWT, unmarshalJWT, unmarshalListLogsResponse, unmarshalLog } from "./marshalling.gen.js";
5
+ import { unmarshalListSSHKeysResponse, marshalCreateSSHKeyRequest, unmarshalSSHKey, marshalUpdateSSHKeyRequest, unmarshalListUsersResponse, unmarshalUser, marshalUpdateUserRequest, marshalCreateUserRequest, marshalUpdateUserPasswordRequest, unmarshalListGracePeriodsResponse, unmarshalListApplicationsResponse, marshalCreateApplicationRequest, unmarshalApplication, marshalUpdateApplicationRequest, unmarshalListGroupsResponse, marshalCreateGroupRequest, unmarshalGroup, marshalUpdateGroupRequest, marshalSetGroupMembersRequest, marshalAddGroupMemberRequest, marshalAddGroupMembersRequest, marshalRemoveGroupMemberRequest, unmarshalListPoliciesResponse, marshalCreatePolicyRequest, unmarshalPolicy, marshalUpdatePolicyRequest, marshalSetRulesRequest, unmarshalSetRulesResponse, unmarshalListRulesResponse, unmarshalListPermissionSetsResponse, unmarshalListAPIKeysResponse, marshalCreateAPIKeyRequest, unmarshalAPIKey, marshalUpdateAPIKeyRequest, unmarshalListQuotaResponse, unmarshalQuotum, unmarshalListJWTsResponse, marshalCreateJWTRequest, unmarshalEncodedJWT, unmarshalJWT, unmarshalListLogsResponse, unmarshalLog } from "./marshalling.gen.js";
6
6
  const jsonContentHeaders = {
7
7
  "Content-Type": "application/json; charset=utf-8"
8
8
  };
@@ -242,6 +242,20 @@ class API extends API$1 {
242
242
  },
243
243
  unmarshalUser
244
244
  );
245
+ /**
246
+ * List grace periods of a user. List the grace periods of a user.
247
+ *
248
+ * @param request - The request {@link ListGracePeriodsRequest}
249
+ * @returns A Promise of ListGracePeriodsResponse
250
+ */
251
+ listGracePeriods = (request = {}) => this.client.fetch(
252
+ {
253
+ method: "GET",
254
+ path: `/iam/v1alpha1/grace-periods`,
255
+ urlParams: urlParams(["user_id", request.userId])
256
+ },
257
+ unmarshalListGracePeriodsResponse
258
+ );
245
259
  pageOfListApplications = (request = {}) => this.client.fetch(
246
260
  {
247
261
  method: "GET",
@@ -1,3 +1,3 @@
1
1
  export { API } from './api.gen';
2
- export type { APIKey, AddGroupMemberRequest, AddGroupMembersRequest, Application, BearerType, ClonePolicyRequest, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, CreateUserRequestMember, DeleteAPIKeyRequest, DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, DeletePolicyRequest, DeleteSSHKeyRequest, DeleteUserRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, GetGroupRequest, GetJWTRequest, GetLogRequest, GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, GetUserRequest, Group, JWT, ListAPIKeysRequest, ListAPIKeysRequestOrderBy, ListAPIKeysResponse, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListGroupsRequest, ListGroupsRequestOrderBy, ListGroupsResponse, ListJWTsRequest, ListJWTsRequestOrderBy, ListJWTsResponse, ListLogsRequest, ListLogsRequestOrderBy, ListLogsResponse, ListPermissionSetsRequest, ListPermissionSetsRequestOrderBy, ListPermissionSetsResponse, ListPoliciesRequest, ListPoliciesRequestOrderBy, ListPoliciesResponse, ListQuotaRequest, ListQuotaRequestOrderBy, ListQuotaResponse, ListRulesRequest, ListRulesResponse, ListSSHKeysRequest, ListSSHKeysRequestOrderBy, ListSSHKeysResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, LockUserRequest, Log, LogAction, LogResourceType, PermissionSet, PermissionSetScopeType, Policy, Quotum, RemoveGroupMemberRequest, Rule, RuleSpecs, SSHKey, SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, User, UserStatus, UserType, } from './types.gen';
2
+ export type { APIKey, AddGroupMemberRequest, AddGroupMembersRequest, Application, BearerType, ClonePolicyRequest, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, CreateUserRequestMember, DeleteAPIKeyRequest, DeleteApplicationRequest, DeleteGroupRequest, DeleteJWTRequest, DeletePolicyRequest, DeleteSSHKeyRequest, DeleteUserRequest, EncodedJWT, GetAPIKeyRequest, GetApplicationRequest, GetGroupRequest, GetJWTRequest, GetLogRequest, GetPolicyRequest, GetQuotumRequest, GetSSHKeyRequest, GetUserRequest, GracePeriod, GracePeriodType, Group, JWT, ListAPIKeysRequest, ListAPIKeysRequestOrderBy, ListAPIKeysResponse, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListGracePeriodsRequest, ListGracePeriodsResponse, ListGroupsRequest, ListGroupsRequestOrderBy, ListGroupsResponse, ListJWTsRequest, ListJWTsRequestOrderBy, ListJWTsResponse, ListLogsRequest, ListLogsRequestOrderBy, ListLogsResponse, ListPermissionSetsRequest, ListPermissionSetsRequestOrderBy, ListPermissionSetsResponse, ListPoliciesRequest, ListPoliciesRequestOrderBy, ListPoliciesResponse, ListQuotaRequest, ListQuotaRequestOrderBy, ListQuotaResponse, ListRulesRequest, ListRulesResponse, ListSSHKeysRequest, ListSSHKeysRequestOrderBy, ListSSHKeysResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, LockUserRequest, Log, LogAction, LogResourceType, PermissionSet, PermissionSetScopeType, Policy, Quotum, RemoveGroupMemberRequest, Rule, RuleSpecs, SSHKey, SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, UnlockUserRequest, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, User, UserStatus, UserType, } from './types.gen';
3
3
  export * as ValidationRules from './validation-rules.gen';
@@ -222,6 +222,31 @@ const unmarshalListApplicationsResponse = (data) => {
222
222
  totalCount: data.total_count
223
223
  };
224
224
  };
225
+ const unmarshalGracePeriod = (data) => {
226
+ if (!json.isJSONObject(data)) {
227
+ throw new TypeError(
228
+ `Unmarshalling the type 'GracePeriod' failed as data isn't a dictionary.`
229
+ );
230
+ }
231
+ return {
232
+ createdAt: marshalling.unmarshalDate(data.created_at),
233
+ expiresAt: marshalling.unmarshalDate(data.expires_at),
234
+ type: data.type
235
+ };
236
+ };
237
+ const unmarshalListGracePeriodsResponse = (data) => {
238
+ if (!json.isJSONObject(data)) {
239
+ throw new TypeError(
240
+ `Unmarshalling the type 'ListGracePeriodsResponse' failed as data isn't a dictionary.`
241
+ );
242
+ }
243
+ return {
244
+ gracePeriods: marshalling.unmarshalArrayOfObject(
245
+ data.grace_periods,
246
+ unmarshalGracePeriod
247
+ )
248
+ };
249
+ };
225
250
  const unmarshalListGroupsResponse = (data) => {
226
251
  if (!json.isJSONObject(data)) {
227
252
  throw new TypeError(
@@ -429,6 +454,7 @@ const marshalCreateUserRequestMember = (request, defaults) => ({
429
454
  email: request.email,
430
455
  password: request.password,
431
456
  send_password_email: request.sendPasswordEmail,
457
+ send_welcome_email: request.sendWelcomeEmail,
432
458
  username: request.username
433
459
  });
434
460
  const marshalCreateUserRequest = (request, defaults) => ({
@@ -490,6 +516,7 @@ const marshalUpdateUserPasswordRequest = (request, defaults) => ({
490
516
  send_email: request.sendEmail
491
517
  });
492
518
  const marshalUpdateUserRequest = (request, defaults) => ({
519
+ email: request.email,
493
520
  tags: request.tags
494
521
  });
495
522
  exports.marshalAddGroupMemberRequest = marshalAddGroupMemberRequest;
@@ -518,6 +545,7 @@ exports.unmarshalGroup = unmarshalGroup;
518
545
  exports.unmarshalJWT = unmarshalJWT;
519
546
  exports.unmarshalListAPIKeysResponse = unmarshalListAPIKeysResponse;
520
547
  exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;
548
+ exports.unmarshalListGracePeriodsResponse = unmarshalListGracePeriodsResponse;
521
549
  exports.unmarshalListGroupsResponse = unmarshalListGroupsResponse;
522
550
  exports.unmarshalListJWTsResponse = unmarshalListJWTsResponse;
523
551
  exports.unmarshalListLogsResponse = unmarshalListLogsResponse;
@@ -1,5 +1,5 @@
1
1
  import type { DefaultValues } from '../../../bridge';
2
- import type { APIKey, AddGroupMemberRequest, AddGroupMembersRequest, Application, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, EncodedJWT, Group, JWT, ListAPIKeysResponse, ListApplicationsResponse, ListGroupsResponse, ListJWTsResponse, ListLogsResponse, ListPermissionSetsResponse, ListPoliciesResponse, ListQuotaResponse, ListRulesResponse, ListSSHKeysResponse, ListUsersResponse, Log, Policy, Quotum, RemoveGroupMemberRequest, SSHKey, SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, User } from './types.gen';
2
+ import type { APIKey, AddGroupMemberRequest, AddGroupMembersRequest, Application, CreateAPIKeyRequest, CreateApplicationRequest, CreateGroupRequest, CreateJWTRequest, CreatePolicyRequest, CreateSSHKeyRequest, CreateUserRequest, EncodedJWT, Group, JWT, ListAPIKeysResponse, ListApplicationsResponse, ListGracePeriodsResponse, ListGroupsResponse, ListJWTsResponse, ListLogsResponse, ListPermissionSetsResponse, ListPoliciesResponse, ListQuotaResponse, ListRulesResponse, ListSSHKeysResponse, ListUsersResponse, Log, Policy, Quotum, RemoveGroupMemberRequest, SSHKey, SetGroupMembersRequest, SetRulesRequest, SetRulesResponse, UpdateAPIKeyRequest, UpdateApplicationRequest, UpdateGroupRequest, UpdatePolicyRequest, UpdateSSHKeyRequest, UpdateUserPasswordRequest, UpdateUserRequest, User } from './types.gen';
3
3
  export declare const unmarshalJWT: (data: unknown) => JWT;
4
4
  export declare const unmarshalAPIKey: (data: unknown) => APIKey;
5
5
  export declare const unmarshalApplication: (data: unknown) => Application;
@@ -12,6 +12,7 @@ export declare const unmarshalUser: (data: unknown) => User;
12
12
  export declare const unmarshalEncodedJWT: (data: unknown) => EncodedJWT;
13
13
  export declare const unmarshalListAPIKeysResponse: (data: unknown) => ListAPIKeysResponse;
14
14
  export declare const unmarshalListApplicationsResponse: (data: unknown) => ListApplicationsResponse;
15
+ export declare const unmarshalListGracePeriodsResponse: (data: unknown) => ListGracePeriodsResponse;
15
16
  export declare const unmarshalListGroupsResponse: (data: unknown) => ListGroupsResponse;
16
17
  export declare const unmarshalListJWTsResponse: (data: unknown) => ListJWTsResponse;
17
18
  export declare const unmarshalListLogsResponse: (data: unknown) => ListLogsResponse;
@@ -220,6 +220,31 @@ const unmarshalListApplicationsResponse = (data) => {
220
220
  totalCount: data.total_count
221
221
  };
222
222
  };
223
+ const unmarshalGracePeriod = (data) => {
224
+ if (!isJSONObject(data)) {
225
+ throw new TypeError(
226
+ `Unmarshalling the type 'GracePeriod' failed as data isn't a dictionary.`
227
+ );
228
+ }
229
+ return {
230
+ createdAt: unmarshalDate(data.created_at),
231
+ expiresAt: unmarshalDate(data.expires_at),
232
+ type: data.type
233
+ };
234
+ };
235
+ const unmarshalListGracePeriodsResponse = (data) => {
236
+ if (!isJSONObject(data)) {
237
+ throw new TypeError(
238
+ `Unmarshalling the type 'ListGracePeriodsResponse' failed as data isn't a dictionary.`
239
+ );
240
+ }
241
+ return {
242
+ gracePeriods: unmarshalArrayOfObject(
243
+ data.grace_periods,
244
+ unmarshalGracePeriod
245
+ )
246
+ };
247
+ };
223
248
  const unmarshalListGroupsResponse = (data) => {
224
249
  if (!isJSONObject(data)) {
225
250
  throw new TypeError(
@@ -427,6 +452,7 @@ const marshalCreateUserRequestMember = (request, defaults) => ({
427
452
  email: request.email,
428
453
  password: request.password,
429
454
  send_password_email: request.sendPasswordEmail,
455
+ send_welcome_email: request.sendWelcomeEmail,
430
456
  username: request.username
431
457
  });
432
458
  const marshalCreateUserRequest = (request, defaults) => ({
@@ -488,6 +514,7 @@ const marshalUpdateUserPasswordRequest = (request, defaults) => ({
488
514
  send_email: request.sendEmail
489
515
  });
490
516
  const marshalUpdateUserRequest = (request, defaults) => ({
517
+ email: request.email,
491
518
  tags: request.tags
492
519
  });
493
520
  export {
@@ -517,6 +544,7 @@ export {
517
544
  unmarshalJWT,
518
545
  unmarshalListAPIKeysResponse,
519
546
  unmarshalListApplicationsResponse,
547
+ unmarshalListGracePeriodsResponse,
520
548
  unmarshalListGroupsResponse,
521
549
  unmarshalListJWTsResponse,
522
550
  unmarshalListLogsResponse,
@@ -1,4 +1,5 @@
1
1
  export type BearerType = 'unknown_bearer_type' | 'user' | 'application';
2
+ export type GracePeriodType = 'unknown_grace_period_type' | 'update_password' | 'set_mfa';
2
3
  export type ListAPIKeysRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'expires_at_asc' | 'expires_at_desc' | 'access_key_asc' | 'access_key_desc';
3
4
  export type ListApplicationsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'name_asc' | 'name_desc';
4
5
  export type ListGroupsRequestOrderBy = 'created_at_asc' | 'created_at_desc' | 'updated_at_asc' | 'updated_at_desc' | 'name_asc' | 'name_desc';
@@ -57,6 +58,11 @@ export interface CreateUserRequestMember {
57
58
  email: string;
58
59
  /** Whether or not to send an email containing the member's password. */
59
60
  sendPasswordEmail: boolean;
61
+ /**
62
+ * Whether or not to send a welcome email that includes onboarding
63
+ * information.
64
+ */
65
+ sendWelcomeEmail: boolean;
60
66
  /** The member's username. */
61
67
  username: string;
62
68
  /** The member's password. */
@@ -122,6 +128,14 @@ export interface Application {
122
128
  /** Tags associated with the user. */
123
129
  tags: string[];
124
130
  }
131
+ export interface GracePeriod {
132
+ /** Type of grace period. */
133
+ type: GracePeriodType;
134
+ /** Date and time the grace period was created. */
135
+ createdAt?: Date;
136
+ /** Date and time the grace period expires. */
137
+ expiresAt?: Date;
138
+ }
125
139
  export interface Group {
126
140
  /** ID of the group. */
127
141
  id: string;
@@ -625,6 +639,14 @@ export interface ListApplicationsResponse {
625
639
  /** Total count of applications. */
626
640
  totalCount: number;
627
641
  }
642
+ export type ListGracePeriodsRequest = {
643
+ /** ID of the user to list grace periods for. */
644
+ userId?: string;
645
+ };
646
+ export interface ListGracePeriodsResponse {
647
+ /** List of grace periods. */
648
+ gracePeriods: GracePeriod[];
649
+ }
628
650
  export type ListGroupsRequest = {
629
651
  /** Sort order of groups. */
630
652
  orderBy?: ListGroupsRequestOrderBy;
@@ -818,6 +840,7 @@ export interface ListUsersResponse {
818
840
  totalCount: number;
819
841
  }
820
842
  export type LockUserRequest = {
843
+ /** ID of the user to lock. */
821
844
  userId: string;
822
845
  };
823
846
  export type RemoveGroupMemberRequest = {
@@ -852,6 +875,7 @@ export interface SetRulesResponse {
852
875
  rules: Rule[];
853
876
  }
854
877
  export type UnlockUserRequest = {
878
+ /** ID of the user to unlock. */
855
879
  userId: string;
856
880
  };
857
881
  export type UpdateAPIKeyRequest = {
@@ -946,4 +970,6 @@ export type UpdateUserRequest = {
946
970
  userId: string;
947
971
  /** New tags for the user (maximum of 10 tags). */
948
972
  tags?: string[];
973
+ /** New email for the user (only available on Members). */
974
+ email?: string;
949
975
  };
@@ -194,10 +194,17 @@ class API extends api.API {
194
194
  * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
195
195
  * network stack.
196
196
  *
197
- * Keep in mind that `terminate` an Instance will result in the deletion of
198
- * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
199
- * will only be detached. If you want to preserve your volumes, you should
200
- * detach them before the Instance deletion or `terminate` action.
197
+ * The `terminate` action will result in the deletion of `l_ssd`, `b_ssd` and
198
+ * `scratch` volumes types, `sbs_volume` volumes type will only be detached.
199
+ * If you want to preserve your volumes, you should detach them before the
200
+ * Instance deletion or `terminate` action.
201
+ *
202
+ * The `backup` action can be done with: No `volumes` key in the body: an
203
+ * image is created with snapshots of all the server volumes, except for the
204
+ * `scratch` volumes types. `volumes` key in the body with a dictionary as
205
+ * value, in this dictionary volumes UUID as keys and empty dictionaries as
206
+ * values : an image is created with the snapshots of the volumes in `volumes`
207
+ * key. `scratch` volumes types can't be shapshotted.
201
208
  *
202
209
  * @param request - The request {@link ServerActionRequest}
203
210
  * @returns A Promise of ServerActionResponse
@@ -1099,13 +1106,22 @@ class API extends api.API {
1099
1106
  );
1100
1107
  /**
1101
1108
  * Get a volume or snapshot's migration plan. Given a volume or snapshot,
1102
- * returns the migration plan for a call to the "Apply a migration plan"
1103
- * endpoint. This plan will include zero or one volume, and zero or more
1104
- * snapshots, which will need to be migrated together. This endpoint does not
1105
- * perform the actual migration itself, the "Apply a migration plan" endpoint
1106
- * must be used. The validation_key value returned by this endpoint must be
1107
- * provided to the call to the "Apply a migration plan" endpoint to confirm
1108
- * that all resources listed in the plan should be migrated.
1109
+ * returns the migration plan but does not perform the actual migration. To
1110
+ * perform the migration, you have to call the [Migrate a volume and/or
1111
+ * snapshots to
1112
+ * SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
1113
+ * endpoint afterward. The endpoint returns the resources that should be
1114
+ * migrated together:
1115
+ *
1116
+ * - The volume and any snapshots created from the volume, if the call was made
1117
+ * to plan a volume migration.
1118
+ * - The base volume of the snapshot (if the volume is not deleted) and its
1119
+ * related snapshots, if the call was made to plan a snapshot migration. The
1120
+ * endpoint also returns the validation_key, which must be provided to the
1121
+ * [Migrate a volume and/or snapshots to
1122
+ * SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
1123
+ * endpoint to confirm that all resources listed in the plan should be
1124
+ * migrated.
1109
1125
  *
1110
1126
  * @param request - The request {@link PlanBlockMigrationRequest}
1111
1127
  * @returns A Promise of MigrationPlan
@@ -1123,9 +1139,11 @@ class API extends api.API {
1123
1139
  );
1124
1140
  /**
1125
1141
  * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be
1126
- * used, the call to this endpoint must be preceded by a call to the "Plan a
1127
- * migration" endpoint. To migrate all resources mentioned in the migration
1128
- * plan, the validation_key returned in the plan must be provided.
1142
+ * used, the call to this endpoint must be preceded by a call to the [Get a
1143
+ * volume or snapshot's migration
1144
+ * plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint. To
1145
+ * migrate all resources mentioned in the migration plan, the validation_key
1146
+ * returned in the plan must be provided.
1129
1147
  *
1130
1148
  * @param request - The request {@link ApplyBlockMigrationRequest}
1131
1149
  */
@@ -78,10 +78,17 @@ export declare class API extends ParentAPI {
78
78
  * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new
79
79
  * network stack.
80
80
  *
81
- * Keep in mind that `terminate` an Instance will result in the deletion of
82
- * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type
83
- * will only be detached. If you want to preserve your volumes, you should
84
- * detach them before the Instance deletion or `terminate` action.
81
+ * The `terminate` action will result in the deletion of `l_ssd`, `b_ssd` and
82
+ * `scratch` volumes types, `sbs_volume` volumes type will only be detached.
83
+ * If you want to preserve your volumes, you should detach them before the
84
+ * Instance deletion or `terminate` action.
85
+ *
86
+ * The `backup` action can be done with: No `volumes` key in the body: an
87
+ * image is created with snapshots of all the server volumes, except for the
88
+ * `scratch` volumes types. `volumes` key in the body with a dictionary as
89
+ * value, in this dictionary volumes UUID as keys and empty dictionaries as
90
+ * values : an image is created with the snapshots of the volumes in `volumes`
91
+ * key. `scratch` volumes types can't be shapshotted.
85
92
  *
86
93
  * @param request - The request {@link ServerActionRequest}
87
94
  * @returns A Promise of ServerActionResponse
@@ -487,13 +494,22 @@ export declare class API extends ParentAPI {
487
494
  getDashboard: (request?: Readonly<GetDashboardRequest>) => Promise<GetDashboardResponse>;
488
495
  /**
489
496
  * Get a volume or snapshot's migration plan. Given a volume or snapshot,
490
- * returns the migration plan for a call to the "Apply a migration plan"
491
- * endpoint. This plan will include zero or one volume, and zero or more
492
- * snapshots, which will need to be migrated together. This endpoint does not
493
- * perform the actual migration itself, the "Apply a migration plan" endpoint
494
- * must be used. The validation_key value returned by this endpoint must be
495
- * provided to the call to the "Apply a migration plan" endpoint to confirm
496
- * that all resources listed in the plan should be migrated.
497
+ * returns the migration plan but does not perform the actual migration. To
498
+ * perform the migration, you have to call the [Migrate a volume and/or
499
+ * snapshots to
500
+ * SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
501
+ * endpoint afterward. The endpoint returns the resources that should be
502
+ * migrated together:
503
+ *
504
+ * - The volume and any snapshots created from the volume, if the call was made
505
+ * to plan a volume migration.
506
+ * - The base volume of the snapshot (if the volume is not deleted) and its
507
+ * related snapshots, if the call was made to plan a snapshot migration. The
508
+ * endpoint also returns the validation_key, which must be provided to the
509
+ * [Migrate a volume and/or snapshots to
510
+ * SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage)
511
+ * endpoint to confirm that all resources listed in the plan should be
512
+ * migrated.
497
513
  *
498
514
  * @param request - The request {@link PlanBlockMigrationRequest}
499
515
  * @returns A Promise of MigrationPlan
@@ -501,9 +517,11 @@ export declare class API extends ParentAPI {
501
517
  planBlockMigration: (request?: Readonly<PlanBlockMigrationRequest>) => Promise<MigrationPlan>;
502
518
  /**
503
519
  * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be
504
- * used, the call to this endpoint must be preceded by a call to the "Plan a
505
- * migration" endpoint. To migrate all resources mentioned in the migration
506
- * plan, the validation_key returned in the plan must be provided.
520
+ * used, the call to this endpoint must be preceded by a call to the [Get a
521
+ * volume or snapshot's migration
522
+ * plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint. To
523
+ * migrate all resources mentioned in the migration plan, the validation_key
524
+ * returned in the plan must be provided.
507
525
  *
508
526
  * @param request - The request {@link ApplyBlockMigrationRequest}
509
527
  */