@scaleway/sdk-searchdb 1.8.0 → 1.9.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.
@@ -0,0 +1,3 @@
1
+ # Licenses
2
+
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export * as Searchdbv1alpha1 from './v1alpha1/index.gen.js';
@@ -0,0 +1,2 @@
1
+ import { index_gen_exports } from "./v1alpha1/index.gen.js";
2
+ export { index_gen_exports as Searchdbv1alpha1 };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export declare const pkgMetadata: {
6
+ readonly name: "@scaleway/sdk-searchdb";
7
+ readonly namespace: "searchdb";
8
+ readonly displayName: "Searchdb";
9
+ readonly versions: readonly ["v1alpha1"];
10
+ };
11
+ export type Metadata = typeof pkgMetadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,13 @@
1
+ //#region src/metadata.gen.ts
2
+ /**
3
+ * This file is automatically generated
4
+ * PLEASE DO NOT EDIT HERE
5
+ */
6
+ const pkgMetadata = {
7
+ name: "@scaleway/sdk-searchdb",
8
+ namespace: "searchdb",
9
+ displayName: "Searchdb",
10
+ versions: ["v1alpha1"]
11
+ };
12
+ //#endregion
13
+ export { pkgMetadata as default, pkgMetadata };
@@ -0,0 +1,136 @@
1
+ import { API as ParentAPI } from '@scaleway/sdk-client';
2
+ import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client';
3
+ import type { CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteUserRequest, Deployment, DownloadDeploymentCertificateAuthorityRequest, Endpoint, GetDeploymentRequest, ListDeploymentsRequest, ListDeploymentsResponse, ListNodeTypesRequest, ListNodeTypesResponse, ListUsersRequest, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, UpdateDeploymentRequest, UpdateUserRequest, UpgradeDeploymentRequest, User } from './types.gen.js';
4
+ /**
5
+ * Cloud Essentials for Opensearch API.
6
+
7
+ The Cloud Essentials for Opensearch API allows you to manage your Opensearch resources.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
15
+ /**
16
+ * Create a new Cloud Essentials for OpenSearch deployment.
17
+ *
18
+ * @param request - The request {@link CreateDeploymentRequest}
19
+ * @returns A Promise of Deployment
20
+ */
21
+ createDeployment: (request: Readonly<CreateDeploymentRequest>) => Promise<Deployment>;
22
+ /**
23
+ * Update a Cloud Essentials for OpenSearch deployment.
24
+ *
25
+ * @param request - The request {@link UpdateDeploymentRequest}
26
+ * @returns A Promise of Deployment
27
+ */
28
+ updateDeployment: (request: Readonly<UpdateDeploymentRequest>) => Promise<Deployment>;
29
+ /**
30
+ * Upgrade a Cloud Essentials for OpenSearch deployment.
31
+ *
32
+ * @param request - The request {@link UpgradeDeploymentRequest}
33
+ * @returns A Promise of Deployment
34
+ */
35
+ upgradeDeployment: (request: Readonly<UpgradeDeploymentRequest>) => Promise<Deployment>;
36
+ /**
37
+ * Retrieve a specific Cloud Essentials for OpenSearch deployment.
38
+ *
39
+ * @param request - The request {@link GetDeploymentRequest}
40
+ * @returns A Promise of Deployment
41
+ */
42
+ getDeployment: (request: Readonly<GetDeploymentRequest>) => Promise<Deployment>;
43
+ /**
44
+ * Waits for {@link Deployment} to be in a final state.
45
+ *
46
+ * @param request - The request {@link GetDeploymentRequest}
47
+ * @param options - The waiting options
48
+ * @returns A Promise of Deployment
49
+ */
50
+ waitForDeployment: (request: Readonly<GetDeploymentRequest>, options?: Readonly<WaitForOptions<Deployment>>) => Promise<Deployment>;
51
+ /**
52
+ * Delete a Cloud Essentials for OpenSearch deployment.
53
+ *
54
+ * @param request - The request {@link DeleteDeploymentRequest}
55
+ * @returns A Promise of Deployment
56
+ */
57
+ deleteDeployment: (request: Readonly<DeleteDeploymentRequest>) => Promise<Deployment>;
58
+ protected pageOfListDeployments: (request?: Readonly<ListDeploymentsRequest>) => Promise<ListDeploymentsResponse>;
59
+ /**
60
+ * Retrieve a list of Cloud Essentials for OpenSearch deployments.
61
+ *
62
+ * @param request - The request {@link ListDeploymentsRequest}
63
+ * @returns A Promise of ListDeploymentsResponse
64
+ */
65
+ listDeployments: (request?: Readonly<ListDeploymentsRequest>) => Promise<ListDeploymentsResponse> & {
66
+ all: () => Promise<Deployment[]>;
67
+ [Symbol.asyncIterator]: () => AsyncGenerator<Deployment[], void, void>;
68
+ };
69
+ protected pageOfListVersions: (request?: Readonly<ListVersionsRequest>) => Promise<ListVersionsResponse>;
70
+ /**
71
+ * List available Cloud Essentials for OpenSearch versions.
72
+ *
73
+ * @param request - The request {@link ListVersionsRequest}
74
+ * @returns A Promise of ListVersionsResponse
75
+ */
76
+ listVersions: (request?: Readonly<ListVersionsRequest>) => Promise<ListVersionsResponse> & {
77
+ all: () => Promise<import("./types.gen.js").Version[]>;
78
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").Version[], void, void>;
79
+ };
80
+ protected pageOfListNodeTypes: (request?: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse>;
81
+ /**
82
+ * Retrieve a list of available node types.
83
+ *
84
+ * @param request - The request {@link ListNodeTypesRequest}
85
+ * @returns A Promise of ListNodeTypesResponse
86
+ */
87
+ listNodeTypes: (request?: Readonly<ListNodeTypesRequest>) => Promise<ListNodeTypesResponse> & {
88
+ all: () => Promise<import("./types.gen.js").NodeType[]>;
89
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").NodeType[], void, void>;
90
+ };
91
+ /**
92
+ * Create a new endpoint on a deployment.
93
+ *
94
+ * @param request - The request {@link CreateEndpointRequest}
95
+ * @returns A Promise of Endpoint
96
+ */
97
+ createEndpoint: (request: Readonly<CreateEndpointRequest>) => Promise<Endpoint>;
98
+ /**
99
+ * Delete an existing endpoint.
100
+ *
101
+ * @param request - The request {@link DeleteEndpointRequest}
102
+ */
103
+ deleteEndpoint: (request: Readonly<DeleteEndpointRequest>) => Promise<void>;
104
+ protected pageOfListUsers: (request: Readonly<ListUsersRequest>) => Promise<ListUsersResponse>;
105
+ /**
106
+ * Retrieve a list of deployment users.
107
+ *
108
+ * @param request - The request {@link ListUsersRequest}
109
+ * @returns A Promise of ListUsersResponse
110
+ */
111
+ listUsers: (request: Readonly<ListUsersRequest>) => Promise<ListUsersResponse> & {
112
+ all: () => Promise<User[]>;
113
+ [Symbol.asyncIterator]: () => AsyncGenerator<User[], void, void>;
114
+ };
115
+ /**
116
+ * Create a new user.
117
+ *
118
+ * @param request - The request {@link CreateUserRequest}
119
+ * @returns A Promise of User
120
+ */
121
+ createUser: (request: Readonly<CreateUserRequest>) => Promise<User>;
122
+ /**
123
+ * Update an existing user.
124
+ *
125
+ * @param request - The request {@link UpdateUserRequest}
126
+ * @returns A Promise of User
127
+ */
128
+ updateUser: (request: Readonly<UpdateUserRequest>) => Promise<User>;
129
+ /**
130
+ * Delete an existing user.
131
+ *
132
+ * @param request - The request {@link DeleteUserRequest}
133
+ */
134
+ deleteUser: (request: Readonly<DeleteUserRequest>) => Promise<void>;
135
+ downloadDeploymentCertificateAuthority: (request: Readonly<DownloadDeploymentCertificateAuthorityRequest>) => Promise<Blob>;
136
+ }
@@ -0,0 +1,103 @@
1
+ import { DEPLOYMENT_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, marshalUpgradeDeploymentRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser } from "./marshalling.gen.js";
3
+ import { API as API$1, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v1alpha1/api.gen.ts
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
+ /**
7
+ * Cloud Essentials for Opensearch API.
8
+
9
+ The Cloud Essentials for Opensearch API allows you to manage your Opensearch resources.
10
+ */
11
+ var API = class extends API$1 {
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.createDeployment = (request) => this.client.fetch({
15
+ body: JSON.stringify(marshalCreateDeploymentRequest(request, this.client.settings)),
16
+ headers: jsonContentHeaders,
17
+ method: "POST",
18
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`
19
+ }, unmarshalDeployment);
20
+ this.updateDeployment = (request) => this.client.fetch({
21
+ body: JSON.stringify(marshalUpdateDeploymentRequest(request, this.client.settings)),
22
+ headers: jsonContentHeaders,
23
+ method: "PATCH",
24
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
25
+ }, unmarshalDeployment);
26
+ this.upgradeDeployment = (request) => this.client.fetch({
27
+ body: JSON.stringify(marshalUpgradeDeploymentRequest(request, this.client.settings)),
28
+ headers: jsonContentHeaders,
29
+ method: "POST",
30
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/upgrade`
31
+ }, unmarshalDeployment);
32
+ this.getDeployment = (request) => this.client.fetch({
33
+ method: "GET",
34
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
35
+ }, unmarshalDeployment);
36
+ this.waitForDeployment = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), this.getDeployment, request, options);
37
+ this.deleteDeployment = (request) => this.client.fetch({
38
+ method: "DELETE",
39
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}`
40
+ }, unmarshalDeployment);
41
+ this.pageOfListDeployments = (request = {}) => this.client.fetch({
42
+ method: "GET",
43
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`,
44
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["tags", request.tags])
45
+ }, unmarshalListDeploymentsResponse);
46
+ this.listDeployments = (request = {}) => enrichForPagination("deployments", this.pageOfListDeployments, request);
47
+ this.pageOfListVersions = (request = {}) => this.client.fetch({
48
+ method: "GET",
49
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
50
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["version", request.version])
51
+ }, unmarshalListVersionsResponse);
52
+ this.listVersions = (request = {}) => enrichForPagination("versions", this.pageOfListVersions, request);
53
+ this.pageOfListNodeTypes = (request = {}) => this.client.fetch({
54
+ method: "GET",
55
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
56
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
57
+ }, unmarshalListNodeTypesResponse);
58
+ this.listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
59
+ this.createEndpoint = (request) => this.client.fetch({
60
+ body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
61
+ headers: jsonContentHeaders,
62
+ method: "POST",
63
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
64
+ }, unmarshalEndpoint);
65
+ this.deleteEndpoint = (request) => this.client.fetch({
66
+ method: "DELETE",
67
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
68
+ });
69
+ this.pageOfListUsers = (request) => this.client.fetch({
70
+ method: "GET",
71
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users`,
72
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
73
+ }, unmarshalListUsersResponse);
74
+ this.listUsers = (request) => enrichForPagination("users", this.pageOfListUsers, request);
75
+ this.createUser = (request) => this.client.fetch({
76
+ body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)),
77
+ headers: jsonContentHeaders,
78
+ method: "POST",
79
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users`
80
+ }, unmarshalUser);
81
+ this.updateUser = (request) => this.client.fetch({
82
+ body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)),
83
+ headers: jsonContentHeaders,
84
+ method: "PATCH",
85
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users/${validatePathParam("username", request.username)}`
86
+ }, unmarshalUser);
87
+ this.deleteUser = (request) => this.client.fetch({
88
+ method: "DELETE",
89
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/users/${validatePathParam("username", request.username)}`
90
+ });
91
+ this.downloadDeploymentCertificateAuthority = (request) => this.client.fetch({
92
+ method: "GET",
93
+ path: `/searchdb/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam("deploymentId", request.deploymentId)}/certificate-authority`,
94
+ urlParams: urlParams(["dl", 1]),
95
+ responseType: "blob"
96
+ });
97
+ }
98
+ static {
99
+ this.LOCALITY = toApiLocality({ regions: ["fr-par"] });
100
+ }
101
+ };
102
+ //#endregion
103
+ export { API };
@@ -0,0 +1,3 @@
1
+ import type { DeploymentStatus } from './types.gen.js';
2
+ /** Lists transient statutes of the enum {@link DeploymentStatus}. */
3
+ export declare const DEPLOYMENT_TRANSIENT_STATUSES: DeploymentStatus[];
@@ -0,0 +1,12 @@
1
+ //#region src/v1alpha1/content.gen.ts
2
+ /** Lists transient statutes of the enum {@link DeploymentStatus}. */
3
+ const DEPLOYMENT_TRANSIENT_STATUSES = [
4
+ "creating",
5
+ "initializing",
6
+ "upgrading",
7
+ "deleting",
8
+ "locking",
9
+ "unlocking"
10
+ ];
11
+ //#endregion
12
+ export { DEPLOYMENT_TRANSIENT_STATUSES };
@@ -0,0 +1,5 @@
1
+ export { API, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, DeleteDeploymentRequest, DeleteEndpointRequest, DeleteUserRequest, Deployment, DeploymentStatus, DownloadDeploymentCertificateAuthorityRequest, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicDetails, EndpointService, EndpointSpec, EndpointSpecPrivateNetworkDetails, EndpointSpecPublicDetails, GetDeploymentRequest, ListDeploymentsRequest, ListDeploymentsRequestOrderBy, ListDeploymentsResponse, ListNodeTypesRequest, ListNodeTypesRequestOrderBy, ListNodeTypesResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, ListVersionsRequest, ListVersionsRequestOrderBy, ListVersionsResponse, NodeType, NodeTypeStockStatus, NodeTypeVolumeType, UpdateDeploymentRequest, UpdateUserRequest, UpgradeDeploymentRequest, User, Version, Volume, VolumeType, } from './types.gen.js';
5
+ export * as ValidationRules from './validation-rules.gen.js';
@@ -0,0 +1,26 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ import { DEPLOYMENT_TRANSIENT_STATUSES } from "./content.gen.js";
3
+ import { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, marshalUpgradeDeploymentRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser } from "./marshalling.gen.js";
4
+ import { API } from "./api.gen.js";
5
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ //#region src/v1alpha1/index.gen.ts
7
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
8
+ API: () => API,
9
+ DEPLOYMENT_TRANSIENT_STATUSES: () => DEPLOYMENT_TRANSIENT_STATUSES,
10
+ ValidationRules: () => validation_rules_gen_exports,
11
+ marshalCreateDeploymentRequest: () => marshalCreateDeploymentRequest,
12
+ marshalCreateEndpointRequest: () => marshalCreateEndpointRequest,
13
+ marshalCreateUserRequest: () => marshalCreateUserRequest,
14
+ marshalUpdateDeploymentRequest: () => marshalUpdateDeploymentRequest,
15
+ marshalUpdateUserRequest: () => marshalUpdateUserRequest,
16
+ marshalUpgradeDeploymentRequest: () => marshalUpgradeDeploymentRequest,
17
+ unmarshalDeployment: () => unmarshalDeployment,
18
+ unmarshalEndpoint: () => unmarshalEndpoint,
19
+ unmarshalListDeploymentsResponse: () => unmarshalListDeploymentsResponse,
20
+ unmarshalListNodeTypesResponse: () => unmarshalListNodeTypesResponse,
21
+ unmarshalListUsersResponse: () => unmarshalListUsersResponse,
22
+ unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
23
+ unmarshalUser: () => unmarshalUser
24
+ });
25
+ //#endregion
26
+ export { API, DEPLOYMENT_TRANSIENT_STATUSES, validation_rules_gen_exports as ValidationRules, index_gen_exports, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, marshalUpgradeDeploymentRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser };
@@ -0,0 +1,15 @@
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { Endpoint, Deployment, User, ListDeploymentsResponse, ListNodeTypesResponse, ListUsersResponse, ListVersionsResponse, CreateDeploymentRequest, CreateEndpointRequest, CreateUserRequest, UpdateDeploymentRequest, UpdateUserRequest, UpgradeDeploymentRequest } from './types.gen.js';
3
+ export declare const unmarshalEndpoint: (data: unknown) => Endpoint;
4
+ export declare const unmarshalDeployment: (data: unknown) => Deployment;
5
+ export declare const unmarshalUser: (data: unknown) => User;
6
+ export declare const unmarshalListDeploymentsResponse: (data: unknown) => ListDeploymentsResponse;
7
+ export declare const unmarshalListNodeTypesResponse: (data: unknown) => ListNodeTypesResponse;
8
+ export declare const unmarshalListUsersResponse: (data: unknown) => ListUsersResponse;
9
+ export declare const unmarshalListVersionsResponse: (data: unknown) => ListVersionsResponse;
10
+ export declare const marshalCreateDeploymentRequest: (request: CreateDeploymentRequest, defaults: DefaultValues) => Record<string, unknown>;
11
+ export declare const marshalCreateEndpointRequest: (request: CreateEndpointRequest, defaults: DefaultValues) => Record<string, unknown>;
12
+ export declare const marshalCreateUserRequest: (request: CreateUserRequest, defaults: DefaultValues) => Record<string, unknown>;
13
+ export declare const marshalUpdateDeploymentRequest: (request: UpdateDeploymentRequest, defaults: DefaultValues) => Record<string, unknown>;
14
+ export declare const marshalUpdateUserRequest: (request: UpdateUserRequest, defaults: DefaultValues) => Record<string, unknown>;
15
+ export declare const marshalUpgradeDeploymentRequest: (request: UpgradeDeploymentRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -0,0 +1,175 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ //#region src/v1alpha1/marshalling.gen.ts
3
+ const unmarshalEndpointPrivateNetworkDetails = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
5
+ return { privateNetworkId: data.private_network_id };
6
+ };
7
+ const unmarshalEndpointPublicDetails = (data) => {
8
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`);
9
+ return {};
10
+ };
11
+ const unmarshalEndpointService = (data) => {
12
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointService' failed as data isn't a dictionary.`);
13
+ return {
14
+ name: data.name,
15
+ port: data.port,
16
+ url: data.url
17
+ };
18
+ };
19
+ const unmarshalEndpoint = (data) => {
20
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
21
+ return {
22
+ dnsRecord: data.dns_record,
23
+ id: data.id,
24
+ privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
25
+ public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0,
26
+ services: unmarshalArrayOfObject(data.services, unmarshalEndpointService)
27
+ };
28
+ };
29
+ const unmarshalVolume = (data) => {
30
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
31
+ return {
32
+ sizeBytes: data.size_bytes,
33
+ type: data.type
34
+ };
35
+ };
36
+ const unmarshalDeployment = (data) => {
37
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
38
+ return {
39
+ createdAt: unmarshalDate(data.created_at),
40
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
41
+ id: data.id,
42
+ name: data.name,
43
+ nodeAmount: data.node_amount,
44
+ nodeCount: data.node_count,
45
+ nodeType: data.node_type,
46
+ organizationId: data.organization_id,
47
+ projectId: data.project_id,
48
+ region: data.region,
49
+ status: data.status,
50
+ tags: data.tags,
51
+ updatedAt: unmarshalDate(data.updated_at),
52
+ version: data.version,
53
+ volume: data.volume ? unmarshalVolume(data.volume) : void 0
54
+ };
55
+ };
56
+ const unmarshalUser = (data) => {
57
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
58
+ return { username: data.username };
59
+ };
60
+ const unmarshalListDeploymentsResponse = (data) => {
61
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
62
+ return {
63
+ deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
64
+ totalCount: data.total_count
65
+ };
66
+ };
67
+ const unmarshalNodeTypeVolumeType = (data) => {
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
69
+ return {
70
+ chunkSizeBytes: data.chunk_size_bytes,
71
+ description: data.description,
72
+ maxSizeBytes: data.max_size_bytes,
73
+ minSizeBytes: data.min_size_bytes,
74
+ type: data.type
75
+ };
76
+ };
77
+ const unmarshalNodeType = (data) => {
78
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
79
+ return {
80
+ availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
81
+ beta: data.beta,
82
+ description: data.description,
83
+ disabled: data.disabled,
84
+ instanceRange: data.instance_range,
85
+ memoryBytes: data.memory_bytes,
86
+ name: data.name,
87
+ stockStatus: data.stock_status,
88
+ vcpus: data.vcpus
89
+ };
90
+ };
91
+ const unmarshalListNodeTypesResponse = (data) => {
92
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
93
+ return {
94
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
95
+ totalCount: data.total_count
96
+ };
97
+ };
98
+ const unmarshalListUsersResponse = (data) => {
99
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
100
+ return {
101
+ totalCount: data.total_count,
102
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
103
+ };
104
+ };
105
+ const unmarshalVersion = (data) => {
106
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
107
+ return {
108
+ beta: data.beta,
109
+ disabled: data.disabled,
110
+ endOfLife: unmarshalDate(data.end_of_life),
111
+ version: data.version
112
+ };
113
+ };
114
+ const unmarshalListVersionsResponse = (data) => {
115
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
116
+ return {
117
+ totalCount: data.total_count,
118
+ versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
119
+ };
120
+ };
121
+ const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
122
+ const marshalEndpointSpecPublicDetails = (request, defaults) => ({});
123
+ const marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
124
+ param: "public",
125
+ value: request.public !== void 0 ? marshalEndpointSpecPublicDetails(request.public, defaults) : void 0
126
+ }, {
127
+ param: "private_network",
128
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
129
+ }]) });
130
+ const marshalVolume = (request, defaults) => ({
131
+ size_bytes: request.sizeBytes,
132
+ type: request.type
133
+ });
134
+ const marshalCreateDeploymentRequest = (request, defaults) => ({
135
+ endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
136
+ name: request.name,
137
+ node_amount: request.nodeAmount,
138
+ node_count: request.nodeCount,
139
+ node_type: request.nodeType,
140
+ password: request.password,
141
+ project_id: request.projectId ?? defaults.defaultProjectId,
142
+ tags: request.tags,
143
+ user_name: request.userName,
144
+ version: request.version,
145
+ volume: request.volume !== void 0 ? marshalVolume(request.volume, defaults) : void 0
146
+ });
147
+ const marshalCreateEndpointRequest = (request, defaults) => ({
148
+ deployment_id: request.deploymentId,
149
+ endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec, defaults) : void 0
150
+ });
151
+ const marshalCreateUserRequest = (request, defaults) => ({
152
+ password: request.password,
153
+ username: request.username
154
+ });
155
+ const marshalUpdateDeploymentRequest = (request, defaults) => ({
156
+ name: request.name,
157
+ tags: request.tags
158
+ });
159
+ const marshalUpdateUserRequest = (request, defaults) => ({ password: request.password });
160
+ const marshalUpgradeDeploymentRequest = (request, defaults) => ({ ...resolveOneOf([
161
+ {
162
+ param: "node_amount",
163
+ value: request.nodeAmount
164
+ },
165
+ {
166
+ param: "node_count",
167
+ value: request.nodeCount
168
+ },
169
+ {
170
+ param: "volume_size_bytes",
171
+ value: request.volumeSizeBytes
172
+ }
173
+ ]) });
174
+ //#endregion
175
+ export { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, marshalUpgradeDeploymentRequest, unmarshalDeployment, unmarshalEndpoint, unmarshalListDeploymentsResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser };
@@ -0,0 +1,64 @@
1
+ export declare const queriesMetadata: {
2
+ readonly namespace: 'searchdb';
3
+ readonly version: 'v1alpha1';
4
+ readonly folderName: 'searchdbv1alpha1';
5
+ readonly services: readonly [{
6
+ readonly apiClass: 'API';
7
+ readonly methods: readonly [{
8
+ readonly methodName: 'getDeployment';
9
+ readonly protoName: 'GetDeployment';
10
+ readonly paramsType: 'GetDeploymentRequest';
11
+ readonly returnType: 'Deployment';
12
+ readonly isList: false;
13
+ readonly paginationType: 'none';
14
+ readonly isPrivate: false;
15
+ readonly description: '"';
16
+ readonly hasWaiter: true;
17
+ }, {
18
+ readonly methodName: 'listDeployments';
19
+ readonly protoName: 'ListDeployments';
20
+ readonly paramsType: 'ListDeploymentsRequest';
21
+ readonly returnType: 'ListDeploymentsResponse';
22
+ readonly isList: true;
23
+ readonly paginationType: 'offset';
24
+ readonly pageParamKey: 'page';
25
+ readonly listItemType: 'Deployment';
26
+ readonly isPrivate: false;
27
+ readonly description: '"';
28
+ }, {
29
+ readonly methodName: 'listVersions';
30
+ readonly protoName: 'ListVersions';
31
+ readonly paramsType: 'ListVersionsRequest';
32
+ readonly returnType: 'ListVersionsResponse';
33
+ readonly isList: true;
34
+ readonly paginationType: 'offset';
35
+ readonly pageParamKey: 'page';
36
+ readonly listItemType: 'Version';
37
+ readonly isPrivate: false;
38
+ readonly description: '"';
39
+ }, {
40
+ readonly methodName: 'listNodeTypes';
41
+ readonly protoName: 'ListNodeTypes';
42
+ readonly paramsType: 'ListNodeTypesRequest';
43
+ readonly returnType: 'ListNodeTypesResponse';
44
+ readonly isList: true;
45
+ readonly paginationType: 'offset';
46
+ readonly pageParamKey: 'page';
47
+ readonly listItemType: 'NodeType';
48
+ readonly isPrivate: false;
49
+ readonly description: '"';
50
+ }, {
51
+ readonly methodName: 'listUsers';
52
+ readonly protoName: 'ListUsers';
53
+ readonly paramsType: 'ListUsersRequest';
54
+ readonly returnType: 'ListUsersResponse';
55
+ readonly isList: true;
56
+ readonly paginationType: 'offset';
57
+ readonly pageParamKey: 'page';
58
+ readonly listItemType: 'User';
59
+ readonly isPrivate: false;
60
+ readonly description: '"';
61
+ }];
62
+ }];
63
+ };
64
+ export type QueriesMetadata = typeof queriesMetadata;